[FFmpeg-trac] #4048(avformat:new): segment: Handle WebVTT as per HLS spec
FFmpeg
trac at avcodec.org
Tue Oct 21 10:31:06 CEST 2014
#4048: segment: Handle WebVTT as per HLS spec
-------------------------------------+------------------------------------
Reporter: 11rcombs | Owner:
Type: enhancement | Status: new
Priority: normal | Component: avformat
Version: git-master | Resolution:
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+------------------------------------
Changes (by 11rcombs):
* keywords: hls webvtt =>
Comment:
It's not so much a bug as the lack of support for a newly-specified
behavior. But let's use this {{{test.vtt}}} file as an example:
{{{
00:00.000 --> 00:07.000
Test line 1, spans segments 0 and 1
00:07.000 --> 00:08.000
Test line 2, contained in segment 1
00:16.000 --> 00:18.000
Test line 3, should be in segment 3 after an empty segment 2
00:18.000 --> 00:40.000
Test line 4, should span several segments
}}}
Let's run {{{ffmpeg -i in.vtt -f segment -segment_time 5 -segment_format
webvtt -scodec copy out-%05d.vtt}}}.
We get:
out-00000.vtt
{{{
WEBVTT
00:00.000 --> 00:07.000
Test line 1, spans segments 0 and 1
}}}
out-00001.vtt
{{{
WEBVTT
00:07.000 --> 00:08.000
Test line 2, contained in segment 1
}}}
out-00002.vtt
{{{
WEBVTT
00:16.000 --> 00:18.000
Test line 3, should be in segment 3 after an empty segment 2
}}}
out-00003.vtt
{{{
WEBVTT
00:18.000 --> 00:40.000
Test line 4, should span several segments
}}}
The correct output for HLS would be:
out-00000.vtt
{{{
WEBVTT
00:00.000 --> 00:07.000
Test line 1, spans segments 0 and 1
}}}
out-00001.vtt
{{{
WEBVTT
00:00.000 --> 00:07.000
Test line 1, spans segments 0 and 1
00:07.000 --> 00:08.000
Test line 2, contained in segment 1
}}}
out-00002.vtt
{{{
WEBVTT
}}}
out-00003.vtt
{{{
WEBVTT
00:18.000 --> 00:40.000
Test line 4, should span several segments
}}}
out-00004.vtt
{{{
WEBVTT
00:18.000 --> 00:40.000
Test line 4, should span several segments
}}}
<etc…, with more duplicates up to out-00007.vtt>
The two behaviors that need adding (writing empty segments, and
duplicating packets spanning multiple segments) seem like they could
reasonably be separate options. The writing-empty-segments behavior seems
sensible for generic subtitle segmenting (in order to have predictable
segment durations), whereas duplicating packets is pretty WebVTT-in-HLS-
specific.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/4048#comment:3>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list