[FFmpeg-user] Timecode problem when capturing capturing live multicast/udp mpegvideo stream

iliana.in.france at free.fr iliana.in.france at free.fr
Mon Nov 28 14:24:20 CET 2011


Hello,

I have a problem when capturing a live multicast udp mpeg2 stream using ffmpeg
which concerns timestamps and I hope some of this forum of experts will be able
to help me.

The simple command:
ffmpeg.exe -y  -i udp://225.1.1.53:1111 -vcodec copy -acodec copy output.mpg

Gives the error (see details at the bottom of the message):
[mpeg @ 01cb9760] Application provided invalid, non monotonically increasing dts
to muxer in stream 1: 9049 >= 9049
av_interleaved_write_frame(): Invalid argument

the number varies, but it is always XXX >= XXX, and the capture aborts. I manage
to somewhat solving the problem by adding the option:
-dts_delta_threshold 0
But in this case, the audio and video recordings go out of sync in the recorded
file by approximately 1 or 2 seconds every hour (99.95% stretching of the audio)

I have also tried to add the option –copyts (this proved to be effective in
fixing video/audio synchronization issues in file-to-file re-encoding) but in
this case (live mpeg-ts multicast) I get the same error
[mpeg @ 021e7ac0] Application provided invalid, non monotonically increasing dts
to muxer in stream 1: 1130 >= 1130
av_interleaved_write_frame(): Invalid argument

Can someone enlight me on how I can record this multicast live transmission with
audio and video in sync ? (Worth mentioning that when watching the live video
with VLC, audio and video are always in sync even after several hours of
watching.

Many thanks in advance to anyone who could give me even a simple hint.

Ileana.

Here is the exact output:
> ffmpeg.exe -y  -i udp://225.1.1.53:1111 -vcodec copy -acodec copy output.mpg

ffmpeg version N-32754-g936d4d4-Sherpya, Copyright (c) 2000-2011 the FFmpeg deve
lopers
  built on Sep 21 2011 13:48:46 with gcc 4.2.5 20090330 (prerelease) [Sherpya]
  libavutil    51. 16. 1 / 51. 16. 1
  libavcodec   53. 16. 0 / 53. 16. 0
  libavformat  53. 12. 0 / 53. 12. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 43. 2 /  2. 43. 2
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[mpegts @ 01cb7c40] parser not found for codec dvb_teletext, packets or times ma
y be invalid.
[mpeg2video @ 01cb2320] mpeg_decode_postinit() failure
    Last message repeated 10 times
[mpegts @ 01cb7c40] max_analyze_duration 5000000 reached at 5016000
[mpegts @ 01cb7c40] Estimating duration from bitrate, this may be inaccurate
Input #0, mpegts, from 'udp://225.1.1.53:1111':
  Duration: N/A, start: 16541.257933, bitrate: 15192 kb/s
  Program 2001
    Metadata:
      service_name    : Direct 8
      service_provider: TCOAX
    Stream #0.0[0x42]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p
, 720x576 [SAR 64:45 DAR 16:9], 15000 kb/s, 26.96 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x44](fra): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo
, s16, 192 kb/s
    Stream #0.2[0x45](fra): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
Output #0, mpeg, to 'D:\data\MyMovies\TvRecordings\Recordings\2011-11-28 TEST.mp
g':
  Metadata:
    encoder         : Lavf53.12.0
    Stream #0.0: Video: mpeg2video ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SA
R 64:45 DAR 16:9], q=2-31, 15000 kb/s, 90k tbn, 25 tbc
    Stream #0.1(fra): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, 192
kb/s
Stream mapping:
  Stream #0.0 -> #0.0 (copy)
  Stream #0.1 -> #0.1 (copy)
Press [q] to stop, [?] for help
[mpeg @ 01cb9760] Application provided invalid, non monotonically increasing dts
 to muxer in stream 1: 9049 >= 9049
av_interleaved_write_frame(): Invalid argument


More information about the ffmpeg-user mailing list