Creating Video and Streaming Command Line
Asked Answered
G

1

0

Currently, using ffmpeg, I am using two commands on my Terminal to:

1) create a video from a bunch of images:

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

2) stream the video to a udp address:

ffmpeg -re -i test.mp4 -c copy -f flv udp://127.0.0.1:48550

I am trying to combine both these instructions into one command line instruction, using &&, as suggested in the answer to a previous question of mine:

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

but am encountering an error which prevents streaming:

[flv @ 0x7fa2ba800000] video stream discovered after head already parsed.

Thoughts on a different command line syntax to join the two instructions, different ffmpeg instruction (filters perhaps?), and why I am getting the error?

Garganey answered 17/7, 2017 at 9:59 Comment(5)
This looks like more of an ffmpeg issue than a bash one. Try video.stackexchange.com/questions/20094/…Triclinium
Do you need to create the file on disk?Disavow
Possible cross-site duplicate: video.stackexchange.com/questions/20094/…Latreese
Why do you use UDP instead of RTP? @Brindha KanniahRiant
For a faster transmission rate as the receiving client doesn´t check for transmission errors with UDP. @SalihKaragozGarganey
J
0

The two commands are running sequentially using &&, meaning the first command finishes execution before the second one starts. This can cause a problem with streaming when the second command is not able to properly detect the video stream header.

ffmpeg -r 60 -f image2 -s 1920x1080 -i rotated-pano_frame%05d_color_corrected_gradblend.jpg -vcodec libx264 -crf 25 -pix_fmt yuv420p -f flv udp://127.0.0.1:48550
Jahn answered 31/7 at 7:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.