GStreamer force decodebin2 output type

谁都会走 提交于 2019-12-01 05:42:16

问题


I'm trying to write a program in C which replicates the pipeline:

gst-launch -v filesrc location="bbb.mp4" ! decodebin2 ! ffmpegcolorspace ! autovideosink

DecodeBin2 has a dynamic pad and I've attached a callback to handle its creation. I am unable to link it to ffmpegcolorspace however because the pad capability is always video/quicktime. I would like it to be video/x-raw-yuv or something else which is compatible with ffmpegcolorspace.

Is this possible to force/select the output type of decodebin2?

Thanks.

EDIT: Please do not recommend playbin. I'm trying to learn how how to make pipelines.


回答1:


Is this possible to force/select the output type of decodebin2?

No you can not force or select the type of its source pad.

decoderbin2 select appropriate demuxer element and that demuxer element parse that media file and depending upon the codec of elementry stream in that media file it creates the caps/type of the output/Source pad.so that type of decoder can link with it and pipeline works.

this all happen in gstremer-plugin code

so if you want such then you need to write plugin by your self..!!




回答2:


You can try the playbin plugin instead of generating your pipeline by hand.

Take a look on https://code.google.com/p/gstmultimedialib/source/browse/trunk/gstmultimedialib/Multimedia/Multimedia/FilterGraph/PlaybinFilterGraph.h from my gstmultimedialib project.

Good Luck!!!



来源:https://stackoverflow.com/questions/8049801/gstreamer-force-decodebin2-output-type

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!