[FFmpeg-user] Qüestion on segment muxer with h.264 over mp4 and reproducing segments as standalone movies

Hector Cano hcano at mebcn.com
Tue Jun 5 19:08:03 CEST 2012


On Tue, Jun 5, 2012 at 5:28 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> Hector Cano <hcano <at> mebcn.com> writes:
>
>> I am trying to use ffmpeg to record a video stream from an IP càmera
>> (Axis 210). I am using segment to split the output in 10 second chunks
>> and generate a playing list. Everything goes pretty well, but I have
>> difficulties when playing the clips on VLC or Quicktime.
>> I use mp4 format, with h.264 codec.
>> If I open the playlist on VLC the first clip plays smoothly. Then I
>> have 10 seconds where VLC counter is working, but no video is played,
>> then the second clip is played (while the time counter goes up to
>> something like 20/10). Then 20 seconds pause, and increasing for every
>> clip.
>
> Is this only reproducible with playing the playlist or also if you
> play one of the clips? Also with MPlayer?
>
> Since I believe this is supposed to work fine, please test current
> git head (and since this makes reproducing the issue easier, please
> use -vcodec mpeg4 for the tests).
>

It also happens when playing each of the clips.
On VLC each one will have a "no video" time equal to the added length
of all preceding files (equal to the "start" time), 10 seconds for the
second, 20 for the third... on Quicktime it is always ten seconds
black and then stop.

MPlayer OSX Extended plays the video correctly, but the time line
below the image is not correct. It indicates playing time starting on
"start" (10 to 20 seconds on de second clip, ...) but if I try to move
the video using the handle it tries to play the first 10 seconds
(therefore restarting the clip).
Gnome MPlayer plays everything as I would like it (as if those were
standalone movies of 10 second length).
Totem on ubuntu plays it ok as well.

I tested with current git head and -vcodec mpeg4 with same results:


$ ffmpeg -i "rtsp://192.168.1.222/mpeg4/1/media.amp" \
>   -map 0 \
>   -vcodec mpeg4 \
>   -t 30 -f segment \
>   -segment_time 10 -segment_format mp4 \
>   -segment_list testmp4.m3u8 -segment_list_size 30 \
>   test%03d.mp4
ffmpeg version N-41331-gc527027 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jun  5 2012 18:26:01 with gcc 4.6.1
  configuration: --enable-gpl --enable-libx264 --enable-x11grab
  libavutil      51. 56.100 / 51. 56.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.101 / 54.  6.101
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 78.100 /  2. 78.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[rtsp @ 0xaac33c0] Estimating duration from bitrate, this may be inaccurate
Input #0, rtsp, from 'rtsp://192.168.1.222/mpeg4/1/media.amp':
  Metadata:
    title           : Media Presentation
  Duration: N/A, start: 0.023311, bitrate: N/A
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile), yuv420p,
640x480 [SAR 1:1 DAR 4:3], 100 tbr, 90k tbn, 100 tbc
[buffer @ 0xaaf1a40] w:640 h:480 pixfmt:yuv420p tb:1/90000 sar:1/1
sws_param:flags=2
[ffmpeg_buffersink @ 0xaaf1a80] No opaque field provided
Output #0, segment, to 'test%03d.mp4':
  Metadata:
    title           : Media Presentation
    encoder         : Lavf54.6.101
    Stream #0:0: Video: mpeg4 ( [0][0][0] / 0x0020), yuv420p, 640x480
[SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 100 tbn, 100 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 -> mpeg4)
Press [q] to stop, [?] for help
frame=   52 fps=0.0 q=31.0 size=       0kB time=00:00:00.52 bitrate=
0.0kbits/s dup=37 drop=0   frame=  105 fps= 97 q=31.0 size=       0kB
time=00:00:01.05 bitrate=   0.0kbits/s dup=76 drop=0   frame=  159
fps= 99 q=31.0 size=       0kB time=00:00:01.59 bitrate=   0.0kbits/s
dup=116 drop=0  frame=  212 fps=100 q=31.0 size=       0kB
time=00:00:02.12 bitrate=   0.0kbits/s dup=155 drop=0  frame=  262
fps= 99 q=31.0 size=       0kB time=00:00:02.62 bitrate=   0.0kbits/s
dup=191 drop=0  frame=  315 fps= 99 q=31.0 size=       0kB
time=00:00:03.15 bitrate=   0.0kbits/s dup=230 drop=0  frame=  369
fps=100 q=31.0 size=       0kB time=00:00:03.69 bitrate=   0.0kbits/s
dup=270 drop=0  frame=  422 fps=100 q=31.0 size=       0kB
time=00:00:04.22 bitrate=   0.0kbits/s dup=309 drop=0  frame=  475
fps=100 q=31.0 size=       0kB time=00:00:04.75 bitrate=   0.0kbits/s
dup=348 drop=0  frame=  529 fps= 99 q=24.8 size=       0kB
time=00:00:05.29 bitrate=   0.0kbits/s dup=388 drop=0  frame=  582
fps= 99 q=31.0 size=       0kB time=00:00:05.82 bitrate=   0.0kbits/s
dup=427 drop=0  frame=  635 fps=100 q=31.0 size=       0kB
time=00:00:06.35 bitrate=   0.0kbits/s dup=466 drop=0  frame=  689
fps=100 q=31.0 size=       0kB time=00:00:06.89 bitrate=   0.0kbits/s
dup=506 drop=0  frame=  742 fps=100 q=31.0 size=       0kB
time=00:00:07.42 bitrate=   0.0kbits/s dup=545 drop=0  frame=  795
fps=100 q=31.0 size=       0kB time=00:00:07.95 bitrate=   0.0kbits/s
dup=584 drop=0  frame=  849 fps=100 q=31.0 size=       0kB
time=00:00:08.49 bitrate=   0.0kbits/s dup=624 drop=0  frame=  902
fps=100 q=31.0 size=       0kB time=00:00:09.02 bitrate=   0.0kbits/s
dup=663 drop=0  frame=  952 fps=100 q=31.0 size=       0kB
time=00:00:09.52 bitrate=   0.0kbits/s dup=699 drop=0  frame= 1005
fps=100 q=31.0 size=       0kB time=00:00:10.05 bitrate=   0.0kbits/s
dup=738 drop=0  frame= 1059 fps=100 q=31.0 size=       0kB
time=00:00:10.59 bitrate=   0.0kbits/s dup=778 drop=0  frame= 1109
fps=100 q=31.0 size=       0kB time=00:00:11.09 bitrate=   0.0kbits/s
dup=814 drop=0  frame= 1162 fps=100 q=31.0 size=       0kB
time=00:00:11.62 bitrate=   0.0kbits/s dup=853 drop=0  frame= 1216
fps=100 q=31.0 size=       0kB time=00:00:12.16 bitrate=   0.0kbits/s
dup=893 drop=0  frame= 1266 fps=100 q=31.0 size=       0kB
time=00:00:12.66 bitrate=   0.0kbits/s dup=930 drop=0  frame= 1319
fps=100 q=31.0 size=       0kB time=00:00:13.19 bitrate=   0.0kbits/s
dup=969 drop=0  frame= 1369 fps=100 q=24.8 size=       0kB
time=00:00:13.69 bitrate=   0.0kbits/s dup=1006 drop=0 frame= 1422
fps=100 q=31.0 size=       0kB time=00:00:14.22 bitrate=   0.0kbits/s
dup=1045 drop=0 frame= 1476 fps=100 q=31.0 size=       0kB
time=00:00:14.76 bitrate=   0.0kbits/s dup=1085 drop=0 frame= 1526
fps=100 q=31.0 size=       0kB time=00:00:15.26 bitrate=   0.0kbits/s
dup=1121 drop=0 frame= 1579 fps=100 q=31.0 size=       0kB
time=00:00:15.79 bitrate=   0.0kbits/s dup=1160 drop=0 frame= 1636
fps=100 q=31.0 size=       0kB time=00:00:16.36 bitrate=   0.0kbits/s
dup=1203 drop=0 frame= 1689 fps=100 q=31.0 size=       0kB
time=00:00:16.89 bitrate=   0.0kbits/s dup=1242 drop=0 frame= 1739
fps=100 q=31.0 size=       0kB time=00:00:17.39 bitrate=   0.0kbits/s
dup=1278 drop=0 frame= 1792 fps=100 q=31.0 size=       0kB
time=00:00:17.92 bitrate=   0.0kbits/s dup=1317 drop=0 frame= 1846
fps=100 q=31.0 size=       0kB time=00:00:18.46 bitrate=   0.0kbits/s
dup=1357 drop=0 frame= 1896 fps=100 q=31.0 size=       0kB
time=00:00:18.96 bitrate=   0.0kbits/s dup=1393 drop=0 frame= 1949
fps=100 q=31.0 size=       0kB time=00:00:19.49 bitrate=   0.0kbits/s
dup=1432 drop=0 frame= 2002 fps=100 q=31.0 size=       0kB
time=00:00:20.02 bitrate=   0.0kbits/s dup=1471 drop=0 frame= 2056
fps=100 q=31.0 size=       0kB time=00:00:20.56 bitrate=   0.0kbits/s
dup=1511 drop=0 frame= 2109 fps=100 q=31.0 size=       0kB
time=00:00:21.09 bitrate=   0.0kbits/s dup=1550 drop=0 frame= 2162
fps=100 q=31.0 size=       0kB time=00:00:21.62 bitrate=   0.0kbits/s
dup=1589 drop=0 frame= 2212 fps=100 q=31.0 size=       0kB
time=00:00:22.12 bitrate=   0.0kbits/s dup=1625 drop=0 frame= 2266
fps=100 q=31.0 size=       0kB time=00:00:22.66 bitrate=   0.0kbits/s
dup=1665 drop=0 frame= 2319 fps=100 q=31.0 size=       0kB
time=00:00:23.19 bitrate=   0.0kbits/s dup=1704 drop=0 frame= 2372
fps=100 q=31.0 size=       0kB time=00:00:23.72 bitrate=   0.0kbits/s
dup=1743 drop=0 frame= 2426 fps=100 q=31.0 size=       0kB
time=00:00:24.26 bitrate=   0.0kbits/s dup=1783 drop=0 frame= 2476
fps=100 q=31.0 size=       0kB time=00:00:24.76 bitrate=   0.0kbits/s
dup=1820 drop=0 frame= 2526 fps=100 q=31.0 size=       0kB
time=00:00:25.26 bitrate=   0.0kbits/s dup=1857 drop=0 frame= 2579
fps=100 q=31.0 size=       0kB time=00:00:25.79 bitrate=   0.0kbits/s
dup=1896 drop=0 frame= 2632 fps=100 q=31.0 size=       0kB
time=00:00:26.32 bitrate=   0.0kbits/s dup=1935 drop=0 frame= 2682
fps=100 q=31.0 size=       0kB time=00:00:26.82 bitrate=   0.0kbits/s
dup=1971 drop=0 frame= 2736 fps=100 q=31.0 size=       0kB
time=00:00:27.36 bitrate=   0.0kbits/s dup=2011 drop=0 frame= 2789
fps=100 q=31.0 size=       0kB time=00:00:27.89 bitrate=   0.0kbits/s
dup=2050 drop=0 frame= 2842 fps=100 q=31.0 size=       0kB
time=00:00:28.42 bitrate=   0.0kbits/s dup=2089 drop=0 frame= 2896
fps=100 q=31.0 size=       0kB time=00:00:28.96 bitrate=   0.0kbits/s
dup=2129 drop=0 frame= 2946 fps=100 q=31.0 size=       0kB
time=00:00:29.46 bitrate=   0.0kbits/s dup=2165 drop=0 frame= 2999
fps=100 q=31.0 size=       0kB time=00:00:29.99 bitrate=   0.0kbits/s
dup=2204 drop=0 frame= 2999 fps=100 q=31.0 Lsize=       0kB
time=00:00:29.99 bitrate=   0.0kbits/s dup=2204 drop=0
video:4619kB audio:0kB global headers:0kB muxing overhead -100.000000%

Thank you.

--
Héctor


More information about the ffmpeg-user mailing list