问题
I have a dummy client that is suppose to simulate a video recorder, on this client i want to simulate a video stream; I have gotten so far that i can create a video from bitmap images that i create in code.
The dummy client is a nodejs application running on an Raspberry Pi 3 with the latest version of raspian lite.
In order to use the video I have created, I need to get ffmpeg to dump the video to pipe:1. The problem is that I need the -f rawvideo
as a input parameter, else ffmpeg can't understand my video, but when i have that parameter set ffmpeg refuses to write anything to stdio
ffmpeg is running with these parameters
ffmpeg -r 15 -f rawvideo -s 3840x2160 -pixel_format rgba -i pipe:0 -r 15 -vcodec h264 pipe:1
Can anybody help with a solution to my problem?
--Edit
Maybe i sould explain a bit more. The system i am creating is to be set up in a way, where instead of my stream server ask the video recorder for a video stream, it will be the recorder that tells the server that there is a stream.
回答1:
I have have slowed my problem on my own. (-:
i now have 2 solutions.
- Is to change my
-f rawvideo
to-f data
that works for me anyways. - I can encode my bitmaps as jpeg in code and pipe my jpeg images to stdin. This also requires me to change the ffmpeg parameters to
-r 4 -f mjpeg -i pipe:0 -r 4 -vcodec copy -f mjpeg pipe:1
and is by far the slowest thing i have ever done. and i can't use a 4k input
thanks @Mulvya for trying to help.
@eFox Thanks for editing my stupid spelling and grammar mistakes
来源:https://stackoverflow.com/questions/47790255/no-data-written-to-stdin-or-stderr-from-ffmpeg