[FFmpeg-trac] #2771(avformat:closed): -segment_time generates unexpected file lengths
FFmpeg
trac at avcodec.org
Fri Jul 12 09:39:49 CEST 2013
#2771: -segment_time generates unexpected file lengths
------------------------------------+------------------------------------
Reporter: Acc72 | Owner:
Type: defect | Status: closed
Priority: normal | Component: avformat
Version: git-master | Resolution: invalid
Keywords: segment | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
------------------------------------+------------------------------------
Changes (by saste):
* keywords: => segment
* resolution: => invalid
* status: new => closed
* component: undetermined => avformat
Comment:
Replying to [ticket:2771 Acc72]:
> Hello,
>
> I'm attempting to utilize the segmenter on an A/V stream, from my USB
webcam. With the -segment_time option, I've configured ffmpeg to output a
circular series of four (4) mp4 files, each three (3) seconds in length.
However, ffmpeg generates files which are sixteen (16) seconds in length.
Occasionally, random files are generated at shorter lengths (2 sec, 3 sec,
8 sec, etc...). However, most of them are generated sixteen (16) seconds
in length.
>
> Results change, if I play with the value for -segment_time:
> (-Segment_time < 16) all 4 files generated @ 16 seconds.
> (-segment_time >= 16) 1st file generated @ 33 seconds and all subsequent
files generated @ 16 seconds.
>
> Not sure why this is happening???
This is expected, from the docs:
Every segment starts with a keyframe of the selected reference stream,
which is set through the reference_stream option.
Note that if you want accurate splitting for a video file, you need to
make the input key frames correspond to the exact splitting times expected
by the segmenter, or the segment muxer will start the new segment with the
key frame found next after the specified start time.
...
You can use the ffmpeg -force_key_frames option to force key-frames, read
the examples in the segment manual.
[...]
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2771#comment:4>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list