Created
November 2, 2025 01:12
-
-
Save kuntau/8407db2293d43c5469efb1a834dc5b48 to your computer and use it in GitHub Desktop.
Convert all FLV files in a folder to MP4 using ffmpeg with hardware acceleration (VideoToolbox), matching each file’s original bitrate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # `-tag:v hvc1` to make sure we can use Quick Look and generate videos thumbnail | |
| for f in *.flv; do ffmpeg -hwaccel videotoolbox -i "$f" -c:v hevc_videotoolbox -tag:v hvc1 -b:v $(ffprobe -v error -select_streams v:0 -show_entries stream=bit_rate -of csv=p=0 "$f") -c:a copy "${f%.flv}.mp4"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment