Last active
April 15, 2024 08:35
-
-
Save robinfang/1d765e4a60145ac0aeea50145aa1c4e2 to your computer and use it in GitHub Desktop.
ffmpeg压缩视频,调用显卡
This file contains 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
ffmpeg -hwaccel cuvid -i meeting.mp4 -c:v h264_nvenc -crf 24 meeting_compressed.mp4 |
This file contains 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
ffmpeg -y -vsync 0 -hwaccel cuvid -i a.MOV -c:v h264_nvenc -b:v 2M -vf scale_cuda=format=yuv420p a.mp4 |
This file contains 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
ffmpeg -i input.m4v -map_metadata 0 -metadata:s:v rotate="180" -codec copy output.m4v |
This file contains 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
@echo off | |
pushd "%~dp0" | |
for %%I in (%*) do ( | |
ffmpeg -y -hwaccel cuvid -i "%%~fI" -c:v h264_nvenc -b:v 2M -vf scale_cuda=-2:720:format=yuv420p,fps=30 "%%~dpnI_c.mp4" | |
) | |
pause |
This file contains 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
@echo off | |
pushd "%~dp0" | |
for %%I in (%*) do ( | |
ffmpeg -y -hwaccel cuvid -hwaccel_output_format cuda -noautorotate -i "%%~fI" -c:v h264_nvenc -b:v 4M -vf scale_cuda=format=yuv420p "%%~dpnI_c.mp4" | |
) |
This file contains 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
@echo off | |
pushd "%~dp0" | |
for %%I in (%*) do ( | |
ffmpeg -y -vsync 0 -hwaccel cuvid -i "%%~fI" -c:v h264_nvenc -b:v 3M -vf scale_cuda=format=yuv420p "%%~dpnI_c.mp4" | |
) |
This file contains 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
@echo off | |
pushd "%~dp0" | |
for %%I in (%*) do ( | |
ffmpeg -y -vsync 0 -hwaccel cuvid -hwaccel_output_format cuda -noautorotate -i "%%~fI" -c:v h264_nvenc -b:v 3M -vf scale_cuda=format=yuv420p -filter:v fps=30 "%%~dpnI_c.mp4" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ffmpeg下载(建议下载master full版本):
https://www.gyan.dev/ffmpeg/builds/
另外需要一块NVIDIA显卡,升级到最新驱动