0

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.

  • You haven't set an output format! What's going to consume stdout from ffmpeg, and which formats does it understand? – Gyan Dec 13 '17 at 10:21
  • Sorry; I copied the wrong ffmpeg command, i have force mp4 (`-f mp4`) as an output parameter also. i had taken it off to see if it was my tcp client that did not read correctly, but not even en error message from ffmpeg. – Mikkel Bachmann Dec 13 '17 at 10:33
  • My Stream server in the the other end of the TCP Socket understands mp4/h264 and MJPEG – Mikkel Bachmann Dec 13 '17 at 10:50
  • Normally ffmpeg won't write mp4 to a pipe as it is not seekable. But that can be overcome. Share full log. – Gyan Dec 13 '17 at 11:16
  • @Mulvya As I told in my message ffmpeg won't write any thing. that goes for logs, error message or any other info. not even if i set loglevel to debug, so sadly i can't give you a log. I know i can write mp4 to pipe:1 it works if i use a file is input so that is not my problem. My problem is the force rawvideo somehow blocks stdout and stderr – Mikkel Bachmann Dec 13 '17 at 11:37
  • Add `-report` and see if a logfile is created. – Gyan Dec 13 '17 at 11:43
  • `ffmpeg started on 2017-12-13 at 12:44:15 | Report written to "ffmpeg-20171213-124415.log` is the only 2 lines in the report. – Mikkel Bachmann Dec 13 '17 at 11:47
  • Add `-nostdin` and try again. – Gyan Dec 13 '17 at 11:49

1 Answers1

0

I have have slowed my problem on my own. (-:

i now have 2 solutions.

  1. Is to change my -f rawvideo to -f data that works for me anyways.
  2. 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