meta

what's the meta about say it ditto dot net?

User Tools

Site Tools


cheatsheet:ffmpeg

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cheatsheet:ffmpeg [2025/08/16 02:11] melocheatsheet:ffmpeg [2025/08/16 02:26] (current) melo
Line 4: Line 4:
  
 [[https://cheat-sheets.org/project/tldr/command/ffmpeg/|ffmpeg TLDR]], [[http://cheat.sh/ffmpeg|ffmpeg cheat.sh]] [[https://cheat-sheets.org/project/tldr/command/ffmpeg/|ffmpeg TLDR]], [[http://cheat.sh/ffmpeg|ffmpeg cheat.sh]]
 +
 +==== audio ====
 +
 +=== FLAC to MP3 ===
 +
 +one-off:
 +
 +<code bash>
 +ffmpeg -i "$FILE.flac" -ab 320k -map_metadata 0 -id3v2_version 3 "$FILE.mp3"
 +</code>
 +
 +bash loop:
 +
 +<code bash>
 +for f in *.flac; do ffmpeg -i "$f" -ab 320k -map_metadata 0 -id3v2_version 3 "${f%.*}.mp3"; done
 +</code>
  
 ==== video to frames ==== ==== video to frames ====
Line 35: Line 51:
 <code bash> <code bash>
 ffmpeg -i "$FILE.mp4" -c:v libx265 -vtag hvc1 -crf 18 -c:a copy -c:s copy "$FILE.mkv" ffmpeg -i "$FILE.mp4" -c:v libx265 -vtag hvc1 -crf 18 -c:a copy -c:s copy "$FILE.mkv"
 +</code>
 +
 +=== x265 (HEVC), GPU, bash loop ===
 +
 +<code bash>
 +for f in *.mkv; do ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i "$f" -c:v hevc_nvenc -vtag hvc1 -profile main -preset slow -rc vbr_hq -c:a copy -c:s copy -map 0 "${f%.*} HEVC.mkv"; done
 +</code>
 +
 +=== AVI/DivX/XviD to MKV, bash loop ===
 +
 +<code bash>
 +for f in *.avi; do ffmpeg -fflags +genpts -i "$f" -c:v copy -c:a copy -c:s copy "${f%.*} AVI2MKV.mkv"; done
 +</code>
 +
 +=== copy video, remove audio, bash loop ===
 +
 +<code bash>
 +for f in *.mp4; do ffmpeg -i "$f" -vcodec copy -an "${f%.mp4}_noaudio.mp4"; done
 +</code>
 +
 +=== camcorder sources ===
 +
 +GPU accelerated camcorder source MPEG+AC3+VOBSUB to x264+AC3+VOBSUB (little to no file size reduction, for web uploads)
 +
 +<code bash>
 +ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -extra_hw_frames 10 -i "input.mkv" -c:a copy -c:v h264_nvenc -c:s copy -b:v 5M "output.mkv"
 </code> </code>
cheatsheet/ffmpeg.1755310308.txt.gz · Last modified: by melo