Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMediaContent and binary encoded videos

QMediaContent and binary encoded videos

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 780 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • understatementOfTheYearU Offline
    understatementOfTheYearU Offline
    understatementOfTheYear
    wrote on last edited by
    #1

    Hi,

    I'm grabbing a binary encoded video from a database that I want to play through pyqt5's media player. All of this is in Python:
    The process is:
    encode mp4 to binary using pickle
    store on database
    decode with pickle and store as a variable
    pass that variable to setMedia(QUrl.fromlocalfile(unpickled_video))
    But that's about as far as it gets.

    I've also tried QUrl.fromEncoded() with no luck. I'm really not certain how to pass a video to setMedia that doesn't have an explicit path.
    Is there any known way of passing a binary video file saved in memory to QMediaContent?

    Thanks!
    -Mark

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Not that I remember, however you can create a temporary file where you dump the video and then play it.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • understatementOfTheYearU Offline
        understatementOfTheYearU Offline
        understatementOfTheYear
        wrote on last edited by
        #3

        That's my last resort. Ideally I'd like to keep any temp files off the hard drive so it doesn't slow everything down.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Then depending on your OS you could make use of a ramdisk.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved