A list of useful ffmpeg commands
ffprobe video.mp4
ffmpeg -c:v libx265 -c:a copy -i input.mp4 out.mp4
IMO, HEVC is so far (2020-04-15) the best codec for video. Very good compression rate and encoding performance.
WebM has a lot of limitations. I have not find a performant way to encode to WebM with FFmpeg.
ffmpeg -vf scale=-1:720 -c:a copy -i input.mp4 out.mp4
-1
means it will automatically calculate the output width with the source ratio.
ffmpeg -ss 00:00:15 -i input.mp4 -codec copy out.mp4
The order of -ss
actually matters (surprise!). It seems one uses the closest frame before the encoding, another uses the frame after the encoding.
ffmpeg -i input.mp4 -codec copy -t 15 out.mp4
-c:a copy
: copy the audio stream-an
: ignore the audio stream
function concat-gopro-video -d 'Concat all GoPro video files in the folder'
set files (ls GX*.MP4)
rm files.txt
for file in $files
echo "file '$file'" >> files.txt
end
cat files.txt
sleep 1
ffmpeg -f concat -safe 0 -i files.txt -c copy $argv[1]
log info "Complete concat video '$argv[1]'"
end
file 'video1.mp4'
file 'video2.mp4'