Pipe VLC output to ffplay?
Have you tried disabling hardware video acceleration in VLC? This might fix the half-screen problem.
Yes I realize this isn't the question asked, but it seems to be an XY Problem.
Related videos on Youtube
![tetram](https://i.stack.imgur.com/XsuIc.png?s=256&g=1)
tetram
Updated on September 18, 2022Comments
-
tetram almost 2 years
I have a (broken) PC, where VLC plays videos on only the left half the screen, which seems related to OpenGL/drivers (see here). On the other hand,
ffplay
doesn't have the half-window problem, but can open only some videos I want to play.So, similar to How can I pipe output of ffmpeg to ffplay?, I thought of piping VLC to
ffplay
; and I got this far (I'm using this video):$ cvlc Rent_an_Ambassador.ogv --sout '#transcode{vcodec=IYUV}:std{access=file,mux=raw,dst=-}' | ffplay -f rawvideo -s 398x224 pipe:- ... Warning: call to srand(1369860697) Warning: call to rand() Blocked: call to unsetenv("DBUS_ACTIVATION_ADDRESS") Blocked: call to unsetenv("DBUS_ACTIVATION_BUS_TYPE") [0x98f4b64] dummy interface: using the dummy interface module... [0x9903254] mux_dummy mux: Open [rawvideo @ 0x98bf890]Estimating duration from bitrate, this may be inaccurate Input #0, rawvideo, from 'pipe:-': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0.0: Video: rawvideo, yuv420p, 398x224, 25 tbr, 25 tbn, 25 tbc
So, basically
ffplay
it picks up that VLC'sIYUV
should beyuv420p
, as I read in Libav user questions and discussions - Re: Scale image from 4:2:2 to 4:2:0Note that YUV420P is a.k.a. I420 and IYUV.
... unfortunately, the video output is all wrong:
Note that if I don't specify the size for
ffplay
, it fails with:picture size invalid (0x0) Last message repeated 1 times [rawvideo @ 0x9c6f890]Could not find codec parameters (Video: rawvideo, yuv420p) [rawvideo @ 0x9c6f890]Estimating duration from bitrate, this may be inaccurate pipe:-: could not find codec parameters
So, my question is:
- Would anyone know of a proper command line for piping from
vlc
toffplay
- using raw video? - Is there a way to make
vlc
play audio as usual, and pipe its video output as raw video toffplay
(so as to avoid the overhead of muxing video and audio into a new format, which ffplay would have to additionally demux?)
EDIT: Here's one command line that does provide proper video with test file as above (via The VideoLAN Forums • Sending YUV data to a pipe under windows):
cvlc Rent_an_Ambassador.ogv --vout=yuv --yuv-yuv4mpeg2 --yuv-file=/dev/stdout | ffplay pipe:-
However:
-
ffplay
segfaults when I try to unpack some other videos withvlc
- For yet a third category of videos,
vlc
will not export FPS setting - soffplay
will start, show a frame, and then freeze display (and you'd have to continually scroll the mouse button, so the video window refreshes). Note here that you cannot force ffplay frame rate for timeless containers - and when doing--yuv-file
(instead of--sout
) the--sout-transcode-fps
will not apply (from thevlc
side of things)
-
slhck about 11 yearsIt irritates me that
ffplay
wouldn't be able to play something VLC can. Especially Ogg Theora (?) video. Is there a chance you could supply a small test sample? -
tetram about 11 yearsThanks for the comment, @slhck - the video is linked in the post (it's from Wikimedia Commons). Actually, both
vlc
andffplay
can play this file fine - the question is about what format to choose, so one pipes decoded output fromvlc
intoffplay
... Cheers! -
Breakthrough about 11 yearsHave you tried adding in the
--rawvid-chroma
parameter to the call toVLC
? Try adding--rawvid-chroma=YV12
before the pipe (you can also tryUYVY
orI422
, but I think the parameter should beYV12
for YUV240p. -
tetram about 11 yearsThanks for the comment @Breakthrough - tried it now, but doesn't work, and probably it shouldn't (note that
--rawvid-chroma
is option for "Raw video demuxer" == "player"; however here VLC plays "OGV", not "raw video") .. that is why the chroma should have been fixed withvcodec=IYUV
in the very first attempt, but for some reason isn't. Cheers!
- Would anyone know of a proper command line for piping from
-
tetram about 11 yearsThanks for that @DarthAndroid - of course I have, among the first things :) Doesn't work - the linked Slitaz post confirms that loading 'nvidia' driver for X11 was what solved the issue; but on my system,
radeon.ko.gz
is loaded, and X11 doesn't accept it in its setup; which is why I'm looking at this workaround (which actually works - for those pipes that don't segfault withavi
as in OP edit)... Basically, I just want to usevlc
as audio player and video demuxer/decoder - andffplay
as basically just a "projection screen" :) Cheers!