Discussion:
[FFmpeg-user] importing rtp packet stream and decoding
Dave Horton
2017-09-15 17:36:58 UTC
Permalink
Does anyone have a good recipe or example on how to import an rtp stream and decode it with ffmpeg. I have both the rtp file and the associate SDP description of the payloads, but haven’t been able to pipe it into ffmpeg to have it decoded.
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpe
Carl Eugen Hoyos
2017-09-15 17:41:17 UTC
Permalink
Post by Dave Horton
Does anyone have a good recipe or example on how to import an rtp stream and decode it with ffmpeg. I have both the rtp file and the associate SDP description of the payloads, but haven’t been able to pipe it into ffmpeg to have it decoded.
Both sending and receiving opus via rtp is implemented in FFmpeg,
what did you try?

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org wi
Dave Horton
2017-09-15 17:49:04 UTC
Permalink
Post by Dave Horton
Post by Dave Horton
Does anyone have a good recipe or example on how to import an rtp stream
and decode it with ffmpeg. I have both the rtp file and the associate SDP
description of the payloads, but haven’t been able to pipe it into ffmpeg
to have it decoded.
Both sending and receiving opus via rtp is implemented in FFmpeg,
what did you try?
Carl Eugen
_______________________________________________
I tried

ffmpeg -loglevel debug -f rtp -c:a opus -i call2.rtpdump -ar 48000
call2.mp3

does that look right?

I get 'Unsupported RTP version packet received' and a whole bunch of
'Received too short packet' so perhaps my data is bad.

But I am wondering where/how to give ffmpeg the sdp information so it will
now how to decode the payload types etc
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org with subject "
Carl Eugen Hoyos
2017-09-15 18:08:23 UTC
Permalink
Post by Dave Horton
Post by Dave Horton
Post by Dave Horton
Does anyone have a good recipe or example on how to import an rtp stream
and decode it with ffmpeg. I have both the rtp file and the associate SDP
description of the payloads, but haven’t been able to pipe it into ffmpeg
to have it decoded.
Both sending and receiving opus via rtp is implemented in FFmpeg,
what did you try?
I tried
ffmpeg -loglevel debug -f rtp -c:a opus -i call2.rtpdump -ar 48000
call2.mp3
does that look right?
I tested the following in one terminal (assuming long input):
$ ffmpeg -i input -acodec opus -strict -2 -f rtp rtp://127.0.0.1/1234 >out.sdp

and in a second terminal:
$ ffplay -protocol_whitelist rtp,file,udp -i out.sdp
Post by Dave Horton
I get 'Unsupported RTP version packet received' and a whole bunch of
'Received too short packet' so perhaps my data is bad.
Maybe, but I suspect you have to pass the sdp info.
Post by Dave Horton
But I am wondering where/how to give ffmpeg the sdp information so it will
now how to decode the payload types etc
Put it into a file and pass that to FFmpeg (should get auto-detected).

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org with subject "unsubscribe"
Dave Horton
2017-09-18 22:32:56 UTC
Permalink
Post by Dave Horton
Post by Dave Horton
Post by Dave Horton
Does anyone have a good recipe or example on how to import an rtp stream
and decode it with ffmpeg. I have both the rtp file and the associate SDP
description of the payloads, but haven’t been able to pipe it into ffmpeg
to have it decoded.
Both sending and receiving opus via rtp is implemented in FFmpeg,
what did you try?
I tried
ffmpeg -loglevel debug -f rtp -c:a opus -i call2.rtpdump -ar 48000
call2.mp3
does that look right?
I tested the following in one terminal (assuming long input):
$ ffmpeg -i input -acodec opus -strict -2 -f rtp rtp://127.0.0.1/1234 >out.sdp

and in a second terminal:
$ ffplay -protocol_whitelist rtp,file,udp -i out.sdp
Post by Dave Horton
I get 'Unsupported RTP version packet received' and a whole bunch of
'Received too short packet' so perhaps my data is bad.
Maybe, but I suspect you have to pass the sdp info.
Post by Dave Horton
But I am wondering where/how to give ffmpeg the sdp information so it will
now how to decode the payload types etc
Put it into a file and pass that to FFmpeg (should get auto-detected).

Carl Eugen
_______________________________________________


I’m sorry to be stumbling through this, but here is my first attempt:
note that I have one file with my sdp description in it, and a second file that has the rtp stream I captured

Clearly, my sdp file was not recognized:

MacBook-Pro-6:test dhorton$ ffmpeg -loglevel debug -i rtp1.sdp -f rtp -i rtp1.rtp -f mp3 rtp1.mp3
ffmpeg version N-87034-geca2a49 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 7.3.0 (clang-703.0.29)
configuration: --disable-optimizations --disable-stripping --enable-debug --extra-cflags='-g -O0' --enable-libmp3lame
libavutil 55. 74.100 / 55. 74.100
libavcodec 57.103.100 / 57.103.100
libavformat 57. 76.100 / 57. 76.100
libavdevice 57. 7.101 / 57. 7.101
libavfilter 6.100.100 / 6.100.100
libswscale 4. 7.102 / 4. 7.102
libswresample 2. 8.100 / 2. 8.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-i' ... matched as input url with argument 'rtp1.sdp'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'rtp'.
Reading option '-i' ... matched as input url with argument 'rtp1.rtp'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'mp3'.
Reading option 'rtp1.mp3' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url rtp1.sdp.
Successfully parsed a group of options.
Opening an input file: rtp1.sdp.
[NULL @ 0x7fab14001000] Opening 'rtp1.sdp' for reading
[file @ 0x7fab13700e40] Setting default whitelist 'file,crypto'
[sdp @ 0x7fab14001000] Format sdp probed with size=2048 and score=50
[sdp @ 0x7fab14001000] Before avformat_find_stream_info() pos: 279 bytes read:279 seeks:0 nb_streams:0
[sdp @ 0x7fab14001000] All info found
[sdp @ 0x7fab14001000] After avformat_find_stream_info() pos: 279 bytes read:279 seeks:0 frames:0
Input #0, sdp, from 'rtp1.sdp':
Metadata:
title : session
Duration: N/A, bitrate: N/A
Successfully opened the file.
Parsing a group of options: input url rtp1.rtp.
Applying option f (force format) with argument rtp.
Successfully parsed a group of options.
Opening an input file: rtp1.rtp.
[file @ 0x7fab13701c60] Setting default whitelist 'file,crypto'
[rtp @ 0x7fab14009600] Guessing on RTP content - if not received properly you need an SDP file describing it
[rtp @ 0x7fab14009600] SDP:
v=0
c=IN IP6
m=audio -1 RTP/AVP 0

[rtp @ 0x7fab14009600] getaddrinfo(): nodename nor servname provided, or not known
[rtp @ 0x7fab14009600] getnameinfo: ai_family not supported
rtp1.rtp: Input/output error
[AVIOContext @ 0x7fab13700f80] Statistics: 279 bytes read, 0 seeks

my sdp file contains this:

v=0
o=root 2116403914 2116403914 IN IP4 81.201.82.161
s=session
c=IN IP4 35.195.214.30
t=0 0\r\nm=audio 40558 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
a=rtcp:40559

_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpe
Carl Eugen Hoyos
2017-09-18 22:50:42 UTC
Permalink
Post by Dave Horton
MacBook-Pro-6:test dhorton$ ffmpeg -loglevel debug
-i rtp1.sdp -f rtp -i rtp1.rtp -f mp3 rtp1.mp3
My knowledge of sdp and rtp is very limited but I believe
(and I believe my example in my last mail confirmed it,
by the way did you test it?) you only provide the sdp
file which contains a network address where FFmpeg is
supposed to find the rtp stream.

I don't know how to feed the captured rtp stream, my
guess is you have to edit the sdp file and resend the
stream.

Unrelated: -O0 can have funny (unwanted) effects when
compiling FFmpeg and having debug information is the
default, so you can remove the extra-cflags from your
configure line. The option --disable-optimizations is
usually unwanted (unless you want to test for compiler
bugs or need extra-fast compilation, I don't even use it
for bisects).

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffm
Dave Horton
2017-09-19 13:59:15 UTC
Permalink
I don't know how to feed the captured rtp stream, my
guess is you have to edit the sdp file and resend the
stream.


Carl

Yes, I am starting to think this could be quite complicated. I have a pcap file with rtp, and I have the related SDPs for the two streams, but after looking into the ffmpeg code a bit it seems like it can only take rtp streams from a network port, not a file, which seems to mean that I would have to:

- rewrite the udp headers to change the src and dest addresses to localhost from their original values
- probably this means updating the checksums in the udp packets as well
- do the same with the sdps
- find some way to play the (modified) rtp stream from a file to a localhost udp port (I don’t think ffmpeg can do this, since it can’t take rtp input from a file?)
- spawn an instance of ffmpeg, feed it the modified sdp and point it to the localhost port for rtp input to get a decoded version of the audio out

The whole thing seems pretty complicated and likely to be quite brittle…unless I am missing something ?

_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user
Dave Horton
2017-09-22 18:50:08 UTC
Permalink
So I am trying to feed the captured rtp stream into ffmpeg and get a transcoded output. Not quite working and I could use some help

Basically I have
1. An sdp file that describes the rtp, and indicates which port (on localhost) the rtp will be arriving on
2. A process / utility that reads the rtp from a file and then streams it to that port.

I have a node.js application managing all of this — the idea is that it will spawn ffmpeg, send the SDP in on its stdin, instruct ffmpeg about the output, then spawn the utility to start the rtp stream.

I start up ffmpeg with these arguments:

ffmpeg -loglevel debug -y -protocol_whitelist file,crypto,udp,rtp,pipe -i pipe:0 map 0:0 foo.wav

I feed it the SDP, and at that point all looks good — from the logging (which I will show below) it appears like ffmpeg has decoded the SDP and started listening on the rtp port specified in the SDP (127.0.0.1:40558 in this case).

However, once it begins receiving rtp it logs an error: "Unable to find a suitable output format for ‘'

Am I doing something wrong with my command above? My intent is to instruct it to take the first rtp stream and encode it a wav file called ‘foo.wav’.

Here is the complete output (note because I am starting ffmpeg as a child process the logging is coming through the parent process which is adding the 'ffmpeg stderr says..’ etc)

************ console log
args: -loglevel debug -y -protocol_whitelist file,crypto,udp,rtp,pipe -i pipe:0 map 0:0 foo.wav

ffmpeg stderr says: ffmpeg version N-85641-gdd49eff-tessus Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-libzvbi --enable-version3 --disable-ffplay --disable-indev=qtkit

ffmpeg stderr says: libavutil 55. 61.100 / 55. 61.100
libavcodec 57. 93.100 / 57. 93.100
libavformat 57. 72.101 / 57. 72.101
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 86.100 / 6. 86.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '' ... matched as output url.
Reading option '-protocol_whitelist' ... matched as AVOption 'protocol_whitelist' with argument 'file,crypto,udp,rtp,pipe'.
Reading option '-i' ... matched as input url with argument 'pipe:0'.
Reading option 'map' ... matched as output url.
Reading option '0:0' ... matched as output url.
Reading option 'foo.wav' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url pipe:0.
Successfully parsed a group of options.
Opening an input file: pipe:0.
[sdp @ 0x7fd483808000] Format sdp probed with size=2048 and score=50

ffmpeg stderr says: [sdp @ 0x7fd483808000] audio codec set to: pcm_mulaw
[sdp @ 0x7fd483808000] audio samplerate set to: 8000
[sdp @ 0x7fd483808000] audio channels set to: 1
[sdp @ 0x7fd483808000] audio codec set to: pcm_alaw
[sdp @ 0x7fd483808000] audio samplerate set to: 8000
[sdp @ 0x7fd483808000] audio channels set to: 1
[sdp @ 0x7fd483808000] audio codec set to: pcm_alaw
[sdp @ 0x7fd483808000] audio samplerate set to: 8000
[sdp @ 0x7fd483808000] audio channels set to: 1
[udp @ 0x7fd4835012e0] end receive buffer size reported is 65536
[udp @ 0x7fd4835014e0] end receive buffer size reported is 65536
[sdp @ 0x7fd483808000] setting jitter buffer size to 500
[sdp @ 0x7fd483808000] Before avformat_find_stream_info() pos: 286 bytes read:286 seeks:0 nb_streams:1



start pcap reader..
running /Users/dhorton/beachdog-enterprises/beachdog-networks/git/voxbone/node-transcode-pcap/bin/pcapreader
args: ["--port","40558","test/rtpengine.pcap"]
ffmpeg stderr says: [sdp @ 0x7fd483808000] All info found

ffmpeg stderr says: [sdp @ 0x7fd483808000] After avformat_find_stream_info() pos: 286 bytes read:286 seeks:0 frames:1

ffmpeg stderr says: Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, sdp, from 'pipe:0':
Metadata:
title :
ffmpeg stderr says: session
Duration: N/A, start: 0.000000, bitrate: 64 kb/s

ffmpeg stderr says: Stream #0:0, 1, 1/8000: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
Successfully opened the file.
Parsing a group of options: output url .
Successfully parsed a group of options.
Opening an output file: .
[NULL @ 0x7fd483818e00] Unable to find a suitable output format for ''
: Invalid argument

ffmpeg stderr says: [AVIOContext @ 0x7fd483416820] Statistics: 286 bytes read, 0 seeks

ffmpeg exited with 1


On Sep 19, 2017, at 9:59 AM, Dave Horton <***@beachdognet.com> wrote:



I don't know how to feed the captured rtp stream, my
guess is you have to edit the sdp file and resend the
stream.


Carl

Yes, I am starting to think this could be quite complicated. I have a pcap file with rtp, and I have the related SDPs for the two streams, but after looking into the ffmpeg code a bit it seems like it can only take rtp streams from a network port, not a file, which seems to mean that I would have to:

- rewrite the udp headers to change the src and dest addresses to localhost from their original values
- probably this means updating the checksums in the udp packets as well
- do the same with the sdps
- find some way to play the (modified) rtp stream from a file to a localhost udp port (I don’t think ffmpeg can do this, since it can’t take rtp input from a file?)
- spawn an instance of ffmpeg, feed it the modified sdp and point it to the localhost port for rtp input to get a decoded version of the audio out

The whole thing seems pretty complicated and likely to be quite brittle…unless I am missing something ?


_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org wit
Dave Horton
2017-09-22 19:26:58 UTC
Permalink
Post by Dave Horton
So I am trying to feed the captured rtp stream into ffmpeg and get a transcoded output. Not quite working and I could use some help
Sorry, my bad — I was able to fix that error — which was a simple typo in my command that led to a blank output url.

With that fixed, I get further:

Now I am able to generate a wav file, but I still have several issues and questions

1. It sounds like crap — the audio is recognizable but barely. Something is either wrong in the input feed I am sending, or what ffmpeg thinks it is receiving. I did a wireshark trace during the execution to see exactly what was going over the wire, and it was the true and correct RTP packets as best I can tell (RTP headers, sequence numbers, payload types, etc all look good).

2. ffmpeg takes quite a while to decode this file….maybe an additional 10 seconds after the utility has finished sending….how can I signal to ffmpeg that the stream is over?

3. Is there any good way to synchronize ffmpeg with the sending utility? Right now, I start ffmpeg first, but I have no way of knowing when it has opened the socket on the local port and is ready to receive. I’m currently just waiting 2 seconds after feeding it the SDP before I start sending RTP, but is there a better way?

***new logs**

args: -loglevel debug -y -protocol_whitelist file,crypto,udp,rtp,pipe -re -i pipe:0 foo.wav

ffmpeg stderr says: ffmpeg version N-85641-gdd49eff-tessus Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-libzvbi --enable-version3 --disable-ffplay --disable-indev=qtkit

ffmpeg stderr says: libavutil 55. 61.100 / 55. 61.100
libavcodec 57. 93.100 / 57. 93.100
libavformat 57. 72.101 / 57. 72.101
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 86.100 / 6. 86.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-protocol_whitelist' ... matched as AVOption 'protocol_whitelist' with argument 'file,crypto,udp,rtp,pipe'.
Reading option '-re' ... matched as option 're' (read input at native frame rate) with argument '1'.
Reading option '-i' ... matched as input url with argument 'pipe:0'.
Reading option 'foo.wav' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url pipe:0.
Applying option re (read input at native frame rate) with argument 1.
Successfully parsed a group of options.
Opening an input file: pipe:0.
[sdp @ 0x7ff9f4000000] Format sdp probed with size=2048 and score=50

ffmpeg stderr says: [sdp @ 0x7ff9f4000000] audio codec set to: pcm_mulaw
[sdp @ 0x7ff9f4000000] audio samplerate set to: 8000
[sdp @ 0x7ff9f4000000] audio channels set to: 1
[sdp @ 0x7ff9f4000000] audio codec set to: pcm_alaw
[sdp @ 0x7ff9f4000000] audio samplerate set to: 8000
[sdp @ 0x7ff9f4000000] audio channels set to: 1
[sdp @ 0x7ff9f4000000] audio codec set to: pcm_alaw
[sdp @ 0x7ff9f4000000] audio samplerate set to: 8000
[sdp @ 0x7ff9f4000000] audio channels set to: 1
[udp @ 0x7ff9f3501400] end receive buffer size reported is 65536
[udp @ 0x7ff9f35017c0] end receive buffer size reported is 65536
[sdp @ 0x7ff9f4000000] setting jitter buffer size to 500
[sdp @ 0x7ff9f4000000] Before avformat_find_stream_info() pos: 286 bytes read:286 seeks:0 nb_streams:1

[Note: I start sending RTP here]

ffmpeg stderr says: [sdp @ 0x7ff9f4000000] All info found

ffmpeg stderr says: [sdp @ 0x7ff9f4000000] After avformat_find_stream_info() pos: 286 bytes read:286 seeks:0 frames:1
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, sdp, from 'pipe:0':
Metadata:
title : session
Duration: N/A, start: 0.000000, bitrate: 64 kb/s

ffmpeg stderr says: Stream #0:0, 1, 1/8000: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
Successfully opened the file.
Parsing a group of options: output url foo.wav.
Successfully parsed a group of options.
Opening an output file: foo.wav.
[file @ 0x7ff9f3417e40] Setting default whitelist 'file,crypto'

ffmpeg stderr says: Successfully opened the file.

ffmpeg stderr says: Stream mapping:
Stream #0:0 -> #0:0 (pcm_alaw (native) -> pcm_s16le (native))
cur_dts is invalid (this is harmless if it occurs once at the start per stream)

ffmpeg stderr says: detected 8 logical cores

ffmpeg stderr says: [graph_0_in_0_0 @ 0x7ff9f51000a0] Setting 'time_base' to value '1/8000'
[graph_0_in_0_0 @ 0x7ff9f51000a0] Setting 'sample_rate' to value '8000'
[graph_0_in_0_0 @ 0x7ff9f51000a0] Setting 'sample_fmt' to value 's16'
[graph_0_in_0_0 @ 0x7ff9f51000a0] Setting 'channel_layout' to value '0x4'

ffmpeg stderr says: [graph_0_in_0_0 @ 0x7ff9f51000a0] tb:1/8000 samplefmt:s16 samplerate:8000 chlayout:0x4
[format_out_0_0 @ 0x7ff9f5100660] Setting 'sample_fmts' to value 's16'

ffmpeg stderr says: [AVFilterGraph @ 0x7ff9f5200340] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed

ffmpeg stderr says: Output #0, wav, to 'foo.wav':
Metadata:
INAM : session
ISFT : Lavf57.72.101

ffmpeg stderr says: Stream #0:0, 0, 1/8000: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 8000 Hz, mono, s16, 128 kb/s
Metadata:
encoder : Lavc57.93.100 pcm_s16le

[my sending RTP utility is done here…]
[these next few log lines are pumped out slowly over ~5-8 seconds]

ffmpeg stderr says: size= 8kB time=00:00:00.52 bitrate= 129.4kbits/s speed=1.04x
ffmpeg stderr says: size= 16kB time=00:00:01.02 bitrate= 128.7kbits/s speed=1.02x
ffmpeg stderr says: size= 24kB time=00:00:01.52 bitrate= 128.5kbits/s speed=1.01x
ffmpeg stderr says: size= 32kB time=00:00:02.02 bitrate= 128.4kbits/s speed= 1x
ffmpeg stderr says: size= 38kB time=00:00:02.70 bitrate= 116.0kbits/s speed=1.07x
ffmpeg stderr says: pipe:0: Operation timed out
No more output streams to write to, finishing.5kbits/s speed=0.216x

ffmpeg stderr says: size= 40kB time=00:00:02.82 bitrate= 116.5kbits/s speed=0.216x
video:0kB audio:40kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.229492%
Input file #0 (pipe:0):
Input stream #0:0 (audio): 128 packets read (20480 bytes); 128 frames decoded (20480 samples);
Total: 128 packets (20480 bytes) demuxed
Output file #0 (foo.wav):
Output stream #0:0 (audio): 128 frames encoded (20480 samples); 128 packets muxed (40960 bytes);
Total: 128 packets (40960 bytes) muxed
128 frames successfully decoded, 0 decoding errors

ffmpeg stderr says: [AVIOContext @ 0x7ff9f3417f80] Statistics: 4 seeks, 131 writeouts

ffmpeg stderr says: [AVIOContext @ 0x7ff9f3500680] Statistics: 286 bytes read, 0 seeks

ffmpeg exited with 0


_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org with
Dave Horton
2017-09-22 19:41:50 UTC
Permalink
Post by Dave Horton
Sorry, my bad — I was able to fix that error — which was a simple typo in my command that led to a blank output url.
Now I have figured out why the audio sounded like crap. The problem was that ffmpeg was treating the input stream as pcma, when it in fact was pcmu.
The issue is that the SDP indicated that the audio endpoint was able to receive _either_ pcmu or pcma — both were in the SDP, as follows:

v=0
o=root 2116403914 2116403914 IN IP4 81.201.82.161
s=session
c=IN IP4 127.0.0.1
t=0 0
m=audio 40558 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtcp:40559
a=ptime:20
a=sendrecv
a=silenceSupp:off - - - -

However, the rtp stream contained only PCMU audio. The payload type of 0 in the RTP header should have clued ffmpeg in that this was PCMU, as per the SDP. Yet ffmpeg logged out that it was PCMA and transcoded it as such, incorrectly.

This seems like a bug to me, should I recreate on HEAD and open a ticket somewhere?

I’m still wondering about to sync my sending side with ffmpeg being ready to receive, and also if lengthier decodes are expected when using rtp vs file


_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org with

Loading...