running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
|- 360p_001.ts
|- 360p_002.ts
|- 480p.m3u8
|- 480p_001.ts
|- 480p_002.ts
|- 720p.m3u8
|- 720p_001.ts
|- 720p_002.ts
|- 1080p.m3u8
|- 1080p_001.ts
|- 1080p_002.ts
origin: http://docs.peer5.com/guides/production-ready-hls-vod/
I was looking for a code to convert video files in a directory where it has multiple subfolders for each video file. I want to run a batch code so it can convert the video files and save them where the original file was there.
Example:
: tree movies/
movies/
├── subfolder1
│ └── movie1.mp4
├── subfolder2
│ └── movie2.mp4
└── subfolder3
└── movie3.mp4
And so on.
I want the output to be the same as my main structure but in .m3u8 format.
I have used a code where it can convert each movie manually but for some reason, I can use the .m3u8 file or link only in that server I can't make it work all over the internet.
for i in .mp4; do
ffmpeg -i "$i" -c copy -map 0 -hls_time 3 -hls_list_size 0 -f hls "${i%.}.hls"
done
Thanks