[FFmpeg-user] MPEG TS output - muxing queue - max_interleave_delta

Matej matej at tam.si
Wed Jul 16 11:26:53 CEST 2014


Hi,

we are trying to output two inputs (mpeg2video and mp3) to an mpegts output
stream with the following command:
ffmpeg -loglevel debug -max_interleave_delta 15000000 -rtbufsize 128000k
-threads 0 -re -i udp://@:1300 -re -i "http://live.radiohit.si:9560" -codec
copy -s 720x576 -q 10 -shortest -f mpegts udp://
192.168.1.150:1236?pkt_size=1316?buffer_size=65535

Things work perfectly for about an hour (sound is smooth and the video too
fpr the entire period), but after approximate 55 minutes (sometimes little
less, sometimes more) the following messages start to pop-up:

mpegts @ 0x1a363c0] Delay between the first packet and last packet in the
muxing queue is 10004900 > 10000000: forcing output
[mpegts @ 0x1a363c0] Delay between the first packet and last packet in the
muxing queue is 10004889 > 10000000: forcing output
    Last message repeated 3 times
[mpegts @ 0x1a363c0] Delay between the first packet and last packet in the
muxing queue is 10004900 > 10000000: forcing output
    Last message repeated 9 times

----------------------------------------------------------------

The sound starts glitching and eventually it is not present in the stream
any more, but the video plays normally for hours on, but those errors keep
flooding.

I have tried to use -max_interleave_delta optiont as found this option in
source, but it seems even though it's parsed (please see the debug output
below), it still seems that the expected maximum delay is still 10000000.

----------------------------------------------------------------

ffmpeg output:
ffmpeg version git-2014-07-12-66558fe Copyright (c) 2000-2014 the FFmpeg
developers
  built on Jul 12 2014 10:18:42 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --extra-cflags=-I/root/junk/include
--extra-ldflags=-L/root/junk/lib --enable-gpl
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 45.100 / 55. 45.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 10.100 /  4. 10.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging
level) with argument 'debug'.
Reading option '-max_interleave_delta' ... matched as AVOption
'max_interleave_delta' with argument '15000000'.
Reading option '-rtbufsize' ... matched as AVOption 'rtbufsize' with
argument '128000k'.
Reading option '-threads' ... matched as AVOption 'threads' with argument
'0'.
Reading option '-re' ... matched as option 're' (read input at native frame
rate) with argument '1'.
Reading option '-i' ... matched as input file with argument 'udp://@:1300'.
Reading option '-re' ... matched as option 're' (read input at native frame
rate) with argument '1'.
Reading option '-i' ... matched as input file with argument '
http://live.radiohit.si:9560'.
Reading option '-codec' ... matched as option 'codec' (codec name) with
argument 'copy'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or
abbreviation)) with argument '720x576'.
Reading option '-q' ... matched as option 'q' (use fixed quality scale
(VBR)) with argument '10'.
Reading option '-shortest' ... matched as option 'shortest' (finish
encoding within shortest input) with argument '1'.
Reading option '-f' ... matched as option 'f' (force format) with argument
'mpegts'.
Reading option 'udp://192.168.1.150:1236?pkt_size=1316?buffer_size=65535'
... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file udp://@:1300.
Applying option re (read input at native frame rate) with argument 1.
Successfully parsed a group of options.
Opening an input file: udp://@:1300.
[udp @ 0x382b200] end receive buffer size reported is 131072
[mpegts @ 0x3833fc0] Format mpegts probed with size=2048 and score=100
[mpegts @ 0x3833fc0] stream=0 stream_type=2 pid=100 prog_reg_desc=
[mpegts @ 0x3833fc0] Before avformat_find_stream_info() pos: 0 bytes
read:9212 seeks:0
[mpeg2video @ 0x3847e80] Invalid frame dimensions 0x0.
    Last message repeated 9 times
[mpegts @ 0x3833fc0] All programs have pmt, headers found
[mpeg2video @ 0x3847e80] Invalid frame dimensions 0x0.
[mpegts @ 0x3833fc0] All info found
[mpegts @ 0x3833fc0] After avformat_find_stream_info() pos: 230676 bytes
read:230676 seeks:0 frames:21
Input #0, mpegts, from 'udp://@:1300':
  Duration: N/A, start: 86964.932311, bitrate: N/A
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100], 21, 1/90000: Video: mpeg2video (Main) ([2][0][0][0]
/ 0x0002), yuv420p(tv), 720x576 [SAR 1:1 DAR 5:4], 1/48, max. 104857 kb/s,
24 fps, 24 tbr, 90k tbn, 48 tbc
Successfully opened the file.
Parsing a group of options: input file http://live.radiohit.si:9560.
Applying option re (read input at native frame rate) with argument 1.
Successfully parsed a group of options.
Opening an input file: http://live.radiohit.si:9560.
[http @ 0x3864420] request: GET / HTTP/1.1
User-Agent: Lavf/55.45.100
Accept: */*
Range: bytes=0-
Connection: close
Host: live.radiohit.si:9560


[http @ 0x3864420] header='ICY 200 OK'
[http @ 0x3864420] http_code=200
[http @ 0x3864420] header='icy-notice1:<BR>This stream requires <a href="
http://www.winamp.com/">Winamp</a><BR>'
[http @ 0x3864420] header='icy-notice2:SHOUTcast Distributed Network Audio
Server/win32 v1.9.5<BR>'
[http @ 0x3864420] header='icy-name:Radio HIT Shoutcast live stream'
[http @ 0x3864420] header='icy-genre:Pop'
[http @ 0x3864420] header='icy-url:http://www.radiohit.si'
[http @ 0x3864420] header='content-type:audio/mpeg'
[http @ 0x3864420] header='icy-pub:1'
[http @ 0x3864420] header='icy-br:96'
[http @ 0x3864420] header=''
[mp3 @ 0x3848a80] Format mp3 probed with size=65536 and score=50
[mp3 @ 0x3848a80] Before avformat_find_stream_info() pos: 0 bytes
read:65536 seeks:0
[mp3 @ 0x384daa0] Header missing
    Last message repeated 2 times
[mp3 @ 0x3848a80] max_analyze_duration 5000000 reached at 5015510
microseconds
[mp3 @ 0x3848a80] After avformat_find_stream_info() pos: 62464 bytes
read:65536 seeks:0 frames:196
Input #1, mp3, from 'http://live.radiohit.si:9560':
  Duration: N/A, start: 0.000000, bitrate: 96 kb/s
    Stream #1:0, 196, 1/14112000: Audio: mp3, 44100 Hz, mono, s16p, 96 kb/s
Successfully opened the file.
Parsing a group of options: output file udp://
192.168.1.150:1236?pkt_size=1316?buffer_size=65535.
Applying option codec (codec name) with argument copy.
Applying option s (set frame size (WxH or abbreviation)) with argument
720x576.
Applying option q (use fixed quality scale (VBR)) with argument 10.
Applying option shortest (finish encoding within shortest input) with
argument 1.
Applying option f (force format) with argument mpegts.
Successfully parsed a group of options.
Opening an output file: udp://
192.168.1.150:1236?pkt_size=1316?buffer_size=65535.
Successfully opened the file.
[mpegts @ 0x38b3a40] Using AVStream.codec.time_base as a timebase hint to
the muxer is deprecated. Set AVStream.time_base instead.
    Last message repeated 1 times
[mpegts @ 0x38b3a40] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt
every 40 pkts
Output #0, mpegts, to 'udp://
192.168.1.150:1236?pkt_size=1316?buffer_size=65535':
  Metadata:
    encoder         : Lavf55.45.100
    Stream #0:0, 0, 1/90000: Video: mpeg2video ([2][0][0][0] / 0x0002),
yuv420p, 720x576 [SAR 1:1 DAR 5:4], 1/24, q=2-31, max. 104857 kb/s, 24 fps,
90k tbn, 24 tbc
    Stream #0:1, 0, 1/90000: Audio: mp3, 44100 Hz, mono, 96 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 1984 fps= 24 q=-1.0 Lsize=   30806kB time=00:01:23.08
bitrate=3037.5kbits/s
video:27316kB audio:974kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 8.895432%
Input file #0 (udp://@:1300):
  Input stream #0:0 (video): 1995 packets read (28015163 bytes);
  Total: 1995 packets (28015163 bytes) demuxed
Input file #1 (http://live.radiohit.si:9560):
  Input stream #1:0 (audio): 3179 packets read (997208 bytes);
  Total: 3179 packets (997208 bytes) demuxed
Output file #0 (udp://192.168.1.150:1236?pkt_size=1316?buffer_size=65535):
  Output stream #0:0 (video): 1984 packets muxed (27971717 bytes);
  Output stream #0:1 (audio): 3179 packets muxed (997208 bytes);



Then after about an hour the errors start to pop-up and the sound is
eventually gone. We have spent quite some time with this and cannot find
and good solution anywhere. I need to output mpegts, since it is sent to
some special device and I will be really grateful for any ideas and
suggestions.

Thank you very much,
Matej


More information about the ffmpeg-user mailing list