Added a support for kinoukr.tv website.
My Toshibe TV is very old and it has really slow fast-forward for long movies. But it has chapters flow, so I can switch them.
Chapters could be added with ffmpeg within META file.
To export meta use
ffmpeg -y -i movie.mp4 -f ffmetadata METAFILE
Then I've created a script to add a chapter every 10 minutes.
Here's the source code
#/usr/bin/env bash
args=("$@")
FILE_MOVIE=${args[0]}
FILE_META=${args[1]}
if [[ -z "$FILE_MOVIE" ]]; then
echo "No movie file.".
exit
fi
if [[ -z "$FILE_META" ]]; then
echo "No meta file".
exit
fi
MOVIE_LENGTH=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$FILE_MOVIE")
MOVIE_LENGTH="${MOVIE_LENGTH%.*}"
MOVIE_LENGTH=$((MOVIE_LENGTH - 600))
if [[ "MOVIE_LENGTH" -lt 600 ]]; then
"Movie too short. No chapters needed."
exit
fi
COUNTER=1
echo -e "\n\n" >> $FILE_META
for (( i=0;i<$(($MOVIE_LENGTH));i+=600)); do
START=$((i * 1000))
END=$(((i+600)*1000 - 1))
echo -e "[CHAPTER]\nTIMEBASE=1/1000\nSTART=$START\nEND=$END\ntitle=Chapter $COUNTER\n" >> $FILE_META
COUNTER=$((COUNTER+1))
done
Then movie should be processed again with edited METAFILE file.
ffmpeg -hide_banner -y -i movie.mp4 -i METAFILE -map_metadata 1 -codec copy movie-with-chapters.mp4"
Full code available in the repo: