[FFmpeg-user] Remove chapters when cutting a part out of a video
Cecil Westerhof
Cecil at decebal.nl
Wed Sep 7 20:55:15 EEST 2022
Cecil Westerhof via ffmpeg-user <ffmpeg-user at ffmpeg.org> writes:
> Cecil Westerhof via ffmpeg-user <ffmpeg-user at ffmpeg.org> writes:
>
>> I need to cut a part out of a video. This video contains chapters and
>> I want to remove this data. I try this with:
>> ffmpeg -y \
>> -ss ${startTime} -to ${endTime} \
>> -i ${inputFile} \
>> -map_metadata -1 \
>> -fflags +bitexact \
>> -acodec copy -vcodec copy \
>> -avoid_negative_ts 1 \
>> ${outputFile}
>>
>> But this only removes the name of the chapters. They all become
>> unnamed. And the chapters are not even part of what I cut out of the
>> video.
>> What do I need to do to get a video without chapters?
>
> Found it:
> ffmpeg -y \
> -ss ${startTime} -to ${endTime} \
> -i ${inputFile} \
> -map_metadata -1 \
> -map_chapters -1 \
> -acodec copy -vcodec copy \
> -avoid_negative_ts 1 \
> ${outputFile}
The following is a little bit better:
ffmpeg -y \
-ss ${startTime} \
-to ${endTime} \
-i ${inputFile} \
-map_metadata -1 \
-map_chapters -1 \
-metadata title="${title}" \
-acodec copy \
-vcodec libx264 -crf 26 \
-pix_fmt yuv420p \
-preset veryfast \
${outputFile}
Some people could not play it and I also wanted to add a title.
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
More information about the ffmpeg-user
mailing list