

Looks complex to do with several formats, but when I tested converting mp4 into an m3u8 a month ago it was simple ( & I sent the code to a pal who was interested).įfmpeg -i ns_2.mp4 -codec copy -f segment -copyts -start_at_zero -an -segment_time 20 -segment_list playlist.m3u8 -reset_timestamps 1 %d.ts -vn -c:a copy -b:a 128k -ac 2 audio.m4a Can anyone tell me if this is fine or anything needs to be changed?įor arg in do key=$(echo $arg | cut -f1 -d=) value=$(echo $arg | cut -f2 -d=) case "$key" in -i | -inputfile) if [ "$_%v.m3u8" It takes a file as input and converts it into 4 streams of 1080p, 720p, 480p and 360p respectively and divides it into 2 second chunks. I created a shell script to convert mp4 to m3u8 for dynamic streaming.
