[FFmpeg-devel] [bug/patch] MPEG-TS muxer: PCR not in sync withPTS/DTS

Alexandre FERRIEUX - FT/RD/SIRP/ASF/SOFTL alexandre.ferrieux
Mon Oct 19 09:50:14 CEST 2009


Niobos wrote:
> On 16 Oct 2009, at 15:37, Alexandre Ferrieux wrote:
> 
>> Now I observed a regression wrt your previous patches: when muxing an
>> audio-only TS, the PCR is wrong by a large factor (between 4 and 6 times
>> too slow). When muxing video only or both, it is correct.
 >
> Can you provide me with:
> * The command line you used

  ffmpeg.r20212vbr -i file.wav -vn -ar 44100 file.ts

> * The characteristics of the input file (especially number of channels, 
> since there is a filed bug about this)

I've done this with both mono and stereo wav files, same result.
Below are the details with one of each kind. On these small files the PCR bug is even stronger (a ratio nearing 9).

FFmpeg versions: 20212vbr is your latest patch; 19754vbr is your previous one.

-Alex


(1) =========================== Stereo

==> ffmpeg.r20212vbr -i ab.wav

Input #0, wav, from 'ab.wav':
   Duration: 00:00:04.86, bitrate: 128 kb/s
     Stream #0.0: Audio: pcm_alaw, 8000 Hz, 2 channels, s16, 128 kb/s

==> ffmpeg.r20212vbr -i ab.wav -vn -ar 44100 -y ab.20212.ts

FFmpeg version SVN-r20212, Copyright (c) 2000-2009 Fabrice Bellard, et al.
   built on Oct 12 2009 18:28:32 with gcc 3.4.6 20060404 (Red Hat 3.4.6-10)
   configuration: --enable-libx264 --enable-gpl --disable-demuxer=v4l --disable-demuxer=v4l2 --disable-indev=v4l 
--disable-indev=v4l2
   libavutil     50. 3. 0 / 50. 3. 0
   libavcodec    52.37. 0 / 52.37. 0
   libavformat   52.39. 0 / 52.39. 0
   libavdevice   52. 2. 0 / 52. 2. 0
   libswscale     0. 7. 1 /  0. 7. 1
[wav @ 0x8dd2420]max_analyze_duration reached
Input #0, wav, from 'ab.wav':
   Duration: 00:00:04.86, bitrate: 128 kb/s
     Stream #0.0: Audio: pcm_alaw, 8000 Hz, 2 channels, s16, 128 kb/s
[mpegts @ 0x8ddba80]calculated bitrate 104114bps, muxrate 1041140bps, sdt every 34, pat/pmt every 6 pkts
Output #0, mpegts, to 'ab.20212.ts':
     Stream #0.0: Audio: mp2, 44100 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
   Stream #0.0 -> #0.0
Press [q] to stop encoding
size=      57kB time=4.88 bitrate=  95.4kbits/s
video:0kB audio:38kB global headers:0kB muxing overhead 49.133806%


==> ffmpeg.r19754vbr -i ab.wav -vn -ar 44100 -y ab.19754.ts

FFmpeg version SVN-r19754, Copyright (c) 2000-2009 Fabrice Bellard, et al.
   configuration: --disable-demuxer=v4l --disable-demuxer=v4l2 --disable-indev=v4l --disable-indev=v4l2
   libavutil     50. 3. 0 / 50. 3. 0
   libavcodec    52.35. 0 / 52.35. 0
   libavformat   52.38. 0 / 52.38. 0
   libavdevice   52. 2. 0 / 52. 2. 0
   libswscale     0. 7. 1 /  0. 7. 1
   built on Sep  3 2009 16:01:15, gcc: 3.4.6 20060404 (Red Hat 3.4.6-10)
Input #0, wav, from 'ab.wav':
   Duration: 00:00:04.86, bitrate: 128 kb/s
     Stream #0.0: Audio: pcm_alaw, 8000 Hz, 2 channels, s16, 128 kb/s
[mpegts @ 0x9940aa0]calculated bitrate 104044bps, muxrate 1040440bps, sdt every 345, pat/pmt every 69 pkts
Output #0, mpegts, to 'ab.19754.ts':
     Stream #0.0: Audio: mp2, 44100 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
   Stream #0.0 -> #0.0
Press [q] to stop encoding
size=      58kB time=4.88 bitrate=  97.0kbits/s
video:0kB audio:38kB global headers:0kB muxing overhead 51.539190%

==> PCR analysis:

    ab.20212.ts: delta PCR == 19890
    ab.19754.ts: delta PCR == 182975


(2) ============================= Mono


==> ffmpeg.r20212vbr -i a.wav

Input #0, wav, from 'a.wav':
   Duration: 00:00:06.12, bitrate: 64 kb/s
     Stream #0.0: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s

==> ffmpeg.r20212vbr -i a.wav -vn -ar 44100 -y a.20212.ts
FFmpeg version SVN-r20212, Copyright (c) 2000-2009 Fabrice Bellard, et al.
   built on Oct 12 2009 18:28:32 with gcc 3.4.6 20060404 (Red Hat 3.4.6-10)
   configuration: --enable-libx264 --enable-gpl --disable-demuxer=v4l --disable-demuxer=v4l2 --disable-indev=v4l 
--disable-indev=v4l2
   libavutil     50. 3. 0 / 50. 3. 0
   libavcodec    52.37. 0 / 52.37. 0
   libavformat   52.39. 0 / 52.39. 0
   libavdevice   52. 2. 0 / 52. 2. 0
   libswscale     0. 7. 1 /  0. 7. 1
[wav @ 0xa8b0420]max_analyze_duration reached
Input #0, wav, from 'a.wav':
   Duration: 00:00:06.12, bitrate: 64 kb/s
     Stream #0.0: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
[mpegts @ 0xa8b9a80]calculated bitrate 104114bps, muxrate 1041140bps, sdt every 34, pat/pmt every 6 pkts
Output #0, mpegts, to 'a.20212.ts':
     Stream #0.0: Audio: mp2, 44100 Hz, 1 channels, s16, 64 kb/s
Stream mapping:
   Stream #0.0 -> #0.0
Press [q] to stop encoding
size=      72kB time=6.14 bitrate=  95.5kbits/s
video:0kB audio:48kB global headers:0kB muxing overhead 49.297495%

==> ffmpeg.r19754vbr -i a.wav -vn -ar 44100 -y a.19754.ts
FFmpeg version SVN-r19754, Copyright (c) 2000-2009 Fabrice Bellard, et al.
   configuration: --disable-demuxer=v4l --disable-demuxer=v4l2 --disable-indev=v4l --disable-indev=v4l2
   libavutil     50. 3. 0 / 50. 3. 0
   libavcodec    52.35. 0 / 52.35. 0
   libavformat   52.38. 0 / 52.38. 0
   libavdevice   52. 2. 0 / 52. 2. 0
   libswscale     0. 7. 1 /  0. 7. 1
   built on Sep  3 2009 16:01:15, gcc: 3.4.6 20060404 (Red Hat 3.4.6-10)
Input #0, wav, from 'a.wav':
   Duration: 00:00:06.12, bitrate: 64 kb/s
     Stream #0.0: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
[mpegts @ 0xa934aa0]calculated bitrate 104044bps, muxrate 1040440bps, sdt every 345, pat/pmt every 69 pkts
Output #0, mpegts, to 'a.19754.ts':
     Stream #0.0: Audio: mp2, 44100 Hz, 1 channels, s16, 64 kb/s
Stream mapping:
   Stream #0.0 -> #0.0
Press [q] to stop encoding
size=      73kB time=6.14 bitrate=  97.5kbits/s
video:0kB audio:48kB global headers:0kB muxing overhead 52.360008%

==> PCR analysis:

    a.20212.ts: delta PCR == 25090
    a.19754.ts: delta PCR == 233610





More information about the ffmpeg-devel mailing list