Fwd: Need help to construct a pipeline

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: Need help to construct a pipeline

Mayank Aggarwal

Hi Gstreamer experts,

I am a beginner with gstreamer so bear with me.

I have a working pipeline where audio and video from a test source is sent to the webrtcbin element used to send out offer. Pipeline is as follows:

PIPELINE_DESC = '''
webrtcbin name=sendrecv stun-server=stun://stun.l.google.com:19302
 audiotestsrc is-live=true wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay !
 queue ! application/x-rtp,media=audio,encoding-name=OPUS,payload=96 ! sendrecv.
 videotestsrc is-live=true pattern=ball ! video/x-raw,width=320,height=240 ! videoconvert ! queue ! x264enc ! rtph264pay !
 queue ! application/x-rtp,media=video,encoding-name=H264,payload=97 ! sendrecv.
'''
However doing this consumes a lot of CPU/Memory as gstreamer has to encode audio/video. Hence I was to use a pre-recorded file to lower the resource usage.


I want to use a sample file (sample.mp4) to send audio and video to the webRTCbin element. The mp4 file has H264 video and AAC audio. I have tried a lot of combinations of elements but it is not working. Could you please help me correct my pipeline? 

PIPELINE_DESC = '''
webrtcbin name=sendrecv stun-server=stun://stun.l.google.com:19302
 filesrc location=sample.mp4 ! decodebin ! audioconvert ! sendrecv.
 filesrc location=sample.mp4 ! decodebin ! videoconvert ! sendrecv.
'''

Many thanks in advance.

Thanks,
Mayank

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help to construct a pipeline

Mayank Aggarwal
Hi All,

Any help on this?

Thanks,
Mayank

On Fri, Jan 10, 2020 at 4:30 PM Mayank Aggarwal <[hidden email]> wrote:

Hi Gstreamer experts,

I am a beginner with gstreamer so bear with me.

I have a working pipeline where audio and video from a test source is sent to the webrtcbin element used to send out offer. Pipeline is as follows:

PIPELINE_DESC = '''
webrtcbin name=sendrecv stun-server=stun://stun.l.google.com:19302
 audiotestsrc is-live=true wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay !
 queue ! application/x-rtp,media=audio,encoding-name=OPUS,payload=96 ! sendrecv.
 videotestsrc is-live=true pattern=ball ! video/x-raw,width=320,height=240 ! videoconvert ! queue ! x264enc ! rtph264pay !
 queue ! application/x-rtp,media=video,encoding-name=H264,payload=97 ! sendrecv.
'''
However doing this consumes a lot of CPU/Memory as gstreamer has to encode audio/video. Hence I was to use a pre-recorded file to lower the resource usage.


I want to use a sample file (sample.mp4) to send audio and video to the webRTCbin element. The mp4 file has H264 video and AAC audio. I have tried a lot of combinations of elements but it is not working. Could you please help me correct my pipeline? 

PIPELINE_DESC = '''
webrtcbin name=sendrecv stun-server=stun://stun.l.google.com:19302
 filesrc location=sample.mp4 ! decodebin ! audioconvert ! sendrecv.
 filesrc location=sample.mp4 ! decodebin ! videoconvert ! sendrecv.
'''

Many thanks in advance.

Thanks,
Mayank

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help to construct a pipeline

Olivier Crête-3
Hi,

Make sure you encore you H.264 in your file as baseline profile (this is all that's supported for WebRTC), also you want to put the audio as opus.. Then you want to use qtdemux directly instead of decodebin, because you don't want to decode and re-encode. If you can't control the codecs of the pre-recorded file, you'll probably have to trancode everything..

Olivier

On Mon, 2020-01-13 at 16:01 -0500, Mayank Aggarwal wrote:
Hi All,

Any help on this?

Thanks,
Mayank

On Fri, Jan 10, 2020 at 4:30 PM Mayank Aggarwal <[hidden email]> wrote:

Hi Gstreamer experts,

I am a beginner with gstreamer so bear with me.

I have a working pipeline where audio and video from a test source is sent to the webrtcbin element used to send out offer. Pipeline is as follows:

PIPELINE_DESC = '''
webrtcbin name=sendrecv stun-server=stun://stun.l.google.com:19302
 audiotestsrc is-live=true wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay !
 queue ! application/x-rtp,media=audio,encoding-name=OPUS,payload=96 ! sendrecv.
 videotestsrc is-live=true pattern=ball ! video/x-raw,width=320,height=240 ! videoconvert ! queue ! x264enc ! rtph264pay !
 queue ! application/x-rtp,media=video,encoding-name=H264,payload=97 ! sendrecv.
'''
However doing this consumes a lot of CPU/Memory as gstreamer has to encode audio/video. Hence I was to use a pre-recorded file to lower the resource usage.


I want to use a sample file (sample.mp4) to send audio and video to the webRTCbin element. The mp4 file has H264 video and AAC audio. I have tried a lot of combinations of elements but it is not working. Could you please help me correct my pipeline? 

PIPELINE_DESC = '''
webrtcbin name=sendrecv stun-server=stun://stun.l.google.com:19302
 filesrc location=sample.mp4 ! decodebin ! audioconvert ! sendrecv.
 filesrc location=sample.mp4 ! decodebin ! videoconvert ! sendrecv.
'''

Many thanks in advance.

Thanks,
Mayank
_______________________________________________
gstreamer-devel mailing list
[hidden email]

https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-- 
Olivier Crête [hidden email]

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel