[FFmpeg-user] Segment Metadata

Stefano Sabatini stefasab at gmail.com
Tue Nov 6 23:55:39 CET 2012


On date Tuesday 2012-11-06 15:13:44 -0700, Jeremy Whitaker wrote:
> Hello, I was wondering if it is at all possible to change the metadata of
> video segments in ffmpeg as the segments are being created. I know that by
> using the "-metadata" tag, you can change the metadata of the -i input
> video, but if that -i input video is being split into different segments by
> the "-f segment" option, then how do you change the metadata of the
> resulting segments while the -i input video is being segmented? I know that
> it's possible to change the metadata after the segmenting has completed,
> but this isn't that useful since I'm looking to stream the segments live as
> the input video is being segmented. To give a little better description:
>
> ffmpeg -f video4linux2 -s wvga -t ${CAPTURE_DURATION} -i "/dev/video0" -r 30 \
> -vcodec ${VID_CODEC} -s:v 640x480 -b:v 80k -keyint_min 30 -g 30 \
> -sc_threshold 0 -map 0 -flags -global_header -qcomp 0.8 \
> -qmin 10 -qmax 51 -qdiff 4 -f segment -segment_time ${SEG_TIME} \
> -segment_format ${SEG_FORMAT} -metadata START=0 -y
> "${LOCATE}${OUTPUT}%01d.${EXTENSION}"
> 
> Essentially what I'm doing is taking a video from the standard video
> input and segmenting it. Once the video segments are created, I can
> test videos by throwing them all into a VLC playlist, and when the
> segment format is "mp4", there is a notable delay between each video
> segment where VLC won't start the video segment until it has played
> back the time again where the segment was in the original video. So
> for example, if I have a 30 second video, and split it into 5 second
> segments, VLC will play the 1st segment immediately, but it will wait
> 5 seconds before playing the 2nd segment after the 1st segment has
> finished playing. It does this because the 2nd segment has a start
> time metadata of 5 seconds, so VLC thinks that it has to wait 5
> seconds before playing the 2nd segment.

This is ticket #1425:
https://ffmpeg.org/trac/ffmpeg/ticket/1425

You're invited to track and upvote the ticket.

One solution would be to file a feature request against VLC, and ask
to implement a feature which allows to detect and skip the initial
offset (which is the default ffplay behavior). Alternatively we should
implement a timestamp-reset mode.

> What I'm wondering is if
> there's a way to tell ffmpeg to set the segment start time metadata to
> 0 seconds as the segments are being created. Any help would be greatly
> appreciated.

Right now this is not possible, also I'm not sure this would fix any
problem, since players may safely ignore the metadata content. 
-- 
FFmpeg = Friendly and Fanciful Martial Practical Everlasting Glue


More information about the ffmpeg-user mailing list