SergCoder
Posts: 8
Joined: Mon Mar 31, 2014 12:46 pm

How to play raw video from console?

Fri Dec 28, 2018 5:23 pm

Hello everyone.
In one part of my university project I need to play video file (stream) on Raspberry pi from console. Seems to be easy task thanks to hello_video utility or omxplayer.
But the problem is file format - it's a raw video, raspberry pi don't even need to decode it.
But hello_video plays only h264 encoded format and omxplayer wants some codec too :(

Is it possible to play such format from console without using X desktop?

P.S. Format string from mplayer "Video: I420 320x240 6640kbps [V: rawvideo, yuv420p, 320x240, 6640 kb/s]"

Thank you!

User avatar
topguy
Posts: 6054
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: How to play raw video from console?

Wed Jan 02, 2019 1:21 pm

- You could use ffmpeg/avconv to transcode the stream to something omxplayer can play.

- mplayer/mpv has support for a lot of different output devices ( "-vo caca" is always fun ;) )
"mpv --vo=help" should give a list.

User avatar
rpiMike
Posts: 1052
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: How to play raw video from console?

Wed Jan 02, 2019 1:24 pm

This should do it :

viewtopic.php?f=38&t=199775

SergCoder
Posts: 8
Joined: Mon Mar 31, 2014 12:46 pm

Re: How to play raw video from console?

Fri Jan 11, 2019 7:00 am

Thank you!
Compiled mpv/ffmpeg on RPi3 like described in guide and mpv really plays this raw video from console pretty good.

Now I'm trying to do same thing on compact RPi Zero, but have not succeeded yet - can't just move compiled files and libraries from RPi3 to Pi Zero, because of different processor. And can't compile with script from that guide - for some reason, the process of downloading the files hangs at the end :( Trying to solve a problem

SergCoder
Posts: 8
Joined: Mon Mar 31, 2014 12:46 pm

Re: How to play raw video from console?

Wed Jan 16, 2019 10:25 am

Compiled on RPi3 for Pi Zero like described in thread:
if you'd like to use this on a pi zero change your compile flags to

Code: Select all

 --extra-cflags="-march=armv6zk -mfloat-abi=hard -mfpu=vfp"
Now it works good. Thanks again!

User avatar
RPi_Mike
Posts: 200
Joined: Sat Dec 09, 2017 12:57 am
Location: United States

Re: How to play raw video from console?

Wed Jan 16, 2019 8:03 pm

SergCoder wrote:
Fri Jan 11, 2019 7:00 am
Thank you!
Compiled mpv/ffmpeg on RPi3 like described in guide and mpv really plays this raw video from console pretty good.

Glad to hear my tutorial and script worked well on your Raspberry Pi 3!



SergCoder wrote:
Wed Jan 16, 2019 10:25 am
Compiled on RPi3 for Pi Zero like described in thread..... Now it works good. Thanks again!

Although my script was never written for the Pi Zero – a bare-bones model I don't even own – I'm still pleased that modifying a single line appears to be all it takes to get it working. As you mentioned, that topic was covered in this post on my thread.

And yes – running my script on the much faster 4-core Raspberry Pi 3 – even though the software packages it creates may be intended for installation on the 1-core Pi Zero – certainly sounds like a good strategy to dramatically speed up the compiling. Once you have my pre-built packages, it's very easy to install them on another Raspberry. In fact, I described the procedure in Appendix 8 of my tutorial. It only takes a few minutes!

NOTE #1: As mentioned, I don't even own a Pi Zero – nor is it an interest of mine – so I have not personally tested any of these claims.

NOTE #2: Even though I greatly appreciate rpiMike's recommendation of my script, I can assure you that his endorsement had absolutely nothing to do with me! We don't know each other and our extremely similar screen names are a total coincidence!

Return to “Graphics, sound and multimedia”