Mr.Park
Mr.Park

Reputation: 123

Please tell us how to set up the option of HLS ffmpeg?

My ffmpeg Option :

ffmpeg -i test.mp4 -max_delay 50000 -map 0:v -map 0:a -c copy -flags:v +global_header -bsf:v h264_mp4toannexb -f ssegment -segment_time 10 -segment_list playlist.m3u8 -segment_format mpegts -initial_offset 10  segment_%05d.ts

if the WIFI, .m3u8 file plays not loading.

if the 3G, the loading takes longer.

my Works :

.m3u8 URL : http://mytest/test/test.m3u8

Simply call this URL into browser

my Question is :

Question 1. Can I split the HD video in .mp4 smaller capacity .ts files to .m3u8 file through the option of ffmpeg?

Question 2. .m3u8 when you play there a set way of WIFI and 3G options for ffmpeg?

Upvotes: 0

Views: 2922

Answers (1)

Alam
Alam

Reputation: 1596

Answer1: Split your big HD mp4 file to smaller ts segments using ffmpeg command as

ffmpeg -i test.mp4 -max_delay 50000 -map 0 -f segment -segment_time 1 -segment_list_flags live -segment_list_size 6 -segment_wrap 0 -segment_list playlist.m3u8  -segment_format mpegts segment_%05d.ts

Answer2: For playing ts streams on iPad or iPhone devices, transcode it to baseline profile using libx264

ffmpeg -i test.mp4 -max_delay 50000 -map 0  -c copy -c:v libx264 -profile:v baseline -flags -global_header -f segment -segment_time 1 -segment_list_flags live -segment_list_size 6 -segment_wrap 0 -segment_list playlist.m3u8  -segment_format mpegts segment_%05d.ts

Upvotes: 1

Related Questions