Skip to content

Instantly share code, notes, and snippets.

@f2face
Last active September 11, 2022 23:51
Show Gist options
  • Save f2face/4f7399286466f035a072a7f2e7841aa9 to your computer and use it in GitHub Desktop.
Save f2face/4f7399286466f035a072a7f2e7841aa9 to your computer and use it in GitHub Desktop.
FFmpeg commands for video concatenating/transcoding. Works fine for SHOWROOM & TikTok Live. [Windows]
:: Concat files.
:: Usage example: concat list.txt output.mp4
set input=%1
set output=%2
ffmpeg -f concat -safe 0 -i %input% -c copy %output%
:: List .ts files and put the filenames in a file.
:: Usage example: listfiles keyword list.txt
set find=%1
set output=%2
:: dir /b | findstr %find% > %output%
(for %%i in (*%find%*) do @echo file '%%i') > %output%
:: Upscale video to 1080p horizontal.
:: Usage example: upscale1080h video_input.mp4
set file=%1
ffmpeg -i %file% -vf scale=1920x1080:flags=lanczos -c:v libx264 -preset ultrafast -crf 25 %file%_upscaled_1080p_h.mp4
:: Upscale video to 1080p vertical.
:: Usage example: upscale1080v video_input.mp4
set file=%1
ffmpeg -i %file% -vf scale=1080x1920:flags=lanczos -c:v libx264 -preset ultrafast -crf 25 %file%_upscaled_1080p_v.mp4
:: Upscale video to 720p horizontal.
:: Usage example: upscale720h video_input.mp4
set file=%1
ffmpeg -i %file% -vf scale=1280x720:flags=lanczos -c:v libx264 -preset ultrafast -crf 25 %file%_upscaled_720p_h.mp4
:: Upscale video to 720p vertical.
:: Usage example: upscale720v video_input.mp4
set file=%1
ffmpeg -i %file% -vf scale=720x1280:flags=lanczos -c:v libx264 -preset ultrafast -crf 25 %file%_upscaled_720p_v.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment