How to generate a fmp4 hls live stream with FFMPEG


ffmpeg -re -stream_loop -1 -i voweb.mp4 -hls_fmp4_init_filename init.mp4 -vf "settb=AVTB,setpts='trunc(PTS/1K)*1K+st\(1,trunc(RTCTIME/1K))-1K*trunc(ld(1)/1K)',\
drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: \
text='%{localtime}.%{eif\:1M*t-1K*trunc(t*1K)\:d}': fontcolor=red: box=1: boxcolor=0x00000000@1: fontsize=50: x=500: y=100" -c:a aac -b:a 128k -ar 44100 -c:v libx264 -max_muxing_queue_size 400 -x264opts no-scenecut -force_key_frames "expr:gte(t,n_forced*2)" -crf 23 -start_number 0 -hls_time 4 -hls_list_size 3 -use_localtime 1 -hls_segment_type fmp4 -hls_segment_filename voweb_%s.mp4 -hls_flags delete_segments -b:v 5000k -maxrate 5350k -bufsize 7500k -f hls hls_cmaf.m3u8

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s