Discussion:
[MPlayer-users] pipe /dev/video0 to fifo
Peter Irbizon
2016-06-09 08:11:44 UTC
Permalink
Hello,
I am trying to pipe /dev/video0 to out.raw and then immediately read it in
omxplayer. But I am getting no picture in omxplayer (I tried the same with
mplayer out.raw -> Playing out.raw but no picture shown)

My commands:
mkfifo out.raw
mplayer tv:///dev/video0 -dumpstream -dumpfile out.raw &
omxplayer out.raw

Any idea why I am not getting picture?
Peter White
2016-06-09 18:26:12 UTC
Permalink
Post by Peter Irbizon
mkfifo out.raw
mplayer tv:///dev/video0 -dumpstream -dumpfile out.raw &
omxplayer out.raw
Any idea why I am not getting picture?
What happens if you just run the following?

$ mplayer tv:///dev/video0

Do you get a picture then?
Peter Irbizon
2016-06-10 06:46:21 UTC
Permalink
Yes, I am getting picture.
Post by Peter White
Post by Peter Irbizon
mkfifo out.raw
mplayer tv:///dev/video0 -dumpstream -dumpfile out.raw &
omxplayer out.raw
Any idea why I am not getting picture?
What happens if you just run the following?
$ mplayer tv:///dev/video0
Do you get a picture then?
_______________________________________________
MPlayer-users mailing list
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
Peter White
2016-06-10 08:37:23 UTC
Permalink
Post by Peter Irbizon
Yes, I am getting picture.
Again, I ask you kindly not to top-post. Inline replies are preferred.
See for example, now I don't know if you are getting picture in
/general/ or by running the /specific/ command.
Post by Peter Irbizon
Post by Peter White
Post by Peter Irbizon
mkfifo out.raw
mplayer tv:///dev/video0 -dumpstream -dumpfile out.raw &
omxplayer out.raw
Any idea why I am not getting picture?
What happens if you just run the following?
$ mplayer tv:///dev/video0
Did you run this command and get a picture? If so, what happens if you
play out.raw with mplayer itself? Maybe the problem is with omxplayer.

Or, for the time being, make it as simple as possible by dumping the
stream to a regular file instead of a FIFO:

$ mplayer tv:///dev/video0 -dumpstream -dumpfile test_output.raw -endpos 10

This gives you a test_output.raw of about 10 seconds length which
should be playable by mplayer.

If anything of the above does not work provide more info, please. Like
the full output of mplayer commands with the -v option added. Include
as much information as possible.
Peter Irbizon
2016-06-11 13:21:46 UTC
Permalink
Post by Peter White
Post by Peter Irbizon
Yes, I am getting picture.
Again, I ask you kindly not to top-post. Inline replies are preferred.
See for example, now I don't know if you are getting picture in
/general/ or by running the /specific/ command.
I am sorry, now I found out what is top-post. I will try to answer inline.
I am getting picture in general ok.
Post by Peter White
Post by Peter Irbizon
Post by Peter White
Post by Peter Irbizon
mkfifo out.raw
mplayer tv:///dev/video0 -dumpstream -dumpfile out.raw &
omxplayer out.raw
Any idea why I am not getting picture?
What happens if you just run the following?
$ mplayer tv:///dev/video0
Did you run this command and get a picture? If so, what happens if you
play out.raw with mplayer itself? Maybe the problem is with omxplayer.
when I run $ mplayer tv:///dev/video0 I get picture ok. And with other
commands like "mplayer tv:// -tv driver=v4l2:norm=PAL:device=/dev/video0
-hardframedrop" too.
Post by Peter White
Or, for the time being, make it as simple as possible by dumping the
$ mplayer tv:///dev/video0 -dumpstream -dumpfile test_output.raw -endpos 10
This gives you a test_output.raw of about 10 seconds length which
should be playable by mplayer.
This gives me just 0 byte file and closes mplayer immediatelly.
Post by Peter White
If anything of the above does not work provide more info, please. Like
the full output of mplayer commands with the -v option added. Include
as much information as possible.
Peter White
2016-06-11 14:20:27 UTC
Permalink
Post by Peter Irbizon
when I run $ mplayer tv:///dev/video0 I get picture ok. And with
other commands like "mplayer tv:// -tv
driver=v4l2:norm=PAL:device=/dev/video0 -hardframedrop" too.
All right, so mplayer can play it. Check.
Post by Peter Irbizon
Post by Peter White
$ mplayer tv:///dev/video0 -dumpstream -dumpfile test_output.raw -endpos 10
This gives me just 0 byte file and closes mplayer immediatelly.
So there is the culprit. Apparently, mplayer does not like to dump a
stream from v4l2-devices. Searching the man page for dumpstream
reveals:

"-capture [...]
... Same as for -dumpstream, this will likely not produce
usable results for anything else than MPEG streams. ..."

Maybe there is nothing that can be done, for now. It might be a bug in
mplayer, or a "feature" judging by this statement. If you think it is
a bug that needs fixing, I suggest filing a report:
https://www.mplayerhq.hu/MPlayer/DOCS/HTML/en/bugreports.html

But, maybe there are other options outside of using mplayer. Certainly,
these would be off-topic for this list, but at least there are some.
Someone in the Pi-community seems to have faced the same problem:

https://www.raspberrypi.org/forums/viewtopic.php?f=35&t=69322

The last reply suggests cvlc could be a solution, only the script
needed adjusting.

Also, ffmpeg comes to mind:
https://www.ffmpeg.org/ffmpeg-devices.html#video4linux2_002c-v4l2

But that is as far off-topic as I am willing to go. :)

Loading...