Opened 4 years ago

Closed 4 years ago

#6770 closed enhancement (fixed)

RTP streaming does not support 24-bit audio

Reported by: steeley Owned by:
Priority: wish Component: avformat
Version: git-master Keywords: rtp
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

'FFmpeg can only stream 16-bit audio i.e
ffmpeg -re -i 16bitAudioFile.wav -codec copy -f rtp rtp://239.255.0.10:5004 OK

24 bit produces an 'unsupported' codec error.

24 bit 48k audio has been around for years, about time FFmpeg supported it.

Attachments (1)

patchsdpl24.diff (1.8 KB ) - added by Carl Eugen Hoyos 4 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Carl Eugen Hoyos, 4 years ago

Component: undeterminedavformat
Keywords: audio removed
Priority: normalwish
Version: unspecifiedgit-master

Which rfc describes how to send 24bit audio over rtp?

by Carl Eugen Hoyos, 4 years ago

Attachment: patchsdpl24.diff added

comment:3 by Carl Eugen Hoyos, 4 years ago

Reproduced by developer: set
Status: newopen

Please test attached patch.

comment:4 by steeley, 4 years ago

Thanks cehoyos - good work :)

A quick test seems to work for big-endian format. I had to specify pcm_s24be as my file is pcm24le.
Might be good to add support for that as well.
Also tried VLC 2.2.4 but it would not play using the SDP file.

Method:
Test machine = macbook pro OSX 10.11.6. Everything below works without error.

FFmpeg from git and apply your patch.
./configure --prefix=/usr/local --enable-gpl --enable-nonfree
make
make install

Test string:
ffmpeg -re -i voice2448.wav -codec pcm_s24be -f rtp rtp://239.255.0.10:5004

Play with FFplay:( SDP info. from FFmpeg into file 'astream.sdp')
ffplay -protocol_whitelist file,udp,rtp -i astream.sdp

Play using rtpdump with sox play:
rtpdump -F payload 239.255.0.10/5004 | play -c 2 -r 48000 -b 24 -e signed-integer -B -t raw -

in reply to:  4 comment:5 by Carl Eugen Hoyos, 4 years ago

Replying to steeley:

Thanks cehoyos - good work :)

A quick test seems to work for big-endian format. I had to specify pcm_s24be as my file is pcm24le.
Might be good to add support for that as well.

To quote the RFC:
The samples are packed contiguously into payload octets starting with the most significant bit.

Also tried VLC 2.2.4 but it would not play using the SDP file.

Method:
Test machine = macbook pro OSX 10.11.6. Everything below works without error.

FFmpeg from git and apply your patch.
./configure --prefix=/usr/local --enable-gpl --enable-nonfree
make
make install

Test string:
ffmpeg -re -i voice2448.wav -codec pcm_s24be -f rtp rtp://239.255.0.10:5004

Play with FFplay:( SDP info. from FFmpeg into file 'astream.sdp')

The idea would of course be to test with anything but FFmpeg ...

ffplay -protocol_whitelist file,udp,rtp -i astream.sdp

Play using rtpdump with sox play:
rtpdump -F payload 239.255.0.10/5004 | play -c 2 -r 48000 -b 24 -e signed-integer -B -t raw -

... without specifying all parameters on the command line.

comment:6 by Carl Eugen Hoyos, 4 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.