2023-07-20, 10:07 AM
I literally just had to deal with this issue too. If you use ffmpeg you can do this:
Get timecodes for all the chapters
ffprobe -i input.mkv -show_chapters > chapters.txt
Note the start_time and end_time for each chapter/episode
Make and run a .bat file for ffmpeg to create individual videos based on the timecodes, using -ss for the start time and -to for the end time
For example:
ffmpeg -i input.mkv -c:v libx264 -c:a aac -map 0:v:0 -map 0:a:0 -map_chapters -1 -sn -ss 0 -to 1310.32 "S01E01.mp4" -c:v libx264 -c:a aac -map 0:v:0 -map 0:a:0 -map_chapters -1 -sn -ss 1310.32 -to 2628.2 "S01E02.mp4" -c:v libx264 -c:a aac -map 0:v:0 -map 0:a:0 -map_chapters -1 -sn -ss 2628.2 -to 3940.92 "S01E03.mp4"
Get timecodes for all the chapters
ffprobe -i input.mkv -show_chapters > chapters.txt
Note the start_time and end_time for each chapter/episode
Make and run a .bat file for ffmpeg to create individual videos based on the timecodes, using -ss for the start time and -to for the end time
For example:
ffmpeg -i input.mkv -c:v libx264 -c:a aac -map 0:v:0 -map 0:a:0 -map_chapters -1 -sn -ss 0 -to 1310.32 "S01E01.mp4" -c:v libx264 -c:a aac -map 0:v:0 -map 0:a:0 -map_chapters -1 -sn -ss 1310.32 -to 2628.2 "S01E02.mp4" -c:v libx264 -c:a aac -map 0:v:0 -map 0:a:0 -map_chapters -1 -sn -ss 2628.2 -to 3940.92 "S01E03.mp4"