Opened 5 weeks ago

Closed 4 weeks 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 cehoyos 5 weeks ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 weeks ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords audio removed
  • Priority changed from normal to wish
  • Version changed from unspecified to git-master

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

Changed 5 weeks ago by cehoyos

comment:3 Changed 5 weeks ago by cehoyos

  • Reproduced by developer set
  • Status changed from new to open

Please test attached patch.

comment:4 follow-up: Changed 5 weeks ago by 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.
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 -

comment:5 in reply to: ↑ 4 Changed 4 weeks ago by cehoyos

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 Changed 4 weeks ago by cehoyos

  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.