pythonhtmlpython-3.xmediainfo

Get the streaming HTML Video details from a direct URL without downloading it


I've listed direct URLs to the video files on the server from its front page, now I want to get the video details (like height and width, duration, file size, etc) without downloading it! (as it's possible to stream via direct URL, e.g. https://www.w3schools.com/html/mov_bbb.mp4)

Is there any way to get the video details without actually downloading the whole file?
I found MediaInfo, but I have no idea how to use it in this concept.
Also, the website itself has a tool that works offline without uploading the file!


Solution

  • Is there any way to get the video details without actually downloading the whole file?

    mediainfo https://www.w3schools.com/html/mov_bbb.mp4
    

    reads only what it needs (MP4 header and ~10 seconds of content).

    If you don't need e.g. GOP size, you can reduce the download to only few frames with

    mediainfo --ParseSpeed=0 https://www.w3schools.com/html/mov_bbb.mp4
    

    Command line to be used with the command line version of MediaInfo, check the download pages of MediaInfo.

    Jérôme, developer of MediaInfo.