Browse code

Merge commit '0e702124ee149593168cbbb7b30376249a64ae66'

* commit '0e702124ee149593168cbbb7b30376249a64ae66':
doc: Provide better examples for hls and segment muxing

Merged-by: James Almer <jamrial@gmail.com>

James Almer authored on 2017/11/12 11:47:50
Showing 1 changed files
... ...
@@ -468,9 +468,12 @@ By default, the muxer creates a file for each segment produced. These files
468 468
 have the same name as the playlist, followed by a sequential number and a
469 469
 .ts extension.
470 470
 
471
+Make sure to require a closed GOP when encoding and to set the GOP
472
+size to fit your segment time constraint.
473
+
471 474
 For example, to convert an input file with @command{ffmpeg}:
472 475
 @example
473
-ffmpeg -i in.nut out.m3u8
476
+ffmpeg -i in.mkv -c:v h264 -flags +cgop -g 30 -hls_time 1 out.m3u8
474 477
 @end example
475 478
 This example will produce the playlist, @file{out.m3u8}, and segment files:
476 479
 @file{out0.ts}, @file{out1.ts}, @file{out2.ts}, etc.
... ...
@@ -1649,6 +1652,9 @@ segment would usually span. Otherwise, the segment will be filled with the next
1649 1649
 packet written. Defaults to @code{0}.
1650 1650
 @end table
1651 1651
 
1652
+Make sure to require a closed GOP when encoding and to set the GOP
1653
+size to fit your segment time constraint.
1654
+
1652 1655
 @subsection Examples
1653 1656
 
1654 1657
 @itemize
... ...
@@ -1657,7 +1663,7 @@ Remux the content of file @file{in.mkv} to a list of segments
1657 1657
 @file{out-000.nut}, @file{out-001.nut}, etc., and write the list of
1658 1658
 generated segments to @file{out.list}:
1659 1659
 @example
1660
-ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.list out%03d.nut
1660
+ffmpeg -i in.mkv -codec hevc -flags +cgop -g 60 -map 0 -f segment -segment_list out.list out%03d.nut
1661 1661
 @end example
1662 1662
 
1663 1663
 @item