![]() ![]() Start_keyframe_time=`$KEYFRAMER "$file" "$start_time"`Įcho "Nearest keyframe to \"$start_time\" is \"$start_keyframe_time\""Įcho "ffmpeg -loglevel quiet -y -i \"$file\" -ss $start_keyframe_time -t 00:00:10 \"$outfile\""įfmpeg -loglevel quiet -y -i "$file" -ss $start_keyframe_time -t 00:00:10 "$outfile"Įcho "ffmpeg returned an error on, aborting"Įcho "ffprobe found no suitable key-frame near \"$start_time\""įfmpeg -f concat -i cut_list.txt -c copy all_cuts.mp4Īnd the random time, in python: #! /usr/bin/env python3 # Find the next keyframe, at or after the random time So to do this in bash, assuming there exists some program randtime.py which outputs a random starting time in 'H:MM:SS' format, and some other program which finds the video keyframe near a given time, here's a quick hack-version: #! /usr/bin/env bash ![]() I extensively edited this code to first find the key-frames, then cut around this. EDIT: Cutting video with ffmpeg needs to be done on a key-frame. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |