#9891: can not transcoding amr to pcm from rtp stream
-------------------------------------+-------------------------------------
Reporter: songtao | Owner: (none)
Type: defect | Status: reopened
Priority: important | Component:
| undetermined
Version: unspecified | Resolution:
Keywords: RTP | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Changes (by songtao):
* status: closed => reopened
* resolution: invalid =>
Comment:
Replying to [comment:2 Elon Musk]: capturing before string does not fix
this problem, the
record still only has less than one second audio whatever how long i
record.
1. start capturing
10:20:26 😃 8-arm> ffmpeg -y -protocol_whitelist 'file,rtp,udp' -i
source.sdp -c:a pcm_alaw output-amrwb.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
Input #0, sdp, from 'source.sdp':
Metadata:
title : No Name
Duration: N/A, start: -0.001000, bitrate: N/A
Stream #0:0: Audio: amr_nb, 8000 Hz, mono, fltp
Stream mapping:
Stream #0:0 -> #0:0 (amr_nb (amrnb) -> pcm_alaw (native))
Press [q] to stop, [?] for help
Output #0, wav, to 'output-amrwb.wav':
Metadata:
INAM : No Name
ISFT : Lavf59.27.100
Stream #0:0: Audio: pcm_alaw ([6][0][0][0] / 0x0006), 8000 Hz, mono,
s16, 64 kb/s
Metadata:
encoder : Lavc59.37.100 pcm_alaw
size= 4kB time=00:00:15.72 bitrate= 1.9kbits/s speed=1.05x
[q] command received. Exiting.
size= 4kB time=00:00:15.72 bitrate= 1.9kbits/s speed= 1x
video:0kB audio:4kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 2.934783%
2. streaming
10:20:27 😃 8-arm> ffmpeg -use_wallclock_as_timestamps 1 -f alsa -i hw:0
-map_channel 0.0.0 -ar 8000 -c:a amr_nb -f rtp 'rtp://localhost:10018'
-sdp_file source.sdp
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 : stereo
Input #0, alsa, from 'hw:0':
Duration: N/A, start: 1661394131.475158, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> amr_nb (libopencore_amrnb))
Press [q] to stop, [?] for help
-map_channel is forwarded to lavfi similarly to -af pan=mono|c0=c0.
[pan @ 0x56319603ecc0] [SWR @ 0x56319605dc80] Input channel layout has a
different number of channels than the number of used channels, ignoring
layout
[pan @ 0x56319603ecc0] Pure channel mapping detected: 0
[libopencore_amrnb @ 0x56319600a440] bitrate not supported: use one of
4.75k, 5.15k, 5.90k, 6.70k, 7.40k, 7.95k, 10.20k, 12.20k, using 12.20k
Output #0, rtp, to 'rtp://localhost:10018':
Metadata:
encoder : Lavf59.27.100
Stream #0:0: Audio: amr_nb, 8000 Hz, mono, s16, 128 kb/s
Metadata:
encoder : Lavc59.37.100 libopencore_amrnb
size= 97kB time=00:01:01.34 bitrate= 13.0kbits/s speed= 1x
[q] command received. Exiting.
size= 97kB time=00:01:01.36 bitrate= 13.0kbits/s speed= 1x
video:0kB audio:96kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 1.411750%
3. check output
10:22:27 😃 8-arm> ffprobe output-amrwb.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-amrwb.wav':
Metadata:
title : No Name
encoder : Lavf59.27.100
Duration: 00:00:00.46, bitrate: 65 kb/s
Stream #0:0: Audio: pcm_alaw ([6][0][0][0] / 0x0006), 8000 Hz, 1
channels, s16, 64 kb/s
> Operations are not in sync. Capture must be started before streaming.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9891#comment:3>
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".