简体   繁体   中英

how to mux audio and video in gstreamer

I'm trying to mux a .ogv only video file with a .mp3 file to get a .ogv file with both video and audio, in gstreamer (v0.10). I try this pipeline :

gst-launch-0.10 filesrc location="video.ogv" ! oggdemux ! queue ! oggmux name=mux ! filesink location="test.ogv" filesrc location="audio.mp3" ! audioconvert ! vorbisenc ! queue ! mux.

When I use this command line, i get an error :

ERROR : of element /GstPipeline:pipeline0/GstAudioConvert:audioconvert0 : not negotiated
Additional debogging information :
gstbasetransform.c(2541): gst_base_transform_handle_buffer (): /GstPipeline:pipeline0/GstAudioConvert:audioconvert0:
not negotiated
ERROR : the pipeline refuse to pass in preparation phase

I can't see what's wrong. Any suggestion ? Thanks.

You need to add an MP3 decoder between the filesrc and audioconvert, or just decodebin eg

gst-launch-0.10 filesrc location="video.ogv" ! oggdemux ! queue ! oggmux name=mux ! filesink location="test.ogv" 
    filesrc location="audio.mp3" ! decodebin ! audioconvert ! vorbisenc ! queue ! mux.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM