ffmpeg – Muxing HLS/M3U8 Sstream as MPEG-TS


I have a link to a live stream that I need to mux down into an mpeg-ts format. Problem is, it skips heavily, freezes, and even starts playing segments of the stream before the last one finishes up.

ffmpeg -i index.m3u8 -vcodec libx264 -c:v h264_nvenc -vf scale=1920:1080 -framerate 30 -profile:v high -level:v 4.0 -b:v 4M -minrate:v 4M -maxrate:v 4M -bufsize:v 4M -pcr_period 40 -muxrate 5000k -max_delay 700k -acodec ac3 -ac 2 -b:a 192k -mpegts_start_pid 481 -streamid 0:0x1E00 -streamid 1:0x1021 -f mpegts udp:

Read more here: Source link