ffmpeg - streaming audio with vorbis codec over RTP

0

I'm trying to set up streaming audio using RTP protocol and Vorbis codec. Starting with minimal example - generated mono samples with sender and receiver on the same machine (two instances of ffmpeg, version N-91266-g8c20ea8ee0):

Running sender first, saving SDP to file:

ffmpeg -re -f lavfi -i aevalsrc="sin(400*2*PI*t)" -acodec libvorbis -f rtp rtp://127.0.0.1:1234 -sdp_file "g:\sinwave.sdp"

Then receiver:

ffmpeg -protocol_whitelist "file,udp,rtp" -i "g:\sinwave.sdp" -v debug "g:\1.ogg"

The received data saved to file just for example, actually it is planned to write it to pipe or socket)

But I'm getting ffmpeg errors at receiver side:

[sdp @ 0000000000573580] Bad packed header lengths (30,0,2923,3219)
[vorbis @ 0000000000587940] Extradata missing.
Error while opening decoder for input stream #0:0 : Invalid data found when processing input

What options I've missed for ffmpeg on any of the sides?

apdevelop

Posted 2018-08-04T11:46:03.837

Reputation: 101

Answers

0

Looks like creating the SDP file using -sdp_file parameter not working properly, here is the working command line for sender, where SDP file created with redirecting process output (> character):

ffmpeg -re -f lavfi -i aevalsrc="sin(400*2*PI*t)" -acodec libvorbis
-f rtp rtp://127.0.0.1:1234 > "g:\sinwave.sdp"

The resulting SDP file has size of 4503 bytes (instead of 4095 bytes) with larger configuration= line; finally both ffmpeg and ffplayer can receive stream using that SDP file.

apdevelop

Posted 2018-08-04T11:46:03.837

Reputation: 101