View Full Version : Possible to process Flash (.FLV) video with avisynth?
Trixter
29th October 2006, 22:42
I've got a .flv "Flash video" file (like the kind you download from youtube, etc.) that I need to manipulate. Is there any way to load this into avisynth? I tried DirectShowSource but that failed.
If not, is there any conversion possible from Flash Video to some other format? If so, which utilities/programs?
unskinnyboy
29th October 2006, 23:06
I tried DirectShowSource but that failed.You should know better than to just say "failed". Failed how? What was the error message? What was your script? Did you install flvsplitter? Did you enable FLV1 decoding in ffdshow?
flvsplitter + ffdshow + DirectShowSource("yourfile.flv",fps=?) should work, where ? = fps of the video.
foxyshadis
29th October 2006, 23:16
There's an flvsplitter by gabest, and ffdshow can decode basic flvs (flvdecoder can do vp6 ones). ffmpeg and mencoder can read and handle basic (spark) flvs, but not vp6 ones fully yet. Getting close though.
Then there's a number of all-in-one $30-50 shareware conversion softwares that just combine directshow and ffmpeg into a crummy but shiny gui.
Trixter
30th October 2006, 01:50
You should know better than to just say "failed". Failed how? What was the error message? What was your script? Did you install flvsplitter? Did you enable FLV1 decoding in ffdshow?
I had no concept of any of this whatsoever (flvsplitter, etc.). Although your reply was a bit harsh, it contained the information I needed, so thanks. Installing flvsplitter enabled DirectShowSource to load the file.
flvsplitter + ffdshow + DirectShowSource("yourfile.flv",fps=?) should work, where ? = fps of the video.
Is there a way to determine the optimal fps=? setting other than trial and error? I know that the framerate can vary (ie. dip lower to accomodate bitrate) but is there any way to determine the maximum an .flv has?
Trixter
30th October 2006, 02:01
I spoke too soon -- although an .avs loaded into VirtualDub shows an audio track, I hear nothing (it's silence). What am I missing?
unskinnyboy
30th October 2006, 03:58
I had no concept of any of this whatsoever (flvsplitter, etc.). Although your reply was a bit harsh, it contained the information I needed, so thanks. Installing flvsplitter enabled DirectShowSource to load the file.Sorry, sometimes it is so easy if the very first post contained all the error information, so we don't have to go back and forth on it, that's all. Saying something "fails" doesn't help anyone. A failure can be due to dozens of reasons. Exact error messages help us troubleshoot issues better.
Is there a way to determine the optimal fps=? setting other than trial and error? I know that the framerate can vary (ie. dip lower to accomodate bitrate) but is there any way to determine the maximum an .flv has?Doesn't File -> File Information in VirtualDubMoD give you the fps? If not, do an Info() in the script. You may also want to add convertfps=true in the DirectShowSource parm list if the fps is varying wildly.
I spoke too soon -- although an .avs loaded into VirtualDub shows an audio track, I hear nothing (it's silence). What am I missing?Can you hear the audio outside of VirtualDubMoD? Like in FLV Player? Try rendering the file in GraphEdit and see what is decoding the audio. If the audio isn't getting decoded, enable the audio decoding for the audio stream in the ffdshow audio decoder configuration, depending on what kind of stream it is.
stickboy
30th October 2006, 04:51
Doesn't File -> File Information in VirtualDubMoD give you the fps? If not, do an Info() in the script.I've never tried opening .flv files, but if it's like any of the times where I've needed to use DirectShowSource as a last resort, then he might need to specify the fps himself when calling DirectShowSource. If that's the case, clearly Info() and VirtualDub won't be able to report the actual value.
foxyshadis
30th October 2006, 07:35
You can get the fps from mpc's info while playing it. It may not always be accurate, because flvs can have timestamps that don't follow their base framerate, but it's something to start with. Make sure you use convertfps=true in DSS.
The other options is just convert it to 120 fps and decimate as needed. That always works, but it means extra effort in calculating the cycles.
One reason it might not be opening the video, even if ffdshow is correctly configured, is if it's vp6. Check the info in MPC, and see if it's FLV1 (spark) or FLV4 (vp6), the latter needs a different decoder. Unfortunately a standalone version of MPC's hasn't been released, and ffdshow's is still not working.
unskinnyboy
30th October 2006, 07:53
I've never tried opening .flv files, but if it's like any of the times where I've needed to use DirectShowSource as a last resort, then he might need to specify the fps himself when calling DirectShowSource. If that's the case, clearly Info() and VirtualDub won't be able to report the actual value.True. I wasn't thinking clearly. :-\
One other way I can think of is with ffmpeg (ffmpeg -i yourfile.flv). But the problem is that flv needn't have a constant fps. If the fps is constant, ffmpeg will report the correct value. If not, it will do an approximation.
FFmpeg version SVN-r6830, Copyright (c) 2000-2006 Fabrice Bellard, et al.
configuration: --enable-mp3lame --enable-libogg --enable-vorbis --enable-faad --enable-faac --enable-xvid --enable-x264 --enable-mingw32 --enable-a
52 --enable-dts --enable-pp --enable-gpl --enable-memalign-hack --enable-amr_nb --enable-amr_wb --enable-swscaler --enable-avisynth
libavutil version: 49.0.2
libavcodec version: 51.22.0
libavformat version: 50.6.0
built on Oct 29 2006 15:41:38, gcc: 4.0.3
Seems that stream 1 comes from film source: 1000.00 (1000/1) -> 20.00 (20/1)
Input #0, flv, from 'F:\_TestArea\flash8.flv':
Duration: 00:00:07.4, start: 0.000000, bitrate: 56 kb/s
Stream #0.0: Audio: mp3, 22050 Hz, stereo, 56 kb/s
Stream #0.1: Video: vp6f, yuv420p, 320x240, 20.00 fps(r)
Must supply at least one output file
Moitah
30th October 2006, 09:28
FLV Extract (http://www.moitah.net/#FLVExtract) will tell you the framerate, but I think I need to rework the way it's calculated. It works fine on videos that have a constant framerate for the most part, but not really for variable framerate videos. It can write a timecode file as well which can be useful for figuring out the framerate on your own.
Trixter
1st November 2006, 03:12
That is exactly what I'm looking for -- I'll give it a shot tonight, thanks!
Chainmax
1st November 2006, 07:26
Check out these two threads I made some time ago, they might be of help (especially regarding determination of framerate):
http://forum.doom9.org/showthread.php?t=113524
http://forum.doom9.org/showthread.php?t=113261
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.