View Full Version : VP6 FLV Commandline Encoding Tool
sh0dan
29th September 2006, 21:53
Hi!
I just finished something that might be helpful for you - a way to convert from AviSynth to a VP6 FLV using only free command-line tools.
I wrote the instructions and put up the tools needed at:
http://sh0dan.blogspot.com/2006/09/command-line-flash-8-flv-encoding.html
Basicly you make a VP6.2 AVI, and convert it to FLV using a patched ffmpeg.
DeathTheSheep
30th September 2006, 20:07
Would the VP6.4.2 VfW codec work fine? I hear the decoder is the only thing that drastically changed from VP6.2 to VP6.4.2...
sh0dan
30th September 2006, 23:32
I haven't tested, so I can't say. I guess the besst way would be to try it out. If the file format is the same, odds are that it'll work.
Sharktooth
3rd October 2006, 15:06
6.2 and 6.4 are different encoders. However the bitstream specs should be the same.
Sirber
3rd October 2006, 15:14
How about the audio? What goes in FLV?
Also, may I add this to RealAnime 5? Thanks! :D
[edit]
I found it (audio). MP3 flavor :)
Is there a way to config the pass.conf manually whitout using VFW GUI interface? last time I checked it
was a struct dump and not very editable.
sh0dan
3rd October 2006, 17:27
It seems very binary, unfortunately.
Biterate seems to be at 0x30.
Pass information seems to be at 0xd4, where 0 = Live encode, 1 = Good quality at fast encoding, 2 = one pass best quality, 3 = two pass, first pass, 4 = two pass good quality, 5 = two pass best quality,
Sharpness seems to be at 0xdc.
Noise reduction seems to be at 0x58.
As with the settings above, the rest should be extractable by doing a binary compare.
Sirber
6th October 2006, 12:55
What the tipical settings for automatic 2pass with avs2avi?
Sirber
6th October 2006, 19:29
Found a flash player for .flv files:
http://jeroenwijering.com/?item=Flash_Video_Player
sh0dan
3rd December 2006, 13:52
Here are some basic troubleshooting tips:
* Check if your Avisynth script plays. Open it in Virtual Dub, and check if it is ok (besides being upside down).
* Check the AVI-file. Again, open it in vdub, and check if it is ok.
* Recreate the ".conf" file. There is a commandline in the bat-file that will make it possible to recreate it without encoding your video.
* Run through the bat-script step by step, and check if there are any errors.
photoguy123
12th February 2007, 01:12
sh0dan great work -
One limitation seems to be the video width/height must be divisible by 16. (or else borders get messed up).
Does anyone know where this limitation lies in the pipeline?
Using FlixPro this is not a limitation so is it with ffmpeg?
Regards,
pg
DarkZell666
23rd March 2007, 09:12
Someone apparently found your guide sh0dan, and is having some trouble with it. I've tried the "ffmpeg only" way, and it "almost" works.
More info here: http://forum.doom9.org/showpost.php?p=974118&postcount=4
photoguy123
23rd March 2007, 18:58
Someone apparently found your guide sh0dan, and is having some trouble with it. I've tried the "ffmpeg only" way, and it "almost" works.
More info here: http://forum.doom9.org/showpost.php?p=974118&postcount=4
It works - it's just very easy to get wrong, everything must be just right, and it takes a while to fully understand, at least for someone with my limited intelligence.
I'll tell you something interesting - I tried the demo of the FlixEngine and found it extremely easy to use, very stable, and very flexible for many scenarios. Works perfectly with AVISynth also.
I really wish it wasn't $1500-$3000 for a single server.
If it were reasonably priced I think On2 could sell quite a few copies. I guess Adobe really squeezed them on the price to be the flash codec, so now they use that monopoly to squeeze the little guys.
sh0dan
26th March 2007, 09:37
@DarkZell666: There is no "ffmpeg only" way to get VP6 (Flash 8) FLV's, only Flash 6 video can be done by ffmpeg.
@photoguy: Yes - there are quite a few steps that must be right. I have only used FlixPro for offline encoding, and it is quite good - but it leaks memory in massive amounts, when using avisynth, so it isn't really an option for massive batch encodes.
Also I like to be able to reencode my video, by starting a bat file - that is IME the best way to ensure you get the same quality as your last encode, in a production environment.
Zorro56
19th April 2007, 19:43
Hi, i'd just wanna know why the encoding phase is sometimes very different from one avi to another while they both have the same framerate, the same bitrate, the same codec and approximately the same duration ? Thanks a lot.
Blue_MiSfit
27th April 2007, 05:27
Sh0dan,
Thanks for this awesomely cool tool.
I have a problem though... I generated a 2 pass VBR encode at 640kbit with VirtualDub and VP6, and the result plays well. When I use your ffmpeg to mux with MP3, it all works, but when I play the FLV, it is a black screen of correct dimensions. Ideas?
~MiSfit
Stat
18th June 2007, 17:47
I have the same problem, were you able to find a solution?
leiming2006
3rd July 2007, 11:28
http://img521.imageshack.us/img521/9711/111ab5.th.jpg (http://img521.imageshack.us/my.php?image=111ab5.jpg)
http://img140.imageshack.us/img140/8715/222wa0.th.jpg (http://img140.imageshack.us/my.php?image=222wa0.jpg)
I would like to download this ffmpeg but neither from googlepages nor from blogspot can I open the achieve after downloading. I don't know why.
If anyone can give me one? thanks.
mgh
28th November 2007, 10:47
If you feel uncomfortable with clis, you can do the following.
Encode the avi in virtualdub using vp6.2 and mp3 at sample rate of 11025,22050 or 44100 Hz. Use the flip vertical filter while encoding.
Change fourcc to VP6F with Nic's Fourcc changer.
use avidemux (the ..gtk.exe), video copy,audio copy and format flv.Save as yourchoice.flv
edit-if you use ffmpeg for muxing to flv, the fourcc change is not necessary. avidemux needs the specific fourcc.
lilhobo
3rd April 2008, 11:49
so whats the best encoder for vp6???
vp6.4.2 ?? or is ther a later version?
sh0dan
3rd April 2008, 12:32
I don't believe there is any later version. I cannot spot any difference from this to 6.2 - but I haven't done in depth testing.
photoguy123
7th April 2008, 19:32
Remember also that the flash player now supports real h.264 video.
This is huge for certain people who control their flash player - or if you don't control your player beg your server admin to get version 9.0.115 going.
Besides removing all these hassles of setting up a vp6 encoder, it also means much faster encoding since x264 is multi-threaded and vp6 is not.
I will be really glad when vp6 is gone away.
regards,
pg
DeathTheSheep
10th April 2008, 04:49
I don't believe there is any later version. I cannot spot any difference from this to 6.2 - but I haven't done in depth testing.
Bitstream is of course identical. One-pass files are bit for bit identical between the two versions at constant quantizer, but ratecontrol (specif. 2 pass) has been updated slightly in 6.4.x series to a slightly more powerful engine, which is indeed newer.
blausand
22nd April 2008, 21:07
Hi folks,
thanks to Sh0dan in the first place - he did a really good job, and it seems, within two years nothing rendered obsolete.
I really wonder who will implement that avs2avi2flv trick into the AVSP-tools, where avs2avi has a nice dialog by now.
Has the Author of avs2avi retired?
Not only is it a hassle to point paths to all that stuff, but also creating the temp.avi in the directory of FFMPEG is absolutely not suitable.
@sh0dan: How is your trick setup best, when there's already ffmpeg and avs2avi.exe installed? Can't the muxing into FLV container be integrated into the avs2avi.exe-dialog of AVSP easily?
greetings, blausand
magnatique
2nd May 2011, 23:54
Hey SH0dan,
thanks for this great post. I have been trying to get rid of other tools and just get everything command-lined lately and Flash is pretty much the only thing left.
Are you still using the same files/setup you explained here for your flv needs?
I thought I'd check in with updated scripts/workflow if you have... otherwise I do have a bug I'm trying to work out...
my avs source has a resize to 640x360 (from a 1920x1080 source).
the temp.avi file is 640x360, but when muxing with ffmpeg, the size becomes 640x368. any idea what causes this?
is it because ffmpeg absolutely wants /16 sizes?
any idea ?
magnatique
3rd May 2011, 00:29
actually with more digging, I think it could be ffmpeg seeing the avi as 368?
FFmpeg version SVN-r6373, Copyright (c) 2000-2004 Fabrice Bellard
FLV VP6 mux version. Patch by Benjamin Larsson, compile by Klaus Post
configuration: --enable-memalign-hack --enable-avisynth --enable-swscaler --e
nable-mp3lame --enable-gpl
libavutil version: 49.0.1
libavcodec version: 51.16.0
libavformat version: 50.5.0
built on Sep 29 2006 19:38:14, gcc: 3.4.5 (mingw special)
Input #0, avi, from 'temp.avi':
Duration: 00:00:33.4, start: 0.000000, bitrate: 1631 kb/s
Stream #0.0: Video: vp6, yuv420p, 640x368, 29.97 fps(r)
Input #1, avs, from 'tt062.avs':
Duration: 00:00:33.4, start: 0.000000, bitrate: 0 kb/s
Stream #1.0: Video: rawvideo, yuv420p, 640x360, 82861 kb/s, 29.97 fps(r)
Stream #1.1: Audio: pcm_s16le, 44100 Hz, stereo, 1411 kb/s
Output #0, flv, to 'tt062.flv':
Stream #0.0: Video: VP62 / 0x32365056, yuv420p, 640x368, q=2-31, 29.97 fps(c)
Stream #0.1: Audio: mp3, 44100 Hz, stereo, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #1.1 -> #0.1
frame= 1001 q=0.0 Lsize= 7179kB time=33.4 bitrate=1760.8kbits/s s
video:6620kB audio:522kB global headers:0kB muxing overhead 0.515293%
mariush
3rd May 2011, 04:24
Hey Genius, do you realize you just replied to a thread dead since 2008?
magnatique
3rd May 2011, 06:27
Genius heh?
I do realize that I replied to a very old thread... but to this day, I still use many tools that are VERY old. take qtinput for example, no news in the thread for 2 years then we run into a bug and my employee j3ff asks a question in the thread and tateu fixes the plugin for Apple ProRes.... then 2 years later someone else has an issue with the pluggin and tateu again takes time to fix it.
edit : url to thread http://forum.doom9.org/showthread.php?t=143308
I've been reading these boards for almost 8 years now and Sh0dan has been a constant help to the community. It doesn't hurt to ask for input once in a while and if you're not willing to give a hand and it offends you that I give this thread a shot, you can keep the condescending tone to yourself thank you very much ;)
Also, if you do a search for VP6 command line, avs to flv or anything else related to building a command line setup to encode VP6 flv's, you'll see sh0dan's blog and this thread many times... if I had found other valuable info elsewhere I wouldn't have bothered either.
I do encode everything with x264 as well and am aware it streams perfectly, but I still have some use for backwards compatibility in our workflow with FLV's and would like to get rid of third party encoding platforms to move everything to my custom built encoding farm and have everything automated/commandline driven... hence my effort in gathering more information here.
I still welcome any good input from anyone :)
sh0dan
3rd May 2011, 08:30
@mariush: If you need to insult people, this is not the place.
@magnatique: I have the same issue - I'm not really sure why this is happening, but I just force myself to use width/height dividable by 16. And yes, I actually still use the same workflow at work, since we cannot switch away from Flash 8 video yet.
magnatique
3rd May 2011, 15:47
@magnatique: I have the same issue - I'm not really sure why this is happening, but I just force myself to use width/height dividable by 16. And yes, I actually still use the same workflow at work, since we cannot switch away from Flash 8 video yet.
Ok perfect. I was going to make a few more tests with different width but my backup plan was to move back to 768x432 which I needed to use in the past for these multiple of 16 issues hehe
Thanks again, this will save us quite a bit of time ;-)
Reimar
4th May 2011, 15:26
@magnatique: I have the same issue - I'm not really sure why this is happening, but I just force myself to use width/height dividable by 16.
It's a bug in FFmpeg that has been fixed a looong time ago.
Or to say it different it's what happens when you use ancient versions of tools :devil:
magnatique
4th May 2011, 15:55
It's a bug in FFmpeg that has been fixed a looong time ago.
Or to say it different it's what happens when you use ancient versions of tools :devil:
any version you know of floating around with the VP6 FLV mux patch? One day I should spend the time to learn how to compile stuff myself hehe
magnatique
4th May 2011, 16:14
I take that back actually. First attempt I had made with a win32 build didn't let me mux (probably an error on my part) so I tried once again with one found at http://www.bizzeh.com/ffmpeg/free/static/
I tried muxing again, but looks like it's still giving 640x368 with that latest build. while encoding, it reports 640x360 at every step of the way, but media info will give me 640x368 on the muxed flv heh
R:\test\vp6-tool>ffmpeg-new -ab 128000 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec
copy -i "test.avs" "test.flv"
FFmpeg version git-N-29079-gff5278d, Copyright (c) 2000-2011 the FFmpeg develope
rs
built on Apr 14 2011 00:02:00 with gcc 4.5.2
configuration: --arch=x86 --cross-prefix=i686-pc-mingw32- --target-os=mingw32
--prefix=/ffmpeg/builds/git-N-29079-gff5278d-static --enable-memalign-hack --dis
able-shared --enable-static --enable-w32threads --disable-debug --enable-gpl --e
nable-version3 --enable-runtime-cpudetect --enable-zlib --enable-bzlib --enable-
avisynth --enable-postproc --enable-libmp3lame --enable-libx264 --enable-libvorb
is --enable-libtheora --enable-libspeex --enable-libopencore-amrnb --enable-libo
pencore-amrwb --enable-libxvid --enable-libgsm --enable-libvpx --disable-decoder
=libvpx --enable-librtmp --enable-libopenjpeg --enable-frei0r --enable-libxavs -
-cc='ccache i686-pc-mingw32-gcc'
libavutil 50. 40. 1 / 50. 40. 1
libavcodec 52.119. 0 / 52.119. 0
libavformat 52.106. 0 / 52.106. 0
libavdevice 52. 4. 0 / 52. 4. 0
libavfilter 1. 78. 0 / 1. 78. 0
libswscale 0. 13. 0 / 0. 13. 0
libpostproc 51. 2. 0 / 51. 2. 0
Input #0, avi, from 'temp.avi':
Duration: 00:00:33.40, start: 0.000000, bitrate: 1631 kb/s
Stream #0.0: Video: vp6, yuv420p, 640x360, 29.97 tbr, 29.97 tbn, 29.97 tbc
Input #1, avs, from 'test.avs':
Duration: 00:00:33.40, start: 0.000000, bitrate: 0 kb/s
Stream #1.0: Video: rawvideo, yuv420p, 640x360, 82861 kb/s, 29.97 tbr, 29.97
tbn, 29.97 tbc
Stream #1.1: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
[libmp3lame @ 03797ec0] The requested thread algorithm is not supported with thi
s thread library.
Output #0, flv, to 'test.flv':
Metadata:
encoder : Lavf52.106.0
Stream #0.0: Video: [4][0][0][0] / 0x0004, yuv420p, 640x360, q=2-31, 1k tbn,
29.97 tbc
Stream #0.1: Audio: libmp3lame, 44100 Hz, 2 channels, s16, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #1.1 -> #0.1
Press [q] to stop encoding
frame= 1001 fps= 27 q=-1.0 Lsize= 7179kB time=33.40 bitrate=1760.8kbits/s
video:6620kB audio:522kB global headers:0kB muxing overhead 0.517070%
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.