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. How to generate Vlc Stream Output String in Qt application
Forum Updated to NodeBB v4.3 + New Features

How to generate Vlc Stream Output String in Qt application

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 948 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.
  • D Offline
    D Offline
    devillIsHeree
    wrote on 9 Dec 2020, 07:33 last edited by
    #1

    I am developing a media player in Qt using libvlc through vlc-qt wrapper and want to do the video streaming from that player and I have seen If I do the streaming through VLC media player, I got one stream output string in the last window. For exmaple I get this the below string when I selected the video and it's stream options

    :sout=#transcode{vcodec=h264,venc=x264{qp=5},scale=Auto,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:udp{dst=127.0.0.1:1234} :no-sout-all :sout-keep
    

    And to do tthe streaming in my video player Qt application, I just pass this string to my player and it start streaming the video in the same way the VLC does.
    My code to stream the same video using same codecs

        m_media = new VlcMedia("file:///home/vinay/Desktop/Captain.America.Civil.WAR.2016.1080p.HD.TC.AC3.x264-ETRG/ETRG.mp4",m_instance);
        
        m_media->setOption(":sout=#transcode{vcodec=h264,venc=x264{qp=5},scale=Auto,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:udp{dst=127.0.0.1:1234}");
        m_media->setOption(":no-sout-all");
        m_media->setOption(":sout-keep");
    
        m_player->open(m_media);
    

    So I got that this stream output string contains all the details which I require to do the streaming. So i want to do the same in my application where user choose the video clip and then choose the method of streaming and than codec and at last I want to generate the stream output string in the same way VLC media player does but I am not getting how can I generate this stream output string.

    I searched in whole internet and get some documentation of streaming through command line in VLC where they explain the syntax and other thing of that string stream output but there are so many options available, I am still not getting how to implement that in Qt.

    Please help is there any method exist which will give me the stream string output when i just pass the streaming method and codec to it.

    The references which I get on internet are given below

    https://wiki.videolan.org/Documentation:Streaming_HowTo_New/

    https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/

    https://wiki.videolan.org/Documentation:Streaming_HowTo/Advanced_Streaming_Using_the_Command_Line/

    J 1 Reply Last reply 9 Dec 2020, 07:42
    0
    • D devillIsHeree
      9 Dec 2020, 07:33

      I am developing a media player in Qt using libvlc through vlc-qt wrapper and want to do the video streaming from that player and I have seen If I do the streaming through VLC media player, I got one stream output string in the last window. For exmaple I get this the below string when I selected the video and it's stream options

      :sout=#transcode{vcodec=h264,venc=x264{qp=5},scale=Auto,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:udp{dst=127.0.0.1:1234} :no-sout-all :sout-keep
      

      And to do tthe streaming in my video player Qt application, I just pass this string to my player and it start streaming the video in the same way the VLC does.
      My code to stream the same video using same codecs

          m_media = new VlcMedia("file:///home/vinay/Desktop/Captain.America.Civil.WAR.2016.1080p.HD.TC.AC3.x264-ETRG/ETRG.mp4",m_instance);
          
          m_media->setOption(":sout=#transcode{vcodec=h264,venc=x264{qp=5},scale=Auto,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:udp{dst=127.0.0.1:1234}");
          m_media->setOption(":no-sout-all");
          m_media->setOption(":sout-keep");
      
          m_player->open(m_media);
      

      So I got that this stream output string contains all the details which I require to do the streaming. So i want to do the same in my application where user choose the video clip and then choose the method of streaming and than codec and at last I want to generate the stream output string in the same way VLC media player does but I am not getting how can I generate this stream output string.

      I searched in whole internet and get some documentation of streaming through command line in VLC where they explain the syntax and other thing of that string stream output but there are so many options available, I am still not getting how to implement that in Qt.

      Please help is there any method exist which will give me the stream string output when i just pass the streaming method and codec to it.

      The references which I get on internet are given below

      https://wiki.videolan.org/Documentation:Streaming_HowTo_New/

      https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/

      https://wiki.videolan.org/Documentation:Streaming_HowTo/Advanced_Streaming_Using_the_Command_Line/

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 9 Dec 2020, 07:42 last edited by
      #2

      @devillIsHeree said in How to generate Vlc Stream Output String in Qt application:

      Please help is there any method exist which will give me the stream string output when i just pass the streaming method and codec to it

      I'm not sure what exactly the problem is?
      You can simply use a string as template and put the information user entered in that string, like:

      QString vlcString = QString(":sout=#transcode{vcodec=%1,venc=x264{qp=5}...").arg(codecString)...
      

      See https://doc.qt.io/qt-5/qstring.html#arg

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 9 Dec 2020, 08:05 last edited by
        #3

        Hi,

        @devillIsHeree said in How to generate Vlc Stream Output String in Qt application:

        Please help is there any method exist which will give me the stream string output when i just pass the streaming method and codec to it.

        No there's not as there are way to many possibilities to mix:

        • Container format
        • Audio stream format
        • Video stream format
        • Audio sample rate
        • Video sample rate
        • Audio quality depending on the codec
        • Video quality depending on the codec
          etc.

        If you want to provide choices to your users, you need to create a "stream definition builder" using for example QString::arg as @jsulm suggested.

        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
        1

        1/3

        9 Dec 2020, 07:33

        • Login

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