[Red5] Confusion about different ApplicationAdapter methods
aclarke at xuggle.com
Mon Mar 2 10:15:55 PST 2009
On Fri, Feb 27, 2009 at 1:55 AM, Jeremy Morton <admin at game-point.net> wrote:
> Could you check through and see whether there's anything that could be
> causing the errors with WMV conversion? Or could it just be that ffmpeg
> itself has trouble converting WMVs? The same code seems to work OK for an
> MPEG4 file.
I'm not seeing any real conversion errors in either the code, or your
resulting audio, although see below...
> Ahh, hadn't thought of that! Interestingly, it seems that when my code
> just grabs the first video stream, it actually crashes during conversion
> because of an 'invalid timestamp' error; when I hardcode in to grab the
> third (2nd video) stream, it does convert it (however dodgily). Again,
> maybe it's just hard to convert WMV files.
> As you said before, the scrubbar starting some way into the video might
> have something to do with Xuggler detecting this:
> start: 3.000000
Turns out that WMV (and ASF and some other formats) can have timestamps in a
video that don't start at 0; in those cases, IStream.getStartTime() will
return the start time. When transcoding to FLV, you should:
a) Convert the IStream.getStartTime() value to Microseconds (it's units will
depend on the TimeBase of the IStream)
b) Substract the converted value from the timestamp of every IVideoPicture
and IAudioResampler you're going to encode
That should re-base your stream starting at 0, and then the scrub bar should
xu‧ggle (zŭ' gl) v. To freely encode, decode, and experience audio and
Use Xuggle to get the power of FFMPEG in Java.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Red5