Skip to content

Instantly share code, notes, and snippets.

@tapscodes
Created July 14, 2025 11:36
Show Gist options
  • Select an option

  • Save tapscodes/876f6e6630fce39cf79a1aa9e7d8c35a to your computer and use it in GitHub Desktop.

Select an option

Save tapscodes/876f6e6630fce39cf79a1aa9e7d8c35a to your computer and use it in GitHub Desktop.
Useful FFMPEG Commands

1080p to 4k Video NVidia Accelerated

Change input.mp4 to your input file (can be different extension) and output to the whatever output name you want. Won't increase video quality, just useful to upscale 1080p to 4k quickly so YouTube encodes your video better.

ffmpeg -hwaccel cuda -i input.mp4 -vf "scale=3840:2160" -c:v h264_nvenc -preset p3 -rc vbr -cq 19 -b:v 0 -c:a aac -b:a 192k -movflags +faststart output.mp4

Phone MP4 To Resolve Mov Converter

Phones often record audio in a way that Davinci Resolve disagrees with. This conversion command fixes that for you. It's a for loop that converts all .mp4 files in your folder to a PCM_s16 .mov that Resolve reads properly while maintaining data integrity.

for f in *.mp4; do ffmpeg -i "$f" -c:v copy -c:a pcm_s16le "${f%.mp4}_resolve.mov"; done

Mp3 to 16 bit 48000Hz FLAC

Not reccomended as this can possibly make audio quality worse, but some tools only work with FLAC files and this will batch convert all .mp3 files in a folder to 16 bit, 48000Hz FLAC files (48000Hz instead of 44100Hz for quicker reading speeds on modern devices)

find . -name "*.mp3" -print0 | while IFS= read -r -d '' f; do ffmpeg -i "$f" -ar 48000 -sample_fmt s16 "${f%.mp3}.flac"; done

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