Skip to content

Instantly share code, notes, and snippets.

@adminy
Last active August 15, 2020 16:32
Show Gist options
  • Save adminy/a89af9538677db57f556d15894eb1972 to your computer and use it in GitHub Desktop.
Save adminy/a89af9538677db57f556d15894eb1972 to your computer and use it in GitHub Desktop.
#Ref: https://stackoverflow.com/questions/169511/how-do-i-iterate-over-a-range-of-numbers-defined-by-variables-in-bash
#Ref: https://stackoverflow.com/questions/30384634/how-to-split-a-video-into-individual-encoded-frames
#Ref: https://superuser.com/questions/678897/extract-hevc-bitstream-with-ffmpeg
input="newvideo8bit.mp4"
outDir="out3"
output="magic.h265"
rm -rf $outDir
mkdir $outDir
ffmpeg -i $input -f image2 -vcodec copy -bsf hevc_mp4toannexb $outDir/%d.h265
END=249
rm -rf $output
touch $output
for ((i=1;i<=END;i++)); do
cat $outDir/$i.h265 >> $output
done
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment