FFMPEG在一个命令行中将图像组合到视频和流媒体 [英] FFMPEG Combining images to video and streaming in one command line
问题描述
目前,使用ffmpeg,我在我的终端上使用两个命令:
Currently, using ffmpeg, I am using two commands on my Terminal to:
1)从一堆图像创建视频:
1) create a video from a bunch of images:
ffmpeg -r 60 -f image2 -s 1920x1080 -i rotate-pano_frame%05d_color_corrected_gradblend.jpg -vcodec libx264 -crf 25 -pix_fmt yuv420p test.mp4
2)将视频流传输到udp地址:
2) stream the video to a udp address:
ffmpeg -re -i test.mp4 -c copy -f flv udp://127.0.0.1:48550
如何将这两个命令组合成一个单独的ffmpeg命令?
How can I combine these two commands, into one single ffmpeg command?
我担心的是,需要几分钟时间从图像生成视频。因此,这些命令必须顺序发生,第二个命令等待几分钟才能完成第一个命令。
A concern I have is that it takes a couple of minutes to generate the video from the images. Therefore, these commands have to happen serially, whereby the second command waits a few minutes for the first command to be completed, before it ensues.
推荐答案
只需添加&&两个命令之间。如果第一个执行成功,这将执行第二个命令。
Just add && between the two commands. This will execute the second command if the first executes successfully.
ffmpeg -r 60 -f image2 -s 1920x1080 -i rotated-pano_frame%05d_color_corrected_gradblend.jpg -vcodec libx264 -crf 25 -pix_fmt yuv420p test.mp4 && ffmpeg -re -i test.mp4 -c copy -f flv udp://127.0.0.1:48550
这篇关于FFMPEG在一个命令行中将图像组合到视频和流媒体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!