Pipe VLC output to ffplay?

6,440

Have you tried disabling hardware video acceleration in VLC? This might fix the half-screen problem.

enter image description here

Yes I realize this isn't the question asked, but it seems to be an XY Problem.

Share:
6,440

Related videos on Youtube

tetram
Author by

tetram

Updated on September 18, 2022

Comments

  • tetram
    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's IYUV should be yuv420p, as I read in Libav user questions and discussions - Re: Scale image from 4:2:2 to 4:2:0

    Note that YUV420P is a.k.a. I420 and IYUV.

    ... unfortunately, the video output is all wrong:

    bad video

    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 to ffplay - using raw video?
    • Is there a way to make vlc play audio as usual, and pipe its video output as raw video to ffplay (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 with vlc
    • For yet a third category of videos, vlc will not export FPS setting - so ffplay 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 the vlc side of things)
    • slhck
      slhck about 11 years
      It 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
      tetram about 11 years
      Thanks for the comment, @slhck - the video is linked in the post (it's from Wikimedia Commons). Actually, both vlc and ffplay can play this file fine - the question is about what format to choose, so one pipes decoded output from vlc into ffplay... Cheers!
    • Breakthrough
      Breakthrough about 11 years
      Have you tried adding in the --rawvid-chroma parameter to the call to VLC? Try adding --rawvid-chroma=YV12 before the pipe (you can also try UYVY or I422, but I think the parameter should be YV12 for YUV240p.
    • tetram
      tetram about 11 years
      Thanks 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 with vcodec=IYUV in the very first attempt, but for some reason isn't. Cheers!
  • tetram
    tetram about 11 years
    Thanks 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 with avi as in OP edit)... Basically, I just want to use vlc as audio player and video demuxer/decoder - and ffplay as basically just a "projection screen" :) Cheers!