[gst-devel] [My Solution] Re: Using gst-launch to convert between video formats on the command line?

Michael R. Head burner at suppressingfire.org
Fri Oct 27 22:55:30 CEST 2006


OK, just in case anyone comes along facing the same troubles I've faced,
here's what I ended up doing. I used gstreamer and avidemux to convert
the matroskas into avis quickly, and without any video quality loss:

for file in *.mkv; do 
  newf=`echo ${file/.mkv/.avi}`;
  tmpf=`echo ${file/.mkv/.tmp.avi}`;
  gst-launch-0.10 -m -v -T filesrc location="${file}" ! \ 
    matroskademux name=d  d.audio_00 ! queue ! faad ! lame ! \
    m.audio_00  d.video_00 ! queue  ! m.video_00 avimux name=m ! \
    filesink location="${tmpf}"; 
  avidemux --force-b-frame --load "${tmpf}" --audio-codec COPY \
    --video-codec COPY --fps 23.976023 --rebuild-inex \
    --output-format AVI --save  "${newf}" --quit;
  rm "${tmpf}";
done


On Fri, 2006-10-27 at 07:02 -0400, Michael R. Head wrote:
> OK, I finally solved (most of) my gst-launch troubles. Here's what I
> finally came up with:
> 
> gst-launch-0.10 --trace -m -v filesrc location=in.mkv ! matroskademux \
> name=d d. ! queue ! faad ! lame  ! m.  d.video_00 ! queue ! m.video_00 \
> avimux name=m ! filesink location=out.avi
> 
> I now understand that the .video_00 suffixes are necessary because the
> pipeline can't otherwise figure out that we're looking for the video
> channel because there's no video element inserted between the demux and
> the mux (whereas there is an audio transcode step in the audio
> subpipeline).
> 
> Still, I do have a leftover issue with the outputted file. The audio is
> severely out of sync with the video (by as much as 2 minutes by the end
> of the file). In order to fix this, I have been running out.avi through
> avidemux (copying the audio and video channels) in order to rebuild the
> keyframes and to tweak the framerate (the file tells gstreamer it's 23
> fps, but it's really 23.976. 
> 
> Is it possible to tweak my pipeline so that gstreamer builds the
> keyframes and forces the framerate to be 23.976?
> 
> Thanks again,
> mike
> 
> On Mon, 2006-10-02 at 00:17 -0400, Michael R. Head wrote:
> > Hi,
> > 
> > I've got some video files in the matroska format that I would like to
> > repack into the avi format. The codecs used in the file are Xvid and and
> > AAC, and I'd like to simply reuse the audio and video bitstreams in the
> > new file (I don't want to do any transcoding). So far, I've figured out
> > how to take the video stream and put it into the avi, like so:
> > 
> > gst-launch-0.10 filesrc location="in.mkv" ! matroskademux ! avimux ! filesink location=out.avi
> > 
> > But the audio channel gets lost. What am I missing?
> > 
> > thanks,
> > mike
> > 
> > -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share your
> > opinions on IT & business topics through brief surveys -- and earn cash
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________ gstreamer-devel mailing list gstreamer-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________ gstreamer-devel mailing list gstreamer-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
-- 
Michael R. Head <burner at suppressingfire.org>
suppressingfire.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20061027/dbec359b/attachment.pgp>


More information about the gstreamer-devel mailing list