Making a Video out of an Image and Audio
I use this one if I want to archive audio on YouTube. I create an image (generally with ImageMagick) and then I run this FFMPEG command (can be translated to AVCONV by simply replacing the command, as most of these can.)
Where image.jpg is the image, audio.wav is the audio (it doesn't have to be WAV), and out.mp4 is where it's going.
ffmpeg -f concat -i concat.txt -safe 0 -c copy out.mp4
Prints all mp4 files as a concat list then concatenate them without transcoding. I find this especially useful when my camera breaks large files up into smaller recordings because of filesystem limitations.
Concatenate Things
ls -1 *.mp4 | awk '{print "file \47"$1"\47"}' > concat.txtffmpeg -f concat -i concat.txt -safe 0 -c copy out.mp4
Prints all mp4 files as a concat list then concatenate them without transcoding. I find this especially useful when my camera breaks large files up into smaller recordings because of filesystem limitations.
Recursively Transcode Files
It turns out I transcode a lot of media. Mainly I just try to convert things into HEVC format so it takes less space. But usually I want to do it in a folder automatically. So I use the following command:
find . -iname '*.avi' -exec sh -c 'ffmpeg -i "$1" -c:v libx265 -preset medium -crf 22 "${1%.avi}.mkv"' sh {} \;
find . -iname '*.mkv' -exec sh -c 'ffmpeg -i "$1" -c:v libx265 -preset medium -crf 22 "${1%.mkv}.mkv"' sh {} \;
shopt -s extglob
rm ./**/!(*265.mkv)
Which removes all files that do not end with "265.mkv".
Create a Timelapse From Sequenced Photos
I usually make timelapses with my GoPro camera, and I take enough pictures at a reasonable enough rate that I can usually make 60fps timelapses. I can do it at 4k, but that doesn't mean my computer always enjoys playing it back at full quality. Here's a 60fps example at 1080p:
ffmpeg -r 60 -start_number 1 -i GOPR%04d.JPG -s 1920x1080 -vcodec libx264 timelapse.mp4
This should create a decent quality starting from picture #1. You can change the start number to whatever you need it to be.
That's about all I have for this time. I hope to do something with either Calvin or the laptop. Maybe some day. Who knows? I'm sick and tired of writing filler pieces.
No comments:
Post a Comment