Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#910 closed defect (invalid)

Segmented encode gives increasing time clips

Reported by: stljdpwl Owned by:
Priority: normal Component: avformat
Version: 0.9.1 Keywords: segment dshow
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: yes

Description

Encoding a video from DirectShow (windows 7) segmented in 10 sec chunks, the first clip is 10 seconds long, the second 20 seconds long (only last 10 sec with video data), the third is 30 secs long (only last 10 sec with video data), and so on.

ffmpeg started on 2012-01-10 at 07:49:52
Report written to "ffmpeg-20120110-074952.log"
Command line:
ffmpeg.exe -report -f dshow -i "video=USB2.0 UVC VGA WebCam" -vcodec mpeg4 -map 0 -t 60 -f segment -segment_time 10 -segment_format avi "output%03d.avi"
ffmpeg version N-36635-gceb0dd9 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jan  9 2012 17:39:58 with gcc 4.6.2
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      51. 34.100 / 51. 34.100
  libavcodec     53. 54.100 / 53. 54.100
  libavformat    53. 29.100 / 53. 29.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 58.100 /  2. 58.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    51.  2.100 / 51.  2.100
[rawvideo @ 02B79AE0] err{or,}_recognition separate: 1; 1
[rawvideo @ 02B79AE0] err{or,}_recognition combined: 1; 10001
[dshow @ 003496E0] Probe buffer size limit 5000000 reached
rfps: 7.083333 0.017691
rfps: 7.166667 0.011714
rfps: 7.250000 0.007029
rfps: 7.333333 0.003637
rfps: 7.416667 0.001537
rfps: 7.500000 0.000730
rfps: 7.583333 0.001216
rfps: 7.666667 0.002994
rfps: 7.666667 0.002994
rfps: 7.750000 0.006064
rfps: 7.833333 0.010427
rfps: 7.916667 0.016083
rfps: 14.666667 0.014549
rfps: 14.666667 0.014549
rfps: 14.750000 0.009703
rfps: 14.833333 0.006150
rfps: 14.833333 0.006150
rfps: 14.916667 0.003889
rfps: 14.916667 0.003889
rfps: 15.000000 0.002921
rfps: 15.000000 0.002921
rfps: 15.083333 0.003246
rfps: 15.083333 0.003246
rfps: 15.166667 0.004863
rfps: 15.333333 0.011975
rfps: 15.333333 0.011975
rfps: 15.416667 0.017470
rfps: 22.166667 0.018844
rfps: 22.250000 0.013837
rfps: 22.333333 0.010124
rfps: 22.416667 0.007702
rfps: 22.500000 0.006573
rfps: 22.500000 0.006573
rfps: 22.583333 0.006737
rfps: 22.583333 0.006737
rfps: 22.666667 0.008193
rfps: 22.666667 0.008193
rfps: 22.750000 0.010942
rfps: 22.833333 0.014983
rfps: 29.750000 0.019433
rfps: 29.833333 0.015558
rfps: 29.916667 0.012976
rfps: 30.000000 0.011686
rfps: 30.000000 0.011686
rfps: 30.083333 0.011689
rfps: 30.083333 0.011689
rfps: 30.166667 0.012984
rfps: 30.250000 0.015572
rfps: 30.333333 0.019453
rfps: 29.970030 0.012001
rfps: 14.985015 0.003000
rfps: 14.985015 0.003000
[dshow @ 003496E0] Estimating duration from bitrate, this may be inaccurate
Input #0, dshow, from 'video=USB2.0 UVC VGA WebCam':
  Duration: N/A, start: 471306.535000, bitrate: N/A
    Stream #0:0, 9, 1/10000000: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 7.50 tbr, 10000k tbn, 10000k tbc
Incompatible pixel format 'yuyv422' for codec 'mpeg4', auto-selecting format 'yuv420p'
[buffer @ 02B7BF40] w:640 h:480 pixfmt:yuyv422 tb:1/1000000 sar:0/1 sws_param:
[buffersink @ 02B7C0C0] auto-inserting filter 'auto-inserted scale 0' between the filter 'src' and the filter 'out'
[scale @ 02B81EC0] w:640 h:480 fmt:yuyv422 -> w:640 h:480 fmt:yuv420p flags:0x4
[mpeg4 @ 02B7E460] err{or,}_recognition separate: 1; 1
[mpeg4 @ 02B7E460] err{or,}_recognition combined: 1; 10001
[mpeg4 @ 02B7E460] detected 2 logical cores
[mpeg4 @ 02B7E460] intra_quant_bias = 0 inter_quant_bias = -64
[mpeg4 @ 02B7E460] Unsupported bit depth: 0
[rawvideo @ 02B79AE0] err{or,}_recognition separate: 1; 10001
[rawvideo @ 02B79AE0] err{or,}_recognition combined: 1; 10001
Output #0, segment, to 'output%03d.avi':
  Metadata:
    encoder         : Lavf53.29.100
    Stream #0:0, 0, 2/15: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 640x480, q=2-31, 200 kb/s, 7.50 tbn, 7.50 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> mpeg4)
Press [q] to stop, [?] for help
frame=   14 fps=  0 q=8.5 size=       0kB time=00:00:01.86 bitrate=   0.0kbits/s    
frame=   18 fps= 16 q=7.5 size=       0kB time=00:00:02.40 bitrate=   0.0kbits/s    
frame=   22 fps= 13 q=7.8 size=       0kB time=00:00:02.93 bitrate=   0.0kbits/s    
frame=   26 fps= 12 q=7.8 size=       0kB time=00:00:03.46 bitrate=   0.0kbits/s    
frame=   30 fps= 11 q=7.0 size=       0kB time=00:00:04.00 bitrate=   0.0kbits/s    
frame=   34 fps= 10 q=6.7 size=       0kB time=00:00:04.53 bitrate=   0.0kbits/s    
frame=   38 fps= 10 q=6.8 size=       0kB time=00:00:05.06 bitrate=   0.0kbits/s    
frame=   42 fps= 10 q=6.5 size=       0kB time=00:00:05.60 bitrate=   0.0kbits/s    
frame=   46 fps= 10 q=6.4 size=       0kB time=00:00:06.13 bitrate=   0.0kbits/s    
frame=   50 fps=  9 q=6.6 size=       0kB time=00:00:06.66 bitrate=   0.0kbits/s    
frame=   54 fps=  9 q=6.5 size=       0kB time=00:00:07.20 bitrate=   0.0kbits/s    
frame=   58 fps=  9 q=6.7 size=       0kB time=00:00:07.73 bitrate=   0.0kbits/s    
frame=   62 fps=  9 q=6.6 size=       0kB time=00:00:08.26 bitrate=   0.0kbits/s    
frame=   66 fps=  9 q=6.2 size=       0kB time=00:00:08.80 bitrate=   0.0kbits/s    
frame=   70 fps=  9 q=6.6 size=       0kB time=00:00:09.33 bitrate=   0.0kbits/s    
frame=   74 fps=  9 q=6.6 size=       0kB time=00:00:09.86 bitrate=   0.0kbits/s    
frame=   78 fps=  9 q=6.7 size=       0kB time=00:00:10.40 bitrate=   0.0kbits/s    
frame=   82 fps=  9 q=6.9 size=       0kB time=00:00:10.93 bitrate=   0.0kbits/s    
Next segment starts at 0 84
frame=   86 fps=  8 q=7.0 size=       0kB time=00:00:11.46 bitrate=   0.0kbits/s    
frame=   90 fps=  8 q=6.6 size=       0kB time=00:00:12.00 bitrate=   0.0kbits/s    
frame=   94 fps=  8 q=6.8 size=       0kB time=00:00:12.53 bitrate=   0.0kbits/s    
frame=   99 fps=  8 q=6.9 size=       0kB time=00:00:13.20 bitrate=   0.0kbits/s    
frame=  103 fps=  8 q=6.3 size=       0kB time=00:00:13.73 bitrate=   0.0kbits/s    
frame=  107 fps=  8 q=6.2 size=       0kB time=00:00:14.26 bitrate=   0.0kbits/s    
frame=  111 fps=  8 q=6.4 size=       0kB time=00:00:14.80 bitrate=   0.0kbits/s    
frame=  115 fps=  8 q=7.0 size=       0kB time=00:00:15.33 bitrate=   0.0kbits/s    
frame=  119 fps=  8 q=7.9 size=       0kB time=00:00:15.86 bitrate=   0.0kbits/s    
frame=  123 fps=  8 q=6.7 size=       0kB time=00:00:16.40 bitrate=   0.0kbits/s    
frame=  127 fps=  8 q=6.4 size=       0kB time=00:00:16.93 bitrate=   0.0kbits/s    
frame=  131 fps=  8 q=6.0 size=       0kB time=00:00:17.46 bitrate=   0.0kbits/s    
frame=  135 fps=  8 q=6.2 size=       0kB time=00:00:18.00 bitrate=   0.0kbits/s    
frame=  139 fps=  8 q=6.2 size=       0kB time=00:00:18.53 bitrate=   0.0kbits/s    
frame=  143 fps=  8 q=5.5 size=       0kB time=00:00:19.06 bitrate=   0.0kbits/s    
frame=  147 fps=  8 q=5.8 size=       0kB time=00:00:19.60 bitrate=   0.0kbits/s    
frame=  151 fps=  8 q=5.7 size=       0kB time=00:00:20.13 bitrate=   0.0kbits/s    
frame=  155 fps=  8 q=5.4 size=       0kB time=00:00:20.66 bitrate=   0.0kbits/s    
Next segment starts at 0 156
frame=  159 fps=  8 q=5.6 size=       0kB time=00:00:21.20 bitrate=   0.0kbits/s    
frame=  163 fps=  8 q=5.7 size=       0kB time=00:00:21.73 bitrate=   0.0kbits/s    
frame=  167 fps=  8 q=5.7 size=       0kB time=00:00:22.26 bitrate=   0.0kbits/s    
frame=  171 fps=  8 q=5.9 size=       0kB time=00:00:22.80 bitrate=   0.0kbits/s    
frame=  175 fps=  8 q=5.5 size=       0kB time=00:00:23.33 bitrate=   0.0kbits/s    
frame=  179 fps=  8 q=5.3 size=       0kB time=00:00:23.86 bitrate=   0.0kbits/s    
frame=  183 fps=  8 q=5.7 size=       0kB time=00:00:24.40 bitrate=   0.0kbits/s    
frame=  187 fps=  8 q=5.5 size=       0kB time=00:00:24.93 bitrate=   0.0kbits/s    
frame=  191 fps=  8 q=5.3 size=       0kB time=00:00:25.46 bitrate=   0.0kbits/s    
frame=  195 fps=  8 q=5.6 size=       0kB time=00:00:26.00 bitrate=   0.0kbits/s    
frame=  199 fps=  8 q=5.4 size=       0kB time=00:00:26.53 bitrate=   0.0kbits/s    
frame=  203 fps=  8 q=5.4 size=       0kB time=00:00:27.06 bitrate=   0.0kbits/s    
frame=  207 fps=  8 q=5.7 size=       0kB time=00:00:27.60 bitrate=   0.0kbits/s    
frame=  211 fps=  8 q=5.5 size=       0kB time=00:00:28.13 bitrate=   0.0kbits/s    
frame=  215 fps=  8 q=5.6 size=       0kB time=00:00:28.66 bitrate=   0.0kbits/s    
frame=  219 fps=  8 q=5.8 size=       0kB time=00:00:29.20 bitrate=   0.0kbits/s    
frame=  223 fps=  8 q=5.5 size=       0kB time=00:00:29.73 bitrate=   0.0kbits/s    
frame=  227 fps=  8 q=5.6 size=       0kB time=00:00:30.26 bitrate=   0.0kbits/s    
Next segment starts at 0 228
frame=  231 fps=  8 q=5.8 size=       0kB time=00:00:30.80 bitrate=   0.0kbits/s    
frame=  235 fps=  8 q=5.5 size=       0kB time=00:00:31.33 bitrate=   0.0kbits/s    
frame=  239 fps=  8 q=5.4 size=       0kB time=00:00:31.86 bitrate=   0.0kbits/s    
frame=  243 fps=  8 q=5.7 size=       0kB time=00:00:32.40 bitrate=   0.0kbits/s    
frame=  247 fps=  8 q=5.4 size=       0kB time=00:00:32.93 bitrate=   0.0kbits/s    
frame=  251 fps=  8 q=5.4 size=       0kB time=00:00:33.46 bitrate=   0.0kbits/s    
frame=  255 fps=  8 q=5.5 size=       0kB time=00:00:34.00 bitrate=   0.0kbits/s    
frame=  259 fps=  8 q=5.3 size=       0kB time=00:00:34.53 bitrate=   0.0kbits/s    
frame=  263 fps=  8 q=5.3 size=       0kB time=00:00:35.06 bitrate=   0.0kbits/s    
frame=  267 fps=  8 q=5.6 size=       0kB time=00:00:35.60 bitrate=   0.0kbits/s    
frame=  271 fps=  8 q=5.3 size=       0kB time=00:00:36.13 bitrate=   0.0kbits/s    
frame=  275 fps=  8 q=5.3 size=       0kB time=00:00:36.66 bitrate=   0.0kbits/s    
frame=  279 fps=  8 q=5.8 size=       0kB time=00:00:37.20 bitrate=   0.0kbits/s    
frame=  283 fps=  8 q=5.4 size=       0kB time=00:00:37.73 bitrate=   0.0kbits/s    
frame=  287 fps=  8 q=5.4 size=       0kB time=00:00:38.26 bitrate=   0.0kbits/s    
frame=  291 fps=  8 q=5.9 size=       0kB time=00:00:38.80 bitrate=   0.0kbits/s    
frame=  295 fps=  8 q=5.7 size=       0kB time=00:00:39.33 bitrate=   0.0kbits/s    
frame=  299 fps=  8 q=5.8 size=       0kB time=00:00:39.86 bitrate=   0.0kbits/s    
Next segment starts at 0 300
frame=  303 fps=  8 q=5.7 size=       0kB time=00:00:40.40 bitrate=   0.0kbits/s    
frame=  307 fps=  8 q=5.3 size=       0kB time=00:00:40.93 bitrate=   0.0kbits/s    
frame=  311 fps=  8 q=5.3 size=       0kB time=00:00:41.46 bitrate=   0.0kbits/s    
frame=  315 fps=  8 q=5.6 size=       0kB time=00:00:42.00 bitrate=   0.0kbits/s    
frame=  319 fps=  8 q=5.6 size=       0kB time=00:00:42.53 bitrate=   0.0kbits/s    
frame=  323 fps=  8 q=5.4 size=       0kB time=00:00:43.06 bitrate=   0.0kbits/s    
frame=  327 fps=  8 q=5.6 size=       0kB time=00:00:43.60 bitrate=   0.0kbits/s    
frame=  331 fps=  8 q=5.4 size=       0kB time=00:00:44.13 bitrate=   0.0kbits/s    
frame=  335 fps=  8 q=5.4 size=       0kB time=00:00:44.66 bitrate=   0.0kbits/s    
frame=  339 fps=  8 q=5.6 size=       0kB time=00:00:45.20 bitrate=   0.0kbits/s    
frame=  343 fps=  8 q=5.6 size=       0kB time=00:00:45.73 bitrate=   0.0kbits/s    
frame=  347 fps=  8 q=5.3 size=       0kB time=00:00:46.26 bitrate=   0.0kbits/s    
frame=  351 fps=  8 q=5.7 size=       0kB time=00:00:46.80 bitrate=   0.0kbits/s    
frame=  355 fps=  8 q=5.5 size=       0kB time=00:00:47.33 bitrate=   0.0kbits/s    
frame=  359 fps=  8 q=5.7 size=       0kB time=00:00:47.86 bitrate=   0.0kbits/s    
frame=  363 fps=  8 q=5.8 size=       0kB time=00:00:48.40 bitrate=   0.0kbits/s    
frame=  367 fps=  8 q=5.9 size=       0kB time=00:00:48.93 bitrate=   0.0kbits/s    
frame=  371 fps=  8 q=5.5 size=       0kB time=00:00:49.46 bitrate=   0.0kbits/s    
frame=  375 fps=  8 q=5.8 size=       0kB time=00:00:50.00 bitrate=   0.0kbits/s    
frame=  379 fps=  8 q=5.8 size=       0kB time=00:00:50.53 bitrate=   0.0kbits/s    
frame=  383 fps=  8 q=5.5 size=       0kB time=00:00:51.06 bitrate=   0.0kbits/s    
Next segment starts at 0 384
frame=  387 fps=  8 q=6.0 size=       0kB time=00:00:51.60 bitrate=   0.0kbits/s    
frame=  391 fps=  8 q=5.7 size=       0kB time=00:00:52.13 bitrate=   0.0kbits/s    
frame=  395 fps=  8 q=5.4 size=       0kB time=00:00:52.66 bitrate=   0.0kbits/s    
frame=  399 fps=  8 q=5.7 size=       0kB time=00:00:53.20 bitrate=   0.0kbits/s    
frame=  403 fps=  8 q=5.6 size=       0kB time=00:00:53.73 bitrate=   0.0kbits/s    
frame=  407 fps=  8 q=5.8 size=       0kB time=00:00:54.26 bitrate=   0.0kbits/s    
frame=  411 fps=  8 q=6.0 size=       0kB time=00:00:54.80 bitrate=   0.0kbits/s    
frame=  415 fps=  8 q=5.7 size=       0kB time=00:00:55.33 bitrate=   0.0kbits/s    
frame=  419 fps=  8 q=6.1 size=       0kB time=00:00:55.86 bitrate=   0.0kbits/s    
frame=  423 fps=  8 q=5.8 size=       0kB time=00:00:56.40 bitrate=   0.0kbits/s    
frame=  427 fps=  8 q=5.6 size=       0kB time=00:00:56.93 bitrate=   0.0kbits/s    
frame=  431 fps=  8 q=5.7 size=       0kB time=00:00:57.46 bitrate=   0.0kbits/s    
frame=  435 fps=  8 q=5.8 size=       0kB time=00:00:58.00 bitrate=   0.0kbits/s    
frame=  439 fps=  8 q=7.3 size=       0kB time=00:00:58.53 bitrate=   0.0kbits/s    
frame=  443 fps=  8 q=7.3 size=       0kB time=00:00:59.06 bitrate=   0.0kbits/s    
frame=  447 fps=  8 q=6.9 size=       0kB time=00:00:59.60 bitrate=   0.0kbits/s    
frame=  451 fps=  8 q=6.5 size=       0kB time=00:01:00.13 bitrate=   0.0kbits/s    
frame=  451 fps=  8 q=6.5 Lsize=       0kB time=00:01:00.13 bitrate=   0.0kbits/s    

video:1591kB audio:0kB global headers:0kB muxing overhead -100.000000%

Attachments (4)

output000.avi (412.4 KB) - added by stljdpwl 5 years ago.
output001.avi (248.8 KB) - added by stljdpwl 5 years ago.
output002.avi (246.3 KB) - added by stljdpwl 5 years ago.
output003.avi (247.8 KB) - added by stljdpwl 5 years ago.

Download all attachments as: .zip

Change History (8)

Changed 5 years ago by stljdpwl

Changed 5 years ago by stljdpwl

Changed 5 years ago by stljdpwl

Changed 5 years ago by stljdpwl

comment:1 Changed 5 years ago by cehoyos

  • Component changed from FFmpeg to avformat
  • Keywords ffmpeg removed
  • Status changed from new to open

Is this only reproducible with -f dshow or also if a file is the input?
Is this also reproducible with current git head?

comment:2 in reply to: ↑ description Changed 5 years ago by saste

  • Analyzed by developer set
  • Resolution set to invalid
  • Status changed from open to closed

Replying to stljdpwl:

Encoding a video from DirectShow (windows 7) segmented in 10 sec chunks, the first clip is 10 seconds long, the second 20 seconds long (only last 10 sec with video data), the third is 30 secs long (only last 10 sec with video data), and so on.

ffmpeg started on 2012-01-10 at 07:49:52
Report written to "ffmpeg-20120110-074952.log"
Command line:
ffmpeg.exe -report -f dshow -i "video=USB2.0 UVC VGA WebCam" -vcodec mpeg4 -map 0 -t 60 -f segment -segment_time 10 -segment_format avi "output%03d.avi"
ffmpeg version N-36635-gceb0dd9 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jan  9 2012 17:39:58 with gcc 4.6.2
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      51. 34.100 / 51. 34.100
  libavcodec     53. 54.100 / 53. 54.100
  libavformat    53. 29.100 / 53. 29.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 58.100 /  2. 58.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    51.  2.100 / 51.  2.100
[...]
video:1591kB audio:0kB global headers:0kB muxing overhead -100.000000%

Hi, this is the assumed behavior of the segment muxer, which does not change the timestamps of the original file, and is IMO the correct behavior, while the *total duration* of each segment should be more or less the specified segment time.

For example with a video starting with a timestamp of 10 and an ending time around 20, the player is assumed to play the file just for 10 seconds (this is the behavior assumed for example by ffplay).
I checked the attached files and they look perfectly sane to me, given the way they have been generated.

You may ask for an extension of the segment muxer (for resetting the timestamps at the beginning of each segment) but in this case you should provide an explanation of why you need such an option.

comment:3 Changed 5 years ago by Alrich

Is there no other way to reset the timestamps at the beginning of each segment, so that one can use ffmpeg to record security camera feeds every 15mins or so?

comment:4 Changed 4 years ago by cehoyos

  • Keywords segment dshow added; segmenting DirectShow removed
Note: See TracTickets for help on using tickets.