problem transcoding raw g729 to wav format
I am trying to decode a raw g729 input stream to wav format like so: ffmpeg -loglevel debug -threads 1 -y -acodec g729 -f g729 -i pipe:0 -ar 44100 -acodec pcm_s32le -f wav pipe:1 As you can see, the raw g729 is piped to stdin and the wav output should be piped to stdout. I am seeing this output / errors in the log, and I get an empty wav file: ffmpeg version N-87327-g18821e3ba1-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2017 the FFmpeg developers built with gcc 6.4.0 (Debian 6.4.0-5) 20170906 configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg libavutil 55. 75.100 / 55. 75.100 libavcodec 57.106.101 / 57.106.101 libavformat 57. 82.100 / 57. 82.100 libavdevice 57. 8.101 / 57. 8.101 libavfilter 6.105.100 / 6.105.100 libswscale 4. 7.103 / 4. 7.103 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 '-threads' ... matched as AVOption 'threads' with argument '1’. option '-y' ... matched as option 'y' (overwrite output files) with argument '1’. Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'g729’. Reading option '-f' ... matched as option 'f' (force format) with argument 'g729’. Reading option '-i' ... matched as input url with argument 'pipe:0’. Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '44100’. Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'pcm_s32le’. Reading option '-f' ... matched as option 'f' (force format) with argument 'wav’. Reading option 'pipe:1' ... 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 acodec (force audio codec ('copy' to copy stream)) with argument g729. Applying option f (force format) with argument g729. Successfully parsed a group of options. Opening an input file: pipe:0. [g729 @ 0x3e25da0] Opening 'pipe:0' for reading [pipe @ 0x3e265a0] Setting default whitelist 'crypto' [g729 @ 0x3e25da0] Before avformat_find_stream_info() pos: 0 bytes read:0 seeks:0 nb_streams:1 [g729 @ 0x3e25da0] After avformat_find_stream_info() pos: 0 bytes read:0 seeks:0 frames:0 Guessed Channel Layout for Input Stream #0.0 : mono Input #0, g729, from 'pipe:0': Duration: N/A, bitrate: 8 kb/s Stream #0:0, 0, 1/8000: Audio: g729, 8000 Hz, mono, s16 Successfully opened the file. Parsing a group of options: output url pipe:1. Applying option ar (set audio sampling rate (in Hz)) with argument 44100. Applying option acodec (force audio codec ('copy' to copy stream)) with argument pcm_s32le. Applying option f (force format) with argument wav. Successfully parsed a group of options. Opening an output file: pipe:1. [pipe @ 0x3e2aba0] Setting default whitelist ‘crypto' Successfully opened the file. Stream mapping: Stream #0:0 -> #0:0 (g729 (native) -> pcm_s32le (native)) cur_dts is invalid (this is harmless if it occurs once at the start per stream) No more output streams to write to, finishing. Finishing stream 0:0 without any data written to it. detected 8 logical cores [graph_0_in_0_0 @ 0x3e2daa0] Setting 'time_base' to value '1/8000’ [graph_0_in_0_0 @ 0x3e2daa0] Setting 'sample_rate' to value '8000’ graph_0_in_0_0 @ 0x3e2daa0] Setting 'sample_fmt' to value 's16’ [graph_0_in_0_0 @ 0x3e2daa0] Setting 'channel_layout' to value '0x4’ [graph_0_in_0_0 @ 0x3e2daa0] tb:1/8000 samplefmt:s16 samplerate:8000 chlayout:0x4 format_out_0_0 @ 0x3e25ca0] Setting 'sample_fmts' to value 's32’ [format_out_0_0 @ 0x3e25ca0] Setting 'sample_rates' to value '44100’ [format_out_0_0 @ 0x3e25ca0] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_0' [AVFilterGraph @ 0x3e2c640] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed [auto_resampler_0 @ 0x3e3fd20] [SWR @ 0x3e400c0] Using fltp internally between filters [auto_resampler_0 @ 0x3e3fd20] ch:1 chl:mono fmt:s16 r:8000Hz -> ch:1 chl:mono fmt:s32 r:44100Hz Output #0, wav, to 'pipe:1’: Metadata: ISFT : Lavf57.82.100 Stream #0:0, 0, 1/44100: Audio: pcm_s32le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s32, 1411 kb/s Metadata: encoder : Lavc57.106.101 pcm_s32le size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Input file #0 (pipe:0): Input stream #0:0 (audio): 0 packets read (0 bytes); 0 frames decoded (0 samples); Total: 0 packets (0 bytes) demuxed Output file #0 (pipe:1): Output stream #0:0 (audio): 0 frames encoded (0 samples); 0 packets muxed (0 bytes); Total: 0 packets (0 bytes) muxed Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used) 0 frames successfully decoded, 0 decoding errors Is there something wrong with my command? Interestingly, if I transcode to flac instead of wav, while I get similar errors, an accurate output file _is_ created in that case. Dave
Adding a bit more information to this one….. This also seems somewhat stream-dependant, in that at times when I try to transcode two streams (one at a time) where the streams are opposite sides of the same conversation (i.e. one being the caller speaking and one being the callee), one of the streams will result in an empty file (as originally shown) and one may end up with warnings/errors in the log but yet a wav file is produced. Here are the logs from the latter case: ffmpeg -loglevel debug -threads 1 -y -acodec g729 -f g729 -i pipe:0 -ar 44100 -acodec pcm_s32le -f wav pipe:1 transcoder err output: [g729 @ 0x3e25da0] Before avformat_find_stream_info() pos: 0 bytes read:4096 seeks:0 nb_streams:1 [g729 @ 0x3e25da0] All info found [g729 @ 0x3e25da0] After avformat_find_stream_info() pos: 10 bytes read:4096 seeks:0 frames:1 Guessed Channel Layout for Input Stream #0.0 : mono Input #0, g729, from 'pipe:0': Duration: N/A, start: 0.000000, bitrate: 8 kb/s Stream #0:0, 1, 1/8000: Audio: g729, 8000 Hz, mono, s16 Successfully opened the file. Parsing a group of options: output url pipe:1. Applying option ar (set audio sampling rate (in Hz)) with argument 44100. Applying option acodec (force audio codec ('copy' to copy stream)) with argument pcm_s32le. Applying option f (force format) with argument wav. Successfully parsed a group of options. Opening an output file: pipe:1. [pipe @ 0x3e2ad20] Setting default whitelist 'crypto’ Successfully opened the file. Stream mapping: Stream #0:0 -> #0:0 (g729 (native) -> pcm_s32le (native)) cur_dts is invalid (this is harmless if it occurs once at the start per stream) [g729 @ 0x3e27a00] Packet type: G.729 @ 8kbit/s detected 8 logical cores [graph_0_in_0_0 @ 0x3e2dfa0] Setting 'time_base' to value '1/8000’ [graph_0_in_0_0 @ 0x3e2dfa0] Setting 'sample_rate' to value '8000’ [graph_0_in_0_0 @ 0x3e2dfa0] Setting 'sample_fmt' to value 's16’ [graph_0_in_0_0 @ 0x3e2dfa0] Setting 'channel_layout' to value '0x4’ [graph_0_in_0_0 @ 0x3e2dfa0] tb:1/8000 samplefmt:s16 samplerate:8000 chlayout:0x4 [format_out_0_0 @ 0x3e2bca0] Setting 'sample_fmts' to value 's32’ [format_out_0_0 @ 0x3e2bca0] Setting 'sample_rates' to value '44100’ [format_out_0_0 @ 0x3e2bca0] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_0' [AVFilterGraph @ 0x3e2cb40] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed [auto_resampler_0 @ 0x3e40140] [SWR @ 0x3e404e0] Using fltp internally between filters [auto_resampler_0 @ 0x3e40140] ch:1 chl:mono fmt:s16 r:8000Hz -> ch:1 chl:mono fmt:s32 r:44100Hz Output #0, wav, to 'pipe:1': Metadata: ISFT : Lavf57.82.100 Stream #0:0, 0, 1/44100: Audio: pcm_s32le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s32, 1411 kb/s Metadata: encoder : Lavc57.106.101 pcm_s32le [g729 @ 0x3e27a00] Packet type: G.729 @ 8kbit/s [wav @ 0x3e28480] Non-monotonous DTS in output stream 0:0; previous: 0, current: -82; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x3e27a00] Packet type: G.729 @ 8kbit/s [wav @ 0x3e28480] Non-monotonous DTS in output stream 0:0; previous: 0, current: -77; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x3e27a00] Packet type: G.729 @ 8kbit/s [wav @ 0x3e28480] Non-monotonous DTS in output stream 0:0; previous: 0, current: -71; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x3e27a00] Packet type: G.729 @ 8kbit/s [wav @ 0x3e28480] Non-monotonous DTS in output stream 0:0; previous: 0, current: -66; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x3e27a00] Packet type: G.729 @ 8kbit/s [wav @ 0x3e28480] Non-monotonous DTS in output stream 0:0; previous: 0, current: -60; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x3e27a00] Packet type: G.729 @ 8kbit/s [wav @ 0x3e28480] Non-monotonous DTS in output stream 0:0; previous: 0, current: -55; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x3e27a00] Packet type: G.729 @ 8kbit/s [wav @ 0x3e28480] Non-monotonous DTS in output stream 0:0; previous: 0, current: -49; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x3e27a00] Packet type: G.729 @ 8kbit/s [wav @ 0x3e28480] Non-monotonous DTS in output stream 0:0; previous: 0, current: -44; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x3e27a00] Packet type: G.729 @ 8kbit/s [wav @ 0x3e28480] Non-monotonous DTS in output stream 0:0; previous: 0, current: -38; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x3e27a00] Packet type: G.729 @ 8kbit/s [wav @ 0x3e28480] Non-monotonous DTS in output stream 0:0; previous: 0, current: -33; changing to 0. This may result in incorrect timestamps in the output file.
On Sep 28, 2017, at 9:44 AM, Dave Horton <daveh@beachdognet.com> wrote:
Adding a bit more information to this one…..
Any thoughts on this? Minimally, could someone tell me if my command to transcode raw G729 into pcm wav looks correct, or is it missing any options that could account for the warnings/errors observed?
2017-09-28 15:34 GMT+02:00 Dave Horton <daveh@beachdognet.com>:
I am trying to decode a raw g729 input stream to wav format like so:
ffmpeg -loglevel debug -threads 1 -y -acodec g729 -f g729 -i pipe:0 -ar 44100 -acodec pcm_s32le -f wav pipe:1
Does it work if you use file input? Carl Eugen
On Sep 28, 2017, at 5:52 PM, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
Does it work if you use file input?
Carl Eugen
Hmm, well in my latest testing I am getting a good wave file generated — both when I test using streams or files. So perhaps my only concern is the warnings about "Non-monotonous DTS in output stream..” What is this trying to tell me? Is this something I can safely ignore, or should I look into addressing it somehow? Here is the output when I run from files... ffmpeg -loglevel debug -y -acodec g729 -f g729 -i caller.raw -ar 44100 -acodec pcm_s32le -f wav caller.wav version N-87326-g3ffd3b7 Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 7.3.0 (clang-703.0.29) configuration: --enable-gpl --enable-nonfree --enable-libopus --enable-libspeex --enable-libvpx --enable-libmp3lame --disable-optimizations --disable-stripping --extra-cflags='-DDEBUG -O0 -g' libavutil 55. 75.100 / 55. 75.100 libavcodec 57.106.101 / 57.106.101 libavformat 57. 82.100 / 57. 82.100 libavdevice 57. 8.101 / 57. 8.101 libavfilter 6.105.100 / 6.105.100 libswscale 4. 7.103 / 4. 7.103 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 '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'g729'. Reading option '-f' ... matched as option 'f' (force format) with argument 'g729'. Reading option '-i' ... matched as input url with argument 'caller.raw'. Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '44100'. Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'pcm_s32le'. Reading option '-f' ... matched as option 'f' (force format) with argument 'wav'. Reading option 'caller.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 caller.raw. Applying option acodec (force audio codec ('copy' to copy stream)) with argument g729. Applying option f (force format) with argument g729. Successfully parsed a group of options. Opening an input file: caller.raw. [g729 @ 0x7fd079010600] Opening 'caller.raw' for reading [file @ 0x7fd078c15720] Setting default whitelist 'file,crypto' [g729 @ 0x7fd079010600] Before avformat_find_stream_info() pos: 0 bytes read:20480 seeks:0 nb_streams:1 [g729 @ 0x7fd079010600] All info found [g729 @ 0x7fd079010600] Estimating duration from bitrate, this may be inaccurate [g729 @ 0x7fd079010600] After avformat_find_stream_info() pos: 10 bytes read:20480 seeks:0 frames:1 Guessed Channel Layout for Input Stream #0.0 : mono Input #0, g729, from 'caller.raw': Duration: 00:00:20.48, start: 0.000000, bitrate: 8 kb/s Stream #0:0, 1, 1/8000: Audio: g729, 8000 Hz, mono, s16 Successfully opened the file. Parsing a group of options: output url caller.wav. Applying option ar (set audio sampling rate (in Hz)) with argument 44100. Applying option acodec (force audio codec ('copy' to copy stream)) with argument pcm_s32le. Applying option f (force format) with argument wav. Successfully parsed a group of options. Opening an output file: caller.wav. [file @ 0x7fd078c17300] Setting default whitelist 'file,crypto' Successfully opened the file. Stream mapping: Stream #0:0 -> #0:0 (g729 (native) -> pcm_s32le (native)) Press [q] to stop, [?] for help cur_dts is invalid (this is harmless if it occurs once at the start per stream) [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s detected 8 logical cores [graph_0_in_0_0 @ 0x7fd078e002a0] Setting 'time_base' to value '1/8000' [graph_0_in_0_0 @ 0x7fd078e002a0] Setting 'sample_rate' to value '8000' [graph_0_in_0_0 @ 0x7fd078e002a0] Setting 'sample_fmt' to value 's16' [graph_0_in_0_0 @ 0x7fd078e002a0] Setting 'channel_layout' to value '0x4' [graph_0_in_0_0 @ 0x7fd078e002a0] tb:1/8000 samplefmt:s16 samplerate:8000 chlayout:0x4 [format_out_0_0 @ 0x7fd078e00840] Setting 'sample_fmts' to value 's32' [format_out_0_0 @ 0x7fd078e00840] Setting 'sample_rates' to value '44100' [format_out_0_0 @ 0x7fd078e00840] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_0' [AVFilterGraph @ 0x7fd078c186a0] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed [auto_resampler_0 @ 0x7fd078e011c0] [SWR @ 0x7fd079800600] Using fltp internally between filters [auto_resampler_0 @ 0x7fd078e011c0] ch:1 chl:mono fmt:s16 r:8000Hz -> ch:1 chl:mono fmt:s32 r:44100Hz Output #0, wav, to 'caller.wav': Metadata: ISFT : Lavf57.82.100 Stream #0:0, 0, 1/44100: Audio: pcm_s32le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s32, 1411 kb/s Metadata: encoder : Lavc57.106.101 pcm_s32le [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s [wav @ 0x7fd079008600] Non-monotonous DTS in output stream 0:0; previous: 0, current: -82; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s [wav @ 0x7fd079008600] Non-monotonous DTS in output stream 0:0; previous: 0, current: -77; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s [wav @ 0x7fd079008600] Non-monotonous DTS in output stream 0:0; previous: 0, current: -71; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s [wav @ 0x7fd079008600] Non-monotonous DTS in output stream 0:0; previous: 0, current: -66; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s [wav @ 0x7fd079008600] Non-monotonous DTS in output stream 0:0; previous: 0, current: -60; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s [wav @ 0x7fd079008600] Non-monotonous DTS in output stream 0:0; previous: 0, current: -55; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s [wav @ 0x7fd079008600] Non-monotonous DTS in output stream 0:0; previous: 0, current: -49; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s [wav @ 0x7fd079008600] Non-monotonous DTS in output stream 0:0; previous: 0, current: -44; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s [wav @ 0x7fd079008600] Non-monotonous DTS in output stream 0:0; previous: 0, current: -38; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s [wav @ 0x7fd079008600] Non-monotonous DTS in output stream 0:0; previous: 0, current: -33; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s [wav @ 0x7fd079008600] Non-monotonous DTS in output stream 0:0; previous: 0, current: -27; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s [wav @ 0x7fd079008600] Non-monotonous DTS in output stream 0:0; previous: 0, current: -22; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s [wav @ 0x7fd079008600] Non-monotonous DTS in output stream 0:0; previous: 0, current: -16; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s [wav @ 0x7fd079008600] Non-monotonous DTS in output stream 0:0; previous: 0, current: -11; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s [wav @ 0x7fd079008600] Non-monotonous DTS in output stream 0:0; previous: 0, current: -5; changing to 0. This may result in incorrect timestamps in the output file. [g729 @ 0x7fd079019800] Packet type: G.729 @ 8kbit/s Last message repeated 2031 times [out_0_0 @ 0x7fd078e004e0] EOF on sink link out_0_0:default. No more output streams to write to, finishing. size= 3528kB time=00:00:00.26 bitrate=108706.8kbits/s speed=0.653x video:0kB audio:3528kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.002823% Input file #0 (caller.raw): Input stream #0:0 (audio): 2048 packets read (20480 bytes); 2048 frames decoded (163840 samples); Total: 2048 packets (20480 bytes) demuxed Output file #0 (caller.wav): Output stream #0:0 (audio): 2049 frames encoded (903168 samples); 2049 packets muxed (3612672 bytes); Total: 2049 packets (3612672 bytes) muxed 2048 frames successfully decoded, 0 decoding errors [AVIOContext @ 0x7fd078c17440] Statistics: 4 seeks, 17 writeouts [AVIOContext @ 0x7fd078c15860] Statistics: 20480 bytes read, 0 seeks
2017-09-29 15:55 GMT+02:00 Dave Horton <daveh@beachdognet.com>:
On Sep 28, 2017, at 5:52 PM, Carl Eugen Hoyos wrote:
Does it work if you use file input?
Hmm, well in my latest testing I am getting a good wave file generated — both when I test using streams or files.
I wonder if arbitrarily cut files (with missing bytes at the start) are accepted by the decoder but couldn't test because I only found the G.729 bit samples (that contain headers). You could test with something like: $ dd if=caller.raw of=test.raw bs=1 skip=1 And increasing skip value.
So perhaps my only concern is the warnings about "Non-monotonous DTS in output stream..”
I cannot reproduce them with the bit files... Perhaps you could provide an audible sample?
What is this trying to tell me? Is this something I can safely ignore, or should I look into addressing it somehow?
These messages shouldn't matter if your output is s16le wav. Carl Eugen
Perhaps you could provide an audible sample?
Here is a link to the short raw G729 file I am transcoding: https://drive.google.com/file/d/0B84eq1_CwaQ3V3JPR2Y4emZRbnM/view?usp=sharin...
2017-09-29 19:30 GMT+02:00 Dave Horton <daveh@beachdognet.com>:
Perhaps you could provide an audible sample?
Here is a link to the short raw G729 file I am transcoding:
No warnings here. I can confirm though that such files cannot be read if they were cut at non-frame limits, so you have to make sure the pipes never eat something. Carl Eugen $ ffmpeg -f g729 -i callee.raw out.wav ffmpeg version N-87618-g6f7bd8c Copyright (c) 2000-2017 the FFmpeg developers built with gcc 6.3.0 (GCC) configuration: --enable-gpl libavutil 55. 77.101 / 55. 77.101 libavcodec 57.106.104 / 57.106.104 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 9.101 / 57. 9.101 libavfilter 6.106.100 / 6.106.100 libswscale 4. 7.103 / 4. 7.103 libswresample 2. 8.100 / 2. 8.100 libpostproc 54. 6.100 / 54. 6.100 [g729 @ 0x2c443e0] Estimating duration from bitrate, this may be inaccurate Guessed Channel Layout for Input Stream #0.0 : mono Input #0, g729, from 'callee.raw': Duration: 00:00:20.48, start: 0.000000, bitrate: 8 kb/s Stream #0:0: Audio: g729, 8000 Hz, mono, s16 Stream mapping: Stream #0:0 -> #0:0 (g729 (native) -> pcm_s16le (native)) Press [q] to stop, [?] for help Output #0, wav, to 'out.wav': Metadata: ISFT : Lavf57.83.100 Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 8000 Hz, mono, s16, 128 kb/s Metadata: encoder : Lavc57.106.104 pcm_s16le size= 320kB time=00:00:00.26 bitrate=9862.0kbits/s speed=3.63x video:0kB audio:320kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.023804%
No warnings here.
Interesting, I can replicate your results, but when I add some options for sample rate and encoding to the output, that is when I see errors: MacBook-Pro-6:g729-testing dhorton$ ffmpeg -y -f g729 -i caller.raw -ar 44100 -acodec pcm_s32le -f wav caller.wav ffmpeg version N-87326-g3ffd3b7 Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 7.3.0 (clang-703.0.29) configuration: --enable-gpl --enable-nonfree --enable-libopus --enable-libspeex --enable-libvpx --enable-libmp3lame --disable-optimizations --disable-stripping --extra-cflags='-DDEBUG -O0 -g' libavutil 55. 75.100 / 55. 75.100 libavcodec 57.106.101 / 57.106.101 libavformat 57. 82.100 / 57. 82.100 libavdevice 57. 8.101 / 57. 8.101 libavfilter 6.105.100 / 6.105.100 libswscale 4. 7.103 / 4. 7.103 libswresample 2. 8.100 / 2. 8.100 libpostproc 54. 6.100 / 54. 6.100 [g729 @ 0x7fc3d4000000] Estimating duration from bitrate, this may be inaccurate Guessed Channel Layout for Input Stream #0.0 : mono Input #0, g729, from 'caller.raw': Duration: 00:00:20.48, start: 0.000000, bitrate: 8 kb/s Stream #0:0: Audio: g729, 8000 Hz, mono, s16 Stream mapping: Stream #0:0 -> #0:0 (g729 (native) -> pcm_s32le (native)) Press [q] to stop, [?] for help Output #0, wav, to 'caller.wav': Metadata: ISFT : Lavf57.82.100 Stream #0:0: Audio: pcm_s32le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s32, 1411 kb/s Metadata: encoder : Lavc57.106.101 pcm_s32le [wav @ 0x7fc3d4009e00] Non-monotonous DTS in output stream 0:0; previous: 0, current: -82; changing to 0. This may result in incorrect timestamps in the output file. [wav @ 0x7fc3d4009e00] Non-monotonous DTS in output stream 0:0; previous: 0, current: -77; changing to 0. This may result in incorrect timestamps in the output file. [wav @ 0x7fc3d4009e00] Non-monotonous DTS in output stream 0:0; previous: 0, current: -71; changing to 0. This may result in incorrect timestamps in the output file. [wav @ 0x7fc3d4009e00] Non-monotonous DTS in output stream 0:0; previous: 0, current: -66; changing to 0. This may result in incorrect timestamps in the output file. [wav @ 0x7fc3d4009e00] Non-monotonous DTS in output stream 0:0; previous: 0, current: -60; changing to 0. This may result in incorrect timestamps in the output file. [wav @ 0x7fc3d4009e00] Non-monotonous DTS in output stream 0:0; previous: 0, current: -55; changing to 0. This may result in incorrect timestamps in the output file. [wav @ 0x7fc3d4009e00] Non-monotonous DTS in output stream 0:0; previous: 0, current: -49; changing to 0. This may result in incorrect timestamps in the output file. [wav @ 0x7fc3d4009e00] Non-monotonous DTS in output stream 0:0; previous: 0, current: -44; changing to 0. This may result in incorrect timestamps in the output file. [wav @ 0x7fc3d4009e00] Non-monotonous DTS in output stream 0:0; previous: 0, current: -38; changing to 0. This may result in incorrect timestamps in the output file. [wav @ 0x7fc3d4009e00] Non-monotonous DTS in output stream 0:0; previous: 0, current: -33; changing to 0. This may result in incorrect timestamps in the output file. [wav @ 0x7fc3d4009e00] Non-monotonous DTS in output stream 0:0; previous: 0, current: -27; changing to 0. This may result in incorrect timestamps in the output file. [wav @ 0x7fc3d4009e00] Non-monotonous DTS in output stream 0:0; previous: 0, current: -22; changing to 0. This may result in incorrect timestamps in the output file. [wav @ 0x7fc3d4009e00] Non-monotonous DTS in output stream 0:0; previous: 0, current: -16; changing to 0. This may result in incorrect timestamps in the output file. [wav @ 0x7fc3d4009e00] Non-monotonous DTS in output stream 0:0; previous: 0, current: -11; changing to 0. This may result in incorrect timestamps in the output file. [wav @ 0x7fc3d4009e00] Non-monotonous DTS in output stream 0:0; previous: 0, current: -5; changing to 0. This may result in incorrect timestamps in the output file. size= 3528kB time=00:00:00.26 bitrate=108706.8kbits/s speed=2.28x video:0kB audio:3528kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.002823% ** without output options, no errors MacBook-Pro-6:g729-testing dhorton$ ffmpeg -y -f g729 -i caller.raw -f wav caller.wav ffmpeg version N-87326-g3ffd3b7 Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 7.3.0 (clang-703.0.29) configuration: --enable-gpl --enable-nonfree --enable-libopus --enable-libspeex --enable-libvpx --enable-libmp3lame --disable-optimizations --disable-stripping --extra-cflags='-DDEBUG -O0 -g' libavutil 55. 75.100 / 55. 75.100 libavcodec 57.106.101 / 57.106.101 libavformat 57. 82.100 / 57. 82.100 libavdevice 57. 8.101 / 57. 8.101 libavfilter 6.105.100 / 6.105.100 libswscale 4. 7.103 / 4. 7.103 libswresample 2. 8.100 / 2. 8.100 libpostproc 54. 6.100 / 54. 6.100 [g729 @ 0x7ff249810600] Estimating duration from bitrate, this may be inaccurate Guessed Channel Layout for Input Stream #0.0 : mono Input #0, g729, from 'caller.raw': Duration: 00:00:20.48, start: 0.000000, bitrate: 8 kb/s Stream #0:0: Audio: g729, 8000 Hz, mono, s16 Stream mapping: Stream #0:0 -> #0:0 (g729 (native) -> pcm_s16le (native)) Press [q] to stop, [?] for help Output #0, wav, to 'caller.wav': Metadata: ISFT : Lavf57.82.100 Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 8000 Hz, mono, s16, 128 kb/s Metadata: encoder : Lavc57.106.101 pcm_s16le size= 320kB time=00:00:00.26 bitrate=9862.0kbits/s speed=2.61x video:0kB audio:320kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.023804%
2017-09-30 16:08 GMT+02:00 Dave Horton <daveh@beachdognet.com>:
No warnings here.
Interesting, I can replicate your results, but when I add some options for sample rate and encoding to the output, that is when I see errors:
The issue is - as can also be seen in the warning-less outputs - that duration is incorrect for the encodings, I opened ticket #6704. Thank you, Carl Eugen
Where you able to solve it now. I am also stuck in the same place that you have stated above . I have an Audio file in G729 format with Caller on One channel and callee on the other. Was wondering how to convert it into separate PCM encoded audio files. -- Sent from: http://www.ffmpeg-archive.org/
2018-08-20 16:32 GMT+02:00, ananth123 <86ananth@gmail.com>:
Where you able to solve it now. I am also stuck in the same place that you have stated above . I have an Audio file in G729 format with Caller on One channel and callee on the other. Was wondering how to convert it into separate PCM encoded audio files.
The only issue the OP had with current FFmpeg git head were warning messages on resampling (and wrong assumed duration), the output files were fine: What exactly is your issue? Please provide the command line you tested including the complete, uncut console output. Carl Eugen
302001014794094.wav <http://www.ffmpeg-archive.org/file/t378828/302001014794094.wav> File is attached here. Ananths-MacBook-Pro:speechtotext ananth$ ffmpeg -i 302001014794094.wav ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 8.1.0 (clang-802.0.42) configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libass --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --enable-openssl --disable-lzma --enable-nonfree --enable-vda libavutil 55. 58.100 / 55. 58.100 libavcodec 57. 89.100 / 57. 89.100 libavformat 57. 71.100 / 57. 71.100 libavdevice 57. 6.100 / 57. 6.100 libavfilter 6. 82.100 / 6. 82.100 libavresample 3. 5. 0 / 3. 5. 0 libswscale 4. 6.100 / 4. 6.100 libswresample 2. 7.100 / 2. 7.100 libpostproc 54. 5.100 / 54. 5.100 [wav @ 0x7f8010004800] ignoring wrong sample_count 1165360 [g729 @ 0x7f8010809200] Only mono sound is supported (requested channels: 2). [wav @ 0x7f8010004800] Failed to open codec in avformat_find_stream_info [g729 @ 0x7f8010809200] Only mono sound is supported (requested channels: 2). [wav @ 0x7f8010004800] Estimating duration from bitrate, this may be inaccurate Guessed Channel Layout for Input Stream #0.0 : stereo Input #0, wav, from '302001014794094.wav': Duration: 00:02:25.67, bitrate: 16 kb/s Stream #0:0: Audio: g729 ([131][0][0][0] / 0x0083), 8000 Hz, stereo, 16 kb/s At least one output file must be specified When i run Ananths-MacBook-Pro:speechtotext ananth$ ffmpeg -loglevel debug -y -acodec g729 -f g729 -i 302001014794094.wav -ar 8000 -acodec pcm_s16le -f wav output.wav ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 8.1.0 (clang-802.0.42) configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libass --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --enable-openssl --disable-lzma --enable-nonfree --enable-vda libavutil 55. 58.100 / 55. 58.100 libavcodec 57. 89.100 / 57. 89.100 libavformat 57. 71.100 / 57. 71.100 libavdevice 57. 6.100 / 57. 6.100 libavfilter 6. 82.100 / 6. 82.100 libavresample 3. 5. 0 / 3. 5. 0 libswscale 4. 6.100 / 4. 6.100 libswresample 2. 7.100 / 2. 7.100 libpostproc 54. 5.100 / 54. 5.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 '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'g729'. Reading option '-f' ... matched as option 'f' (force format) with argument 'g729'. Reading option '-i' ... matched as input url with argument '302001014794094.wav'. Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '8000'. Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'pcm_s16le'. Reading option '-f' ... matched as option 'f' (force format) with argument 'wav'. Reading option 'output.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 302001014794094.wav. Applying option acodec (force audio codec ('copy' to copy stream)) with argument g729. Applying option f (force format) with argument g729. Successfully parsed a group of options. Opening an input file: 302001014794094.wav. [g729 @ 0x7fbe8d803400] Opening '302001014794094.wav' for reading [file @ 0x7fbe8d50f060] Setting default whitelist 'file,crypto' [g729 @ 0x7fbe8d803400] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0 nb_streams:1 [g729 @ 0x7fbe8d803400] All info found [g729 @ 0x7fbe8d803400] Estimating duration from bitrate, this may be inaccurate [g729 @ 0x7fbe8d803400] After avformat_find_stream_info() pos: 10 bytes read:32768 seeks:0 frames:1 Guessed Channel Layout for Input Stream #0.0 : mono Input #0, g729, from '302001014794094.wav': Duration: 00:04:51.45, start: 0.000000, bitrate: 8 kb/s Stream #0:0, 1, 1/8000: Audio: g729, 8000 Hz, mono, s16 Successfully opened the file. Parsing a group of options: output url output.wav. Applying option ar (set audio sampling rate (in Hz)) with argument 8000. Applying option acodec (force audio codec ('copy' to copy stream)) with argument pcm_s16le. Applying option f (force format) with argument wav. Successfully parsed a group of options. Opening an output file: output.wav. [file @ 0x7fbe8d510b60] Setting default whitelist 'file,crypto' Successfully opened the file. Stream mapping: Stream #0:0 -> #0:0 (g729 (native) -> pcm_s16le (native)) Press [q] to stop, [?] for help cur_dts is invalid (this is harmless if it occurs once at the start per stream) [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s detected 4 logical cores [graph_0_in_0_0 @ 0x7fbe8d5111e0] Setting 'time_base' to value '1/8000' [graph_0_in_0_0 @ 0x7fbe8d5111e0] Setting 'sample_rate' to value '8000' [graph_0_in_0_0 @ 0x7fbe8d5111e0] Setting 'sample_fmt' to value 's16' [graph_0_in_0_0 @ 0x7fbe8d5111e0] Setting 'channel_layout' to value '0x4' [graph_0_in_0_0 @ 0x7fbe8d5111e0] tb:1/8000 samplefmt:s16 samplerate:8000 chlayout:0x4 [format_out_0_0 @ 0x7fbe8d511760] Setting 'sample_fmts' to value 's16' [format_out_0_0 @ 0x7fbe8d511760] Setting 'sample_rates' to value '8000' [AVFilterGraph @ 0x7fbe8d511000] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed Output #0, wav, to 'output.wav': Metadata: ISFT : Lavf57.71.100 Stream #0:0, 0, 1/8000: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 8000 Hz, mono, s16, 128 kb/s Metadata: encoder : Lavc57.89.100 pcm_s16le [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s Last message repeated 5214 times [g729 @ 0x7fbe8d814c00] pitch_delay_int 144 is too large [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s Last message repeated 38 times [g729 @ 0x7fbe8d814c00] pitch_delay_int 144 is too large [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s Last message repeated 1 times [g729 @ 0x7fbe8d814c00] pitch_delay_int 144 is too large [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s Last message repeated 1410 times [g729 @ 0x7fbe8d814c00] pitch_delay_int 144 is too large [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s Last message repeated 700 times [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/ss/s speed=1.86x Last message repeated 5402 times [g729 @ 0x7fbe8d814c00] pitch_delay_int 144 is too large [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s Last message repeated 1404 times [g729 @ 0x7fbe8d814c00] pitch_delay_int 144 is too large [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s Last message repeated 687 times [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/ss/s speed=1.87x Last message repeated 2916 times [g729 @ 0x7fbe8d814c00] pitch_delay_int 144 is too large [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s Last message repeated 306 times [g729 @ 0x7fbe8d814c00] pitch_delay_int 144 is too large [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s Last message repeated 3475 times [g729 @ 0x7fbe8d814c00] pitch_delay_int 144 is too large [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s Last message repeated 904 times [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/ss/s speed=1.88x Last message repeated 2321 times [g729 @ 0x7fbe8d814c00] pitch_delay_int 144 is too large [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s Last message repeated 1014 times [g729 @ 0x7fbe8d814c00] pitch_delay_int 144 is too large [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s Last message repeated 679 times [g729 @ 0x7fbe8d814c00] pitch_delay_int 144 is too large [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s Last message repeated 808 times [g729 @ 0x7fbe8d814c00] pitch_delay_int 144 is too large [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s Last message repeated 14 times [g729 @ 0x7fbe8d814c00] pitch_delay_int 144 is too large [g729 @ 0x7fbe8d814c00] Packet type: G.729 @ 8kbit/s Last message repeated 1833 times [g729 @ 0x7fbe8d814c00] Packet size 4 is unknown. Error while decoding stream #0:0: Invalid data found when processing input [out_0_0 @ 0x7fbe8d5113e0] EOF on sink link out_0_0:default. No more output streams to write to, finishing. size= 4554kB time=00:00:03.65 bitrate=10212.5kbits/s speed=1.85x video:0kB audio:4554kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.001673% Input file #0 (302001014794094.wav): Input stream #0:0 (audio): 29146 packets read (291454 bytes); 29145 frames decoded (2331600 samples); Total: 29146 packets (291454 bytes) demuxed Output file #0 (output.wav): Output stream #0:0 (audio): 29145 frames encoded (2331600 samples); 29145 packets muxed (4663200 bytes); Total: 29145 packets (4663200 bytes) muxed 29145 frames successfully decoded, 1 decoding errors [AVIOContext @ 0x7fbe8d400260] Statistics: 4 seeks, 29148 writeouts [AVIOContext @ 0x7fbe8d50f1c0] Statistics: 291454 bytes read, 0 seeks I get an audio file double in time of the original with some junk output. I guess I am doing something wrong but unable to figure out the mistake -- Sent from: http://www.ffmpeg-archive.org/
2018-08-20 19:20 GMT+02:00, ananth123 <86ananth@gmail.com>:
302001014794094.wav <http://www.ffmpeg-archive.org/file/t378828/302001014794094.wav>
Thank you for the sample, I attached it to ticket #4553. As the console output tried to tell you, G.729 stereo is not supported, patch welcome! Carl Eugen
participants (3)
-
ananth123 -
Carl Eugen Hoyos -
Dave Horton