Results 1 to 4 of 4

Thread: libvlc: How get current video resolution?

  1. #1
    Join Date
    Oct 2013
    Beans
    11

    libvlc: How get current video resolution?

    Hello,

    How can I get current video resolution using libvlc? I wasn't been able to find any API for this.

    I'm developing an application using libvlc in QT. Part of it, is playing video files using libvlc (that's what libvlc is for, in that project). Everything is basically working just fine, the only thing I wasn't been able to figure out by now, from libvlc documentation - is getting currently playing video track resolution (I'd like dynamically adjusting window/player size, for better end-user experience).

    Any suggestion for figuring out resolution of LibVLC media or currently playing video in LibVLC media player, will be appreciated. Thank you!

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: libvlc: How get current video resolution?

    VLC has a website. I'd start there, since it isn't an Ubuntu project. Always start with the real project team when seeking API answers.
    Of course, you can also look through the header file(s) for libvlc and look for anything related to returning information about the current video in that API. I'd look myself, but none of my systems has VLC installed. https://www.videolan.org/vlc/libvlc.html There's always the source code.

    Found the header files, here: https://code.videolan.org/videolan/v...ref_type=heads

    I know exactly how to get the resolution using other tools (mplayer, mpv, mediainfo) and a shell script, but I don't think that's your question.
    Last edited by TheFu; 2 Weeks Ago at 09:35 PM.

  3. #3
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 24.04 Noble Numbat

    Re: libvlc: How get current video resolution?

    Go to the VLC menu item Tools -> Media-Information -> Codecs tab and there you will see the resolution figures.
    See screenshot.
    Attached Images Attached Images

  4. #4
    Join Date
    May 2018
    Location
    Here and There
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: libvlc: How get current video resolution?

    This may be more than you wanted so feel free to edit it:
    Code:
    mpv libvlc_video_get_width/libvlc_video_get_height and libvlc_video_get_size {Your File Here}
    output:
    Code:
    (+) Video --vid=1 (*) (h264 1920x1080 24.000fps)
     (+) Audio --aid=1 --alang=en (*) (eac3 6ch 48000Hz)
         Subs  --sid=1 --slang=en 'English [SDH]' (subrip)
    AO: [pipewire] 48000Hz 5.1(side) 6ch floatp
    VO: [gpu] 1920x1080 yuv420p
    AV: 00:03:58 / 00:39:49 (10%) A-V:  0.000
    Exiting... (Quit)
    "When you practice gratefulness, there is a sense of respect toward others." >>Dalai Lama

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •