Convert a video to another format

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

Convert a video to another format

kususe
I wanna code a script to convert a video from a format (webm) to a different one (avi).
So, i created two elements (lamemp3enc and x264enc) appending to the queue audio/video.
At the and an "avimux".
I used the queue to divide two original flow streams: audio and video.

I get an error: Error: GStreamer ha incontrato un errore generico di stream. gstbasesrc.c(2582): gst_base_src_loop (): /GstPipeline:player/GstFileSrc:file-source:
streaming task paused, reason not-linked (-1)

Suggestions??
Thanks in advance,
FrankBr
Reply | Threaded
Open this post in threaded view
|

Re: Convert a video to another format

Sean McNamara-4
Hi,

Please post your entire pipeline, not just a general description of
the problem. If your code is open source, post the code. Your verbal
description of the pipeline doesn't say whether you linked the
elements together; whether you applied the necessary conversion
elements (audioconvert and ffmpegcolorspace, for example); or whether
there are other problems in your code. We can't tell any more from an
"errore generico" than you can -- something is wrong. We need code to
know more.

Also keep in mind that there are many open source projects that
already exist, which can perform simple conversion tasks such as this
without having to write any code. A lot of people try to use gstreamer
"from scratch" as if other solutions don't already exist, but they do.
Unless you're doing something very special / exotic that isn't covered
by existing tools, there's no (convincing) reason to write your own
script, unless you simply want to learn.

Also, I'm curious why you're doing audio and video encoding if you
just want to change container formats? You didn't specify what your
desired input and output codecs are, and it's entirely possible that
you may be using the wrong decoders for the input file. WebM and AVI
are container formats, not codecs; each one can contain a variety of
audio and video codecs. You'll generally need to have some knowledge
of what your input and output codecs are going to look like.

Also, you might be able to cut down on the complexity of your code
(depending on your use case) by using encodebin. Take a look:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-encodebin.html

Sean

On Fri, Apr 6, 2012 at 3:34 PM, kususe <[hidden email]> wrote:

> I wanna code a script to convert a video from a format (webm) to a different
> one (avi).
> So, i created two elements (lamemp3enc and x264enc) appending to the queue
> audio/video.
> At the and an "avimux".
> I used the queue to divide two original flow streams: audio and video.
>
> I get an error: Error: GStreamer ha incontrato un errore generico di stream.
> gstbasesrc.c(2582): gst_base_src_loop ():
> /GstPipeline:player/GstFileSrc:file-source:
> streaming task paused, reason not-linked (-1)
>
> Suggestions??
> Thanks in advance,
> FrankBr
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Convert-a-video-to-another-format-tp4538141p4538141.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Convert a video to another format

kususe
I apologize. I'm a newbie in this subject and I'm learning.
My idea is to code a script to display a video, adding some infos on the screen and, while it's playing I'd like to convert my original webm video to avi.
So, what I got until now is just the first phase: I've the webmvideo, I demux it, I add text/time on the screen and send it out on a window.

So, the pipeline I implemented in the code is:

gst-launch-0.10 filesrc location=video.webm ! matroskademux ! queuev ! mpeg2dec ! textoverlay text="zzz" ! timeoverlay ! ffmpegcolorspace ! autovideosink ! queuea ! vorbisdec ! audioconvert ! autoaudiosink

And, using the code (I'm using python):

gst.element_link_many(filesrc,self.demuxer)
gst.element_link_many(self.queuev, self.video_decoder,textoverlay,timeoverlay,colorspace,autovideosink)
gst.element_link_many(self.queuea, self.audio_decoder, audioconv,autoaudiosink)

Now, I'd like to convert, while it's playing or at least without displaying the video itself, to convert the "encode" the output in another format, which is avi.
So, what I think is something like this:

                            queuev- decodervideo - textoverlay -timeoverlay -ffmpegcolorspace - x264enc ->
filesrc - demuxer -                                                                                                                        avimux - filesink v.avi
                           queuea - decoderaudio - audioconvert - lame -------------------------------------------------->

so, in the code I implemented:
gst.element_link_many(filesrc,demuxer)
gst.element_link_many(self.queuev, self.video_decoder,colorspace,x264enc)
gst.element_link_many(self.queuea, self.audio_decoder, audioconv,lame)
gst.element_link_many(avimux,filesink)

but I got

I get an error: Error: GStreamer ha incontrato un errore generico di stream.
> gstbasesrc.c(2582): gst_base_src_loop ():
> /GstPipeline:player/GstFileSrc:file-source:
> streaming task paused, reason not-linked (-1)

is the code correct??
Should I implemented the pipeline like I set up?
so, suggestions?? I hobe have been clear.