[gst-devel] encoding to anything but ogg

Ronald S. Bultje rbultje at ronald.bitfreak.net
Sat Jul 23 04:50:27 CEST 2005


Hi,

On Sat, 2005-07-23 at 01:15, Thomas P. wrote:
> Also why does the following work:
> 
> gst-launch-0.8 oggmux name=m ! filesink location=file.ogg { filesrc
> location= 050518-ee380-100.wmv ! decodebin name=d d. ! audioconvert !
> rawvorbisenc ! queue max-size-time=5000000000 ! m. d. !
> ffmpegcolorspace ! theoraenc ! queue max-size-time=5000000000 ! m. }
> 
> but not this:
> 
> gst-launch-0.8 ffmux_mpeg name=m ! filesink location=file.mpeg {
> filesrc location= 050518-ee380-100.wmv ! decodebin name=d d. !
> audioconvert ! ffenc_mp2 ! queue max-size-time=50000000 ! m. d. !
> ffmpegcolorspace ! ffenc_mpeg1video ! queue max-size-time=50000000 !
> m. }
> 
> and neither does this:
> 
> gst-launch-0.8 avimux name=m ! filesink location=file.avi { filesrc
> location= 050518-ee380-100.wmv ! decodebin name=d d. ! audioconvert !
> lame ! queue max-size-time=50000000 ! m. d. ! ffmpegcolorspace !
> ffenc_mpeg4 ! queue max-size-time=50000000 ! m. }

That's interesting, because muxing is a regular testcase for me, and
works fine. Make sure to use latest releases. Also, you're not
mentioning what happens (error? hang? something else?).

IIRC, each of those cases will fail for two reasons:
* negotiation takes place while playing, but we fixate to some random
value before, just as a starting value. This means fps=0, which both
encoders refuse, since they need the FPS for bitrate control. CVS of
gst-ffmpeg fixes that. You can use filtercaps to workaround it for now.
* the video encoders in ffmpeg will sometimes complain about the
timestamps, and will then drop a frame (this may not be good, but the
timestamps are indeed wrong so you wouldn't see the video frame in a
playback app anyway). In 0.8.5, this leads to errors, I think, CVS of
gst-ffmpeg fixes that. Using videorate somewhere in the middle will fix
that, also.

Try:
gst-launch-0.8 ffmux_mpeg name=m ! filesink location=file.mpeg { filesrc
location=050518-ee380-100.wmv ! decodebin name=d d. ! audioconvert !
ffenc_mp2 ! queue max-size-time=50000000 ! m. d. ! ffmpegcolorspace !
videorate ! video/x-raw-yuv,framerate=\(double\)25 ! ffenc_mpeg1video !
queue max-size-time=50000000 ! m. }
Which works for me.

You can use AVI in the same way. Note that AVI in general and avimux
itself lack any intelligent a/v sync design, so if the stream isn't in
sync (both starting at zero [avi actually allows this, but it's
unimplemented in avimux], lineairly increasing timestamps without gaps
[this is a requirement in avi in general]), avimux will create an AVI
file with invalid sync (i.e. all players will play it back wrongly).
Using both videorate and audiorate (after audioconvert) should fix that.

Cheers,
Ronald

-- 
Ronald S. Bultje <rbultje at ronald.bitfreak.net>





More information about the gstreamer-devel mailing list