Video Streaming Made Awesome with GStreamer and Python - sunhacks 2020 Talk

Поделиться
HTML-код
  • Опубликовано: 17 окт 2020
  • This is a talk I made for sunhacks 2020 about video processing in Python using GStreamer.
    Text version: gist.github.com/velovix/8cbb9...

Комментарии • 104

  • @jjcadman
    @jjcadman 2 года назад +6

    This was a fantastic overview. Well done, to the point, very informative. And the brief overview of video compression CODECs and containers was a nice bonus. Thanks for making this!

  • @johnratliff837
    @johnratliff837 3 года назад

    Thank you so much for putting this together! Really helped me get up and running with GStreamer.

  • @felipecampos6494
    @felipecampos6494 3 года назад +1

    You are absolutely the best! Helped me a lot, i was stuck at configuration and the basics.

  • @jasondeglint
    @jasondeglint 3 года назад +1

    This video had tons of great content and was super valuable for me. Thank you!

  • @pyax7038
    @pyax7038 2 года назад

    Amazing video. Informative and entertaining. Thank you for your work!

  • @Velovix
    @Velovix  3 года назад +11

    I know this is fairly different in format and in content from what I usually make, but I hope you enjoy it anyway! The Go game development stuff is more what I do as a hobby. Video processing in Python is what I do as a job :)

    • @trytogo6794
      @trytogo6794 3 года назад

      nice

    • @Velovix
      @Velovix  3 года назад +1

      @@johannesritter2053 That's awesome! I'm glad the videos were able to help

    • @FiveNineO
      @FiveNineO 3 года назад

      I loved the Go game development series. Good to see you're still around

  • @Impega0
    @Impega0 9 месяцев назад

    Thank you for making this! Great stuff!

  • @user-im1dn8io6r
    @user-im1dn8io6r 5 месяцев назад +1

    Thank you for the great video!, It's so much helpful for me. I search more than 5 hours about gstreaming python, but I think your tutorial video is the best document for beginner

  • @samre3006
    @samre3006 3 года назад +1

    Wow. Thanks for this amazing video.

  • @1chinthaka
    @1chinthaka 2 года назад +2

    One of the best clean and clear, sort and sweet tech videos I've ever seen, keep it up!

  • @ThaGodfathar
    @ThaGodfathar 2 года назад

    Thank you man! This tutorial was fantastic, you should produce more quality content like this :)

    • @Velovix
      @Velovix  2 года назад

      I'm glad you enjoyed it 😁

  • @samjithraj7467
    @samjithraj7467 3 года назад +1

    Thanks for this gstreamer tutorial. Please post more tutorials about gstreamer customisation

  • @davidconley9852
    @davidconley9852 3 года назад

    Great! I can't wait to try this!

  • @dmitryfilatov3644
    @dmitryfilatov3644 3 года назад

    Thanks Tyler, this tutorial is very helpful.

  • @easwarnet
    @easwarnet 2 года назад

    Excellent Video. I highly appreciate your efforts. Thanks a ton

  • @anonymouscommentator
    @anonymouscommentator 10 месяцев назад

    thank you so much for showing how to get started, this helped a ton!

  • @alierencelik2188
    @alierencelik2188 Год назад

    Thank you a lot. I wish the video never ended!

  • @DrShaikAhmad
    @DrShaikAhmad 3 года назад

    Nice video. Thanks for sharing.

  • @willberger96
    @willberger96 Год назад

    Great video!

  • @paolosimonazzi2385
    @paolosimonazzi2385 3 года назад

    Brilliant, thanks!

  • @Jonas-qz2gb
    @Jonas-qz2gb 3 года назад +2

    Posting this in case anybody else ran into the same error as I did:
    When trying to install GStreamer, the plugins and PyGObject on Windows with the command provided in the text version of the tutorial and you get an error like this:
    warning: database file for 'ucrt64' does not exist (use '-Sy' to download)
    error: failed to prepare transaction (could not find database)
    use -Sy instead of -S as in the text version. This worked for me:
    pacman -Sy mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-devtools mingw-w64-x86_64-gst-plugins-{base,good,bad,ugly} mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-gobject
    And thanks for the nice tutorial! I really appreciate the text version you included.

  • @sinanerbezci3699
    @sinanerbezci3699 Год назад

    amazing video. Thanks so much

  • @tytrvd
    @tytrvd 2 года назад

    Awesome video dude

  • @vasylcf
    @vasylcf 3 года назад

    Cool tutorial, thanks

  • @DJCodes
    @DJCodes Год назад

    Thanks a lot man! It was absolutely beginner friendly and interesting. I can watch these videos for my whole life. This is so cool.
    Can you also tell me, how can I send my video to Janus server to webrtc while taking it from RTSP server as live stream.

  • @kar5167
    @kar5167 Год назад

    thanks for this overview😀

    • @kar5167
      @kar5167 Год назад

      can we pass those samples to any CNN algorithm? like object detection and so on? thanks!

  • @gamekida4007
    @gamekida4007 Год назад

    hey, thanks a lot for this content. I would highly request to make more videos on gstreamer. there are not so great videos on this. Also, can you share the resosources from where you learned this. Thanks again

  • @chrstnobrmyr9315
    @chrstnobrmyr9315 3 года назад

    great! Thx

  • @hadrienbernard727
    @hadrienbernard727 2 года назад

    Great video, very well explained. May I ask how you would introduce a specific video latency between the recorded image and the displayed image? Would simply changing the value in time.sleep(0.1) be enough ?

    • @Velovix
      @Velovix  2 года назад

      That sleep is done outside of GStreamer's streaming threads, so it won't have any effect on streaming performance. You should be able to create an artificial delay by adding a "queue" element to your pipeline. The queue element is a buffer that collects video frames, so if you make the queue's buffer large enough, I think it will create a delay. You can use the queue element's "min-threshold-time" parameter to control how large the buffer should be, in nanoseconds.

  • @meteatbas9751
    @meteatbas9751 3 года назад

    can i use this with aws kinesis video stream library producer to trigger in linux

  • @h9945394143
    @h9945394143 2 года назад

    can you do an video of smart recording or "splitmuxsink" using tee for saving video as well as rtsp streaming

  • @msds2930
    @msds2930 2 года назад +2

    Thank you for a nice introduction to GStreamer! May I ask, suppose I want to extract coordinates per frame and store them in arrays for further data analysis, how do you think GStreamer can help me in achieving that goal?

    • @Velovix
      @Velovix  2 года назад

      In what way are you trying to extract these coordinates? If you have your own algorithm, you would probably use an appsink to pull the frames out of GStreamer after they're decoded and process them like normal.

  • @rajeshpurshottamgupta8752
    @rajeshpurshottamgupta8752 2 года назад

    Hey I have to apply some detections on the image frame and show the detection in m3u8 format can you help me?

  • @4r1ga70u-irl
    @4r1ga70u-irl Год назад

    A Like from me for the Kami House!

  • @neeldesai7647
    @neeldesai7647 2 года назад

    Hey! I amge getting Numpy array from special camera using their API, How can I encode that numpy array into .png using Gstreamer to display that array in GUI, Currently I am using OpenCV (imencode and resize) currently it is really slow. I am doing it on Jetson xavier

  • @ishanharshanaedirisinghe1159
    @ishanharshanaedirisinghe1159 Год назад

    thank you

  • @RobloxUNSC
    @RobloxUNSC Год назад

    Hello, how did you import the library into the ide? I have the same code as in the video but I get an importerrror

  • @hussainasghar2841
    @hussainasghar2841 3 года назад

    can we use jetson nano as a source and we can see the live video on the screen

  • @MrNgovanmao
    @MrNgovanmao 2 года назад

    Very good video for studying gstreamer. Thank you for the video.
    Do you have a series of teaching using gstreamer for streaming video (e.g., 4K/8K video, add AI feature to detect object in the pipeline, etc.)?

    • @Velovix
      @Velovix  2 года назад

      It would be very cool to make a video about integrating AI with video streaming! It's something I've worked professionally on in the past. I don't have any videos currently though.
      The processing of video over 1080p is conceptually the same as 4K and 8K, but hardware accelerated decoding becomes a lot more important. Unfortunately hardware decoding is handled very differently between operating systems and even hardware configurations. That makes it difficult for me to produce a video that is useful to a wide audience.

    • @Velovix
      @Velovix  2 года назад +1

      Sorry, switched some words around. I meant to say that processing 4K and 8K video is conceptually similar to 1080p.

  • @zainabimran4783
    @zainabimran4783 2 года назад

    this is the error that i am getting after running the second line in msys2
    error: failed to commit transaction (invalid or corrupted package)
    Errors occurred, no packages were upgraded.

  • @DanielMaidment
    @DanielMaidment 2 года назад

    Thanks. Generally would you recommend using the launch string over the python bindings?

    • @Velovix
      @Velovix  2 года назад +1

      It really depends on what you're doing. Getting Python involved is often necessary if you're trying to integrate video streaming with a larger application. That said, if you can accomplish what you want with gst-launch-1.0, do that! It's much simpler since it does so much for you.

  • @kabar_no.2
    @kabar_no.2 2 года назад

    please do more gaming with go tutorials theres no other tutorials on go sdl2 other than tour videos here.

  • @MH-mu7vb
    @MH-mu7vb 2 года назад

    Thank you for the great video!! I could finally get the overview of gstreamer.
    By the way, I was also impressed by the background songs in the video. Could you tell me how can I listen to them as songs? What kind of words do I need to type on google to find them??

    • @Velovix
      @Velovix  2 года назад

      Believe it or not, they're just free-to-use songs from the RUclips audio library! I don't know where the project files are for this video though, so I don't know their names :(

    • @MH-mu7vb
      @MH-mu7vb 2 года назад

      @@Velovix oh I didn’t know that! Thanks for the information!

  • @turefalse
    @turefalse Год назад

    Thank you for this useful tutorial. I have one question: how can I send frames of a video which I extract and process with openCV as video stream to web to (as I know I should convert to http stream formats like HLS, OGG, webRTC)?

    • @Velovix
      @Velovix  Год назад

      I'm sorry to say I don't really have experience with browser compatible streaming protocols. Good luck though!

  • @BayeFall8239
    @BayeFall8239 3 года назад +1

    Hello, so I'm having issues with importing gi. I keep getting a "No module name 'gi'" error after running "sudo apt install...." on a Raspberry Pi 3. I was hoping you had any advice? Also, what will you recommend for real-time streaming on a Pi from a stereo camera if you've ever dabbled with something like that? 👀

  • @kavyarang1041
    @kavyarang1041 2 года назад

    Absolute understandable explanation . I have a question that How to pipeline video stream hosted online using gstreamer as u said at 5:21 ???

    • @Velovix
      @Velovix  2 года назад +1

      There are a few ways to host video streams online, but one common way is to use the gst-rtsp-server library. They have a few helpful examples in the repository.

  • @eitangreenberg6255
    @eitangreenberg6255 3 года назад

    hello velovix! great tutorial! I just have one question: what should I do if I want to use gstreamer to stream video files from a server to a client with the video's audio as well?

    • @Velovix
      @Velovix  3 года назад +1

      Good question! This is a bit of an involved process and it's more than I can fit into one comment, so I'll give you some hints. Take a look at the gst-rtsp-server library. You give the library a pipeline and it sends the data to clients as RTP packets. Then, on the client side, you'll use the rtspsrc element to receive the stream.

    • @eitangreenberg6255
      @eitangreenberg6255 3 года назад +1

      @@Velovix will try that. thank you very much!!!!

  • @immanueljzv6832
    @immanueljzv6832 3 года назад +1

    why do we create a main loop in a different thread what is its purpose?

    • @Velovix
      @Velovix  3 года назад +2

      The main loop is in charge of doing the work that we ask GStreamer to do. When we start a pipeline to decode a video, all that work is managed by the main loop. The main loop needs an entire thread to itself in order to do that work. We need to run the main loop in a separate thread so we can use our main thread to run the code we write.

  • @anushaga1211
    @anushaga1211 3 месяца назад

    Can you please show us how to build simple py rtsp server?

  • @davindersingh8833
    @davindersingh8833 3 года назад

    I want to access the webcam while someone will open our website and video stream should be started, please help me how i can do it.

  • @khoai1788
    @khoai1788 Год назад

    Hi, nice tutorial by the way. I have a hard time understanding this library. Also I have a question, my scenario is that I have a video processing Class using CV2 with Python which will receive a frame or video link as input and output a processed frame or processed video, I wonder how can I implement this into Gstreammer pipeline. I appreciate any help. Thanks.

    • @kresb
      @kresb 6 месяцев назад

      I am trying to do a very similar thing but in Rust. They have a nice compositor implementation example in gstreamer-rs repo maybe it will be helpful

    • @khoai1788
      @khoai1788 6 месяцев назад

      ​@@kresb I appreciate the suggestion, but unfortunately my program required to use python because I need to utilize a Deep Learning Image Processing library, which doesn't support Rust yet. Thanks by the way man.

    • @kresb
      @kresb 6 месяцев назад

      @@khoai1788 you can just look at examples and do it in python. I often reference C/C++ and Python when I write Rust

  • @Eckmuhl29
    @Eckmuhl29 Месяц назад

    I dont get why doing a script instead of a classic gstreamer command line

  • @dabbopabblo
    @dabbopabblo Год назад

    In VsCode the *`import gi`* line is underlined in blue and when I hover over it says *`Import "gi" could not be resolved`* Do you happen to have any insight as to why?

    • @Velovix
      @Velovix  Год назад

      If running the code works, my guess would be that VSCode is using the wrong Python interpreter. Try selecting the interpreter in VSCode's settings and changing it to the one installed by msys2.

    • @dabbopabblo
      @dabbopabblo Год назад

      @@Velovix Thank you for replying. Unfortunately that didn't fix my issue because I only have one version of python installed. I have also tried reinstalling the library using the command for pacman you gave, but still to no avail.

  • @wafa_athmani
    @wafa_athmani 2 года назад

    hi , does it work with python2.7?

    • @Velovix
      @Velovix  2 года назад

      It looks like PyGObject does not support Python 2.7. I would definitely recommend finding a way to move to a newer version, since 2.7 is now unsupported by the Python developers.

  • @fortunebezetshali7468
    @fortunebezetshali7468 2 года назад

    My god the background image is superbe! Does someone have a link to download that ????

    • @Velovix
      @Velovix  2 года назад

      It's cool, right? I found a copy of it here: wallpaperaccess.com/full/4545965.png

  • @ozgurkaplanturgut6315
    @ozgurkaplanturgut6315 2 года назад

    how can I change pipeline to stream a video on my computer by giving path?

    • @Velovix
      @Velovix  2 года назад

      The element you're looking for is `filesrc`. It takes in a path as a parameter and provides to the pipeline raw data that can be decoded.

    • @ozgurkaplanturgut6315
      @ozgurkaplanturgut6315 2 года назад

      So you mean i should do pipeline=Gst.parse_launch('filesrc ./test.mp4 ! decodebin....) or anything else? Because this code does not work for me

    • @Velovix
      @Velovix  2 года назад

      When you're providing parameters to an element, it's always in the syntax "parameter_name=my_value". So, in this case, your use of filesrc should look like "filesrc location=./test.mp4 ! decodebin ..."

  • @zainabimran4783
    @zainabimran4783 2 года назад

    i am getting an error after i write on the msys2 console ? anyone who can point out the reason?

    • @Velovix
      @Velovix  2 года назад

      Can you post the error that you're getting?

    • @zainabimran4783
      @zainabimran4783 2 года назад

      what do u think i must do?

  • @atNguyen-uv8bk
    @atNguyen-uv8bk 3 года назад

    Hi Velovix, I'm working on jetson TX1 and I wanna stream video from jetson TX1 to other PC. How can i use gstreamer for this work ?

    • @hussainasghar2841
      @hussainasghar2841 3 года назад

      did you solve this problem?
      i am also using jetson nano and i want to strem video from jetson nano to other PC
      if you have solved this problem kindly guide me

  • @HK-wo6fs
    @HK-wo6fs 3 года назад

    can you teach me how can i change file location?

    • @Vancha112
      @Vancha112 3 года назад

      Cut the file, and paste it somewhere else. The file location is now changed.

    • @Velovix
      @Velovix  3 года назад

      If you're asking how to develop outside of MSYS2's directory, it's relatively easy. MSYS2 puts your regular Windows file system under the /c/ directory. So, if you want to develop in a directory called "my_project" under your "My Documents" folder, you can just run the following command in MSYS2 to go to that directory:
      cd "/c/Users/{your username}/My Documents/my_project"

    • @HK-wo6fs
      @HK-wo6fs 3 года назад

      In gstreamer, created file location. I want to change save file everyday.

  • @SbF6H
    @SbF6H Год назад

    Well you can do the same with gst-launch, you don't gotta code.

    • @Velovix
      @Velovix  Год назад

      That's true, but I wanted to focus on how it's done in Python to give people an on-ramp to automate the process and pull frames out of the pipeline

    • @SbF6H
      @SbF6H Год назад

      @@Velovix I see. You've used a busy-loop for fetching frames. Though I've never touched the API, but I believe there may be a callback based API. Correct me if I'm wrong.

    • @Velovix
      @Velovix  Год назад

      Yes, there is! You can attach callbacks to a pipeline to get information on when it changes states. That's what I've done with production code in the past.

  • @leddedup
    @leddedup Год назад

    Excellent video!