JonE
23rd April 2009, 09:58
Hi,
I'm having trouble transcoding FLV files using DirectShow.
If I build a graph with FLVSplitter (part of k-lite codec pack), decode audio and video with FFDShow and just play it, everything works fine i.e. in synch
However, re-mux the decoded audio/video streams, encoding only the video (tried DV, XVid and a few others) and write to an AVI file and it is clear that the video frame rate is completely garbage ... it seems < half speed. Initially I thought the video was half speed but its worse than that.
Switching on the OSD feature in FFDShow to show the sample times reveals odd behaviour; the sample times from the FLVSplitter are e.g.
0-1, 33000-33001, 66000-66001 etc whereas I would expect
0-33000, 33000-66000, 66000-... etc
Either way, this is clearly ~30fps, yet the output from FFDShow shows a 40mS period i.e. 25fps. In addition, examination of the resulting video in VirtualDub reveals each frame is being duplicated.
Also, the DirectShow graph hangs during transcoding if you stop the graph, or if it gets to the end of the transcoding process (this is all currently being done in Monogram GraphStudio at the moment). I don't know exactly where it is hanging, but a readable AVI is generated (with frame rate wrong of course).
So, whats going on and, more to the point, how do I fix it ? Where does FFDShow get its 40mS frame period from ?
TTFN,
Jon
PS : In case it is in any way relevent, the test source FLV is from YouTube.
PPS : I know there are good utils out there that will transcode FLVs, indeed ffmpeg can also transcode these files, but I'm specifically trying to do this using DirectShow.
I'm having trouble transcoding FLV files using DirectShow.
If I build a graph with FLVSplitter (part of k-lite codec pack), decode audio and video with FFDShow and just play it, everything works fine i.e. in synch
However, re-mux the decoded audio/video streams, encoding only the video (tried DV, XVid and a few others) and write to an AVI file and it is clear that the video frame rate is completely garbage ... it seems < half speed. Initially I thought the video was half speed but its worse than that.
Switching on the OSD feature in FFDShow to show the sample times reveals odd behaviour; the sample times from the FLVSplitter are e.g.
0-1, 33000-33001, 66000-66001 etc whereas I would expect
0-33000, 33000-66000, 66000-... etc
Either way, this is clearly ~30fps, yet the output from FFDShow shows a 40mS period i.e. 25fps. In addition, examination of the resulting video in VirtualDub reveals each frame is being duplicated.
Also, the DirectShow graph hangs during transcoding if you stop the graph, or if it gets to the end of the transcoding process (this is all currently being done in Monogram GraphStudio at the moment). I don't know exactly where it is hanging, but a readable AVI is generated (with frame rate wrong of course).
So, whats going on and, more to the point, how do I fix it ? Where does FFDShow get its 40mS frame period from ?
TTFN,
Jon
PS : In case it is in any way relevent, the test source FLV is from YouTube.
PPS : I know there are good utils out there that will transcode FLVs, indeed ffmpeg can also transcode these files, but I'm specifically trying to do this using DirectShow.