#9891: can not transcoding amr to pcm from rtp stream
-------------------------------------+-------------------------------------
Reporter: songtao | Type: defect
Status: new | Priority: important
Component: | Version:
undetermined | unspecified
Keywords: RTP | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
ffmpeg can not directly transcode amr to pcm from rtp stream, but it can
transcode amr to pcm from file.
How to reproduce:
1. ffmpeg -v 9 -loglevel 99 -protocol_whitelist 'file,rtp,udp' -i
source.sdp -c:a pcm_s16le pcm.wav
ffmpeg version n5.1 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)
configuration: --disable-stripping --extra-
cflags=-I/home/jimery/.local/include --extra-
ldflags=-L/home/jimery/.local/lib --extra-libs='-lpthread -lm' --enable-
gpl --enable-nonfree --enable-
libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-
libvo-amrwbenc --prefix=/home/jimery/.local
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with
argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging
level) with argument '99'.
Reading option '-protocol_whitelist' ... matched as AVOption
'protocol_whitelist' with argument 'file,rtp,udp'.
Reading option '-i' ... matched as input url with argument 'source.sdp'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument
'pcm_s16le'.
Reading option 'pcm.wav' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Successfully parsed a group of options.
Parsing a group of options: input url source.sdp.
Successfully parsed a group of options.
Opening an input file: source.sdp.
[NULL @ 0x55e1104975c0] Opening 'source.sdp' for reading
Probing sdp score:50 size:197
[sdp @ 0x55e1104975c0] Format sdp probed with size=2048 and score=50
[sdp @ 0x55e1104975c0] sdp: v='0'
[sdp @ 0x55e1104975c0] sdp: o='- 0 0 IN IP4 127.0.0.1'
[sdp @ 0x55e1104975c0] sdp: s='No Name'
[sdp @ 0x55e1104975c0] sdp: c='IN IP4 127.0.0.1'
[sdp @ 0x55e1104975c0] sdp: t='0 0'
[sdp @ 0x55e1104975c0] sdp: a='tool:libavformat LIBAVFORMAT_VERSION'
[sdp @ 0x55e1104975c0] sdp: m='audio 10018 RTP/AVP 107'
[sdp @ 0x55e1104975c0] sdp: b='AS:128'
[sdp @ 0x55e1104975c0] sdp: a='rtpmap:107 AMR/8000/1'
[sdp @ 0x55e1104975c0] audio codec set to: amr_nb
[sdp @ 0x55e1104975c0] audio samplerate set to: 8000
[sdp @ 0x55e1104975c0] audio channels set to: 1
[sdp @ 0x55e1104975c0] sdp: a='fmtp:107 octet-align=1'
[udp @ 0x55e11049cf80] end receive buffer size reported is 425984
[udp @ 0x55e11049d080] end receive buffer size reported is 425984
[sdp @ 0x55e1104975c0] setting jitter buffer size to 500
[sdp @ 0x55e1104975c0] Before avformat_find_stream_info() pos: 197 bytes
read:197 seeks:0 nb_streams:1
[sdp @ 0x55e1104975c0] All info found
[sdp @ 0x55e1104975c0] stream 0: start_time: 0 duration: NOPTS
[sdp @ 0x55e1104975c0] format: start_time: 0 duration: NOPTS (estimate
from bit rate) bitrate=0 kb/s
[sdp @ 0x55e1104975c0] After avformat_find_stream_info() pos: 197 bytes
read:197 seeks:0 frames:1
Input #0, sdp, from 'source.sdp':
Metadata:
title : No Name
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0, 1, 1/8000: Audio: amr_nb, 8000 Hz, mono, fltp
Successfully opened the file.
Parsing a group of options: output url pcm.wav.
Applying option c:a (codec name) with argument pcm_s16le.
Successfully parsed a group of options.
Opening an output file: pcm.wav.
File 'pcm.wav' already exists. Overwrite? [y/N] y
[file @ 0x55e1104df5c0] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
Stream mapping:
Stream #0:0 -> #0:0 (amr_nb (amrnb) -> pcm_s16le (native))
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless
if it occurs once at the start per stream)
detected 8 logical cores
[graph_0_in_0_0 @ 0x55e1104e1f40] Setting 'time_base' to value '1/8000'
[graph_0_in_0_0 @ 0x55e1104e1f40] Setting 'sample_rate' to value '8000'
[graph_0_in_0_0 @ 0x55e1104e1f40] Setting 'sample_fmt' to value 'fltp'
[graph_0_in_0_0 @ 0x55e1104e1f40] Setting 'channel_layout' to value 'mono'
[graph_0_in_0_0 @ 0x55e1104e1f40] tb:1/8000 samplefmt:fltp samplerate:8000
chlayout:mono
[format_out_0_0 @ 0x55e1104e3040] Setting 'sample_fmts' to value 's16'
[format_out_0_0 @ 0x55e1104e3040] auto-inserting filter 'auto_aresample_0'
between the filter 'Parsed_anull_0' and the filter 'format_out_0_0'
[AVFilterGraph @ 0x55e1104e0e80] query_formats: 4 queried, 6 merged, 3
already done, 0 delayed
[auto_aresample_0 @ 0x55e1104e4700] [SWR @ 0x55e1104e48c0] Using fltp
internally between filters
[auto_aresample_0 @ 0x55e1104e4700] ch:1 chl:mono fmt:fltp r:8000Hz ->
ch:1 chl:mono fmt:s16 r:8000Hz
Output #0, wav, to 'pcm.wav':
Metadata:
INAM : No Name
ISFT : Lavf59.27.100
Stream #0:0, 0, 1/8000: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 8000
Hz, mono, s16, 128 kb/s
Metadata:
encoder : Lavc59.37.100 pcm_s16le
size= 4kB time=00:00:08.51 bitrate= 4.0kbits/s speed=1.36x
[q] command received. Exiting.
size= 4kB time=00:00:08.51 bitrate= 4.0kbits/s speed=1.22x
video:0kB audio:4kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 2.259615%
Input file #0 (source.sdp):
Input stream #0:0 (audio): 13 packets read (14752 bytes); 13 frames
decoded (2080 samples);
Total: 13 packets (14752 bytes) demuxed
Output file #0 (pcm.wav):
Output stream #0:0 (audio): 13 frames encoded (2080 samples); 13 packets
muxed (4160 bytes);
Total: 13 packets (4160 bytes) muxed
[AVIOContext @ 0x55e1104df680] Statistics: 4254 bytes written, 0 seeks, 1
writeouts
13 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x55e1104a0240] Statistics: 197 bytes read, 0 seeks
12:47:42 😃 8-arm> ffplay pcm.wav
ffplay version n5.1 Copyright (c) 2003-2022 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)
configuration: --disable-stripping --extra-
cflags=-I/home/jimery/.local/include --extra-
ldflags=-L/home/jimery/.local/lib --extra-libs='-lpthread -lm' --enable-
gpl --enable-nonfree --enable-
libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-
libvo-amrwbenc --prefix=/home/jimery/.local
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Input #0, wav, from 'pcm.wav':= 0KB vq= 0KB sq= 0B f=0/0
Metadata:
title : No Name
encoder : Lavf59.27.100
Duration: 00:00:00.26, bitrate: 130 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 8000 Hz, 1
channels, s16, 128 kb/s
1.27 M-A: 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
12:47:45 😃 8-arm> ffprobe pcm.wav
ffprobe version n5.1 Copyright (c) 2007-2022 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)
configuration: --disable-stripping --extra-
cflags=-I/home/jimery/.local/include --extra-
ldflags=-L/home/jimery/.local/lib --extra-libs='-lpthread -lm' --enable-
gpl --enable-nonfree --enable-
libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-
libvo-amrwbenc --prefix=/home/jimery/.local
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Input #0, wav, from 'pcm.wav':
Metadata:
title : No Name
encoder : Lavf59.27.100
Duration: 00:00:00.26, bitrate: 130 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 8000 Hz, 1
channels, s16, 128 kb/s
12:47:57 😃 8-arm> ffmpeg -i amr.wav -c:a pcm_s16le output-amr-pcm.wav
ffmpeg version n5.1 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)
configuration: --disable-stripping --extra-
cflags=-I/home/jimery/.local/include --extra-
ldflags=-L/home/jimery/.local/lib --extra-libs='-lpthread -lm' --enable-
gpl --enable-nonfree --enable-
libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-
libvo-amrwbenc --prefix=/home/jimery/.local
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
amr.wav: No such file or directory
12:48:15 ?1 8-arm> ffmpeg -i arm.wav -c:a pcm_s16le output-amr-pcm.wav
ffmpeg version n5.1 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)
configuration: --disable-stripping --extra-
cflags=-I/home/jimery/.local/include --extra-
ldflags=-L/home/jimery/.local/lib --extra-libs='-lpthread -lm' --enable-
gpl --enable-nonfree --enable-
libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-
libvo-amrwbenc --prefix=/home/jimery/.local
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, wav, from 'arm.wav':
Metadata:
title : No Name
encoder : Lavf59.27.100
Duration: 00:00:05.66, bitrate: 14 kb/s
Stream #0:0: Audio: amr_nb (8[0][0][0] / 0x0038), 8000 Hz, mono, fltp,
12 kb/s
File 'output-amr-pcm.wav' already exists. Overwrite? [y/N] y
Stream mapping:
Stream #0:0 -> #0:0 (amr_nb (amrnb) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to 'output-amr-pcm.wav':
Metadata:
INAM : No Name
ISFT : Lavf59.27.100
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 8000 Hz, mono,
s16, 128 kb/s
Metadata:
encoder : Lavc59.37.100 pcm_s16le
size= 99kB time=00:00:06.36 bitrate= 128.1kbits/s speed= 223x
video:0kB audio:99kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.092374%
12:48:40 😃 8-arm> ffplay output-amr-pcm.wav
ffplay version n5.1 Copyright (c) 2003-2022 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)
configuration: --disable-stripping --extra-
cflags=-I/home/jimery/.local/include --extra-
ldflags=-L/home/jimery/.local/lib --extra-libs='-lpthread -lm' --enable-
gpl --enable-nonfree --enable-
libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-
libvo-amrwbenc --prefix=/home/jimery/.local
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Input #0, wav, from 'output-amr-pcm.wav':= 0KB sq= 0B f=0/0
Metadata:
title : No Name
encoder : Lavf59.27.100
Duration: 00:00:06.36, bitrate: 128 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 8000 Hz, 1
channels, s16, 128 kb/s
1.95 M-A: 0.000 fd= 0 aq= 31KB vq= 0KB sq= 0B f=0/0
12:48:44 😃 8-arm> ffprobe output-amr-pcm.wav
ffprobe version n5.1 Copyright (c) 2007-2022 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)
configuration: --disable-stripping --extra-
cflags=-I/home/jimery/.local/include --extra-
ldflags=-L/home/jimery/.local/lib --extra-libs='-lpthread -lm' --enable-
gpl --enable-nonfree --enable-
libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-
libvo-amrwbenc --prefix=/home/jimery/.local
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Input #0, wav, from 'output-amr-pcm.wav':
Metadata:
title : No Name
encoder : Lavf59.27.100
Duration: 00:00:06.36, bitrate: 128 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 8000 Hz, 1
channels, s16, 128 kb/s
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9891>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
_______________________________________________
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac
To unsubscribe, visit link above, or email
ffmpeg-trac-requ...@ffmpeg.org with subject "unsubscribe".