Giter Site home page Giter Site logo

gstreamer-audio-video-decoder-example's Introduction

GStreamer-Audio-Video-Decoder-Example

This is an example audio-video decoder implementation in GStreamer 1.0 (Python).

I changed the code from http://stackoverflow.com/questions/8187257/play-audio-and-video-with-a-pipeline-in-gstreamer-python/8197837 created by Joan Wandborg that previously implemented in GStreamer in 0.10.

How To Use

You can use the code like this:

python3 main.py \
    --input='<path to video file>'

For example:

python3 main.py \
    --input='/home/jefflgaol/Dokumen/GStreamer/video.mp4'

Structure

filesrc --> decodebin --> (1) ..
                      --> (2) ..
(1) --> queue --> autovideoconvert --> gtksink (previously is autovideosink)
(2) --> queue --> audioconvert --> autoaudiosink

Note: I modified from autovideosink to gtksink for better compatibility for most computers.

Short Explanation

Our input comes from filesrc. Then, the file will be decoded using decodebin. From decodebin, it will demux the filesrc into two streams: video and audio. Then, for both streams we add a buffer. See https://gstreamer.freedesktop.org/documentation/tutorials/basic/multithreading-and-pad-availability.html?gi-language=c for a more clear explanation about buffer. After buffer, the video stream will go to autovideosink, but to have the same capabilities, we added autovideoconvert so capabilities negotiation can be performed. See https://gstreamer.freedesktop.org/documentation/tutorials/basic/media-formats-and-pad-capabilities.html?gi-language=c for a more clear explanation about pad capabilities. The same thing also happens to the music stream.

Result

alt text

gstreamer-audio-video-decoder-example's People

Contributors

jefflgaol avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.