Skip to content

Instantly share code, notes, and snippets.

@anton-rudeshko
Last active October 17, 2020 01:01
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save anton-rudeshko/1e2c8bed012608c49094 to your computer and use it in GitHub Desktop.
Save anton-rudeshko/1e2c8bed012608c49094 to your computer and use it in GitHub Desktop.
Convert GoPro photos to timelapse video using ffmpeg CLI.
#!/usr/bin/env bash
# -r 60: 60 FPS
# -y: rewrite output file
# -start_number 11555: first frame number
# -i 'G%07d.JPG': file format
# -vf "crop=h=2250": video filter to crop input frame height from 3000 to 2250 (which will be eventually downscaled to 720)
# -c:v libx264: video codec x264
# -crf 20: x264 encoding quality (less = better)
# -s 1280x720: output size
ffmpeg -r 60 -y -start_number 11555 -i 'G%07d.JPG' -vf "crop=h=2250" -c:v libx264 -crf 20 -s 1280x720 output.avi

Some tips on converting VHS to digital.

Software

  • K-Lite Mega Codec Pack
  • VirtualDub (32-bit version is preferable because of better compatibility)
  • LAME MP3 Encoder
  • macOs: brew install ffmpeg

Hardware

  • SONY SLV-SE620
  • EzCap as USB 2861 (DirectShow)
  • SCART-3RCA cable (switch to OUT on SCART end)

Audio capture settings

  • Check Audio → Enable audio capture
  • Uncheck Audio → Enable audio playback. Audio playback may significally slowdown your video capture rate
  • Adjust raw audio capture rate to something like 48 KHz 16 bit per second.

Video capture

Video processing

x264 settings

Preset: medium Tune for film Check Zero latency and VirtualDub hack

Filters

If your PC is quite powerful you can deinterlace on the fly.

Postprocessing

How to cut into clips

Check Direct stream copy in Video and Audio, select needed range and then run Save as AVI…

Sync audio & video

Go to Audio → Interleaving… (Ctrl+I) and set Delay to appropriate value.

@Ivaylo-Bachvarov
Copy link

🍺 This saved me a lot of time!

@herculosh
Copy link

This code snippet was very helpful. Thanks a lot. There is only to note that the conversion for mac doesn't quite work that way. The files are not readable after creation.
Adding the parameter -pix_fmt yuv420p solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment