我有直播任何视频的代码,但我不知道如何生活1个文件夹有几个视频。
ffmpeg -re -stream_loop -1 -i "1.mp4" -vcodec libx264 -preset veryfast -maxrate 2000k -bufsize 1000k -vf “scale=1280:720,format=yuv420p” -g 50 -acodec libmp3lame -b:a 128k -ac 2 -ar 44100 -f flv rtmp://a.rtmp.youtube.com/live2/*****
答案 0 :(得分:0)
试试此代码
dir/b/s "C:\FFMPEG\bin\in\*.mp4" > list.txt
:encode video
:loop
for /F "delims=;" %%F in (list.txt) DO ffmpeg -re -i "%%F" -vcodec libx264 -preset veryfast -maxrate 2500k -bufsize 3368k -vf "format=yuv420p" -g 60 -acodec libmp3lame -b:a 198k -ar 44100 -metadata title="" -metadata artist="" -metadata album_artist="" -metadata album="" -metadata date="" -metadata track="" -metadata genre="" -metadata publisher="" -metadata encoded_by="" -metadata copyright="" -metadata composer="" -metadata performer="" -metadata TIT1="" -metadata TIT3="" -metadata disc="" -metadata TKEY="" -metadata TBPM="" -metadata language="eng" -metadata encoder="" -f flv -s 1280x720 rtmp://a.rtmp.youtube.com/live2/xxxxx
goto loop