The HQ hack of changing file durations to cheat youtube no longer works.
NOR can you still upload flv files with a total bitrate under 350k, and bypass re-encoding.
all gone, but default youtube is better than what it used to be
As a result of this:
at the moment you can upload an FLV1 Flash clip to youtube and have it pass under the radar unconverted.
Please note this applies to FLV1 only, VP6 will not work and will be reconverted.
This saves a lot of time during upload, because you're uploading a lot smaller files.
Saves suprises, as you know what you're getting before upload,
and you get control over your content.
The restriction (besides standard youtube duration restriction) is that your .flv has to
have a total bitrate under 350kbps, as reported by
[s:f27ec1e020]And you can cheat [/s:f27ec1e020]
I'll show you how.
I think I tend to choose the hard way,
and I don't write guides, so i'll try and outline my process
and see how it turns out.
or FFmpeg http://esby.free.fr/CelticDruid/mirror/ffmpeg/
Hex editor (vdub has one under 'tools')
7zip http://www.7-zip.org/ (to extract from archives)
DGMPGDec (for mpeg1/2 sources)
Audio extractor, encoder. (Mplayer, FFmpeg can do)
Avanti (ffmpeg gui) http://forum.videohelp.com/topic343287.html
Begin by puting,
mencoder / ffmpeg and your source video in a working folder.
Step 1 (optional)
Depending on what source you have and what you're attempting to do,
you may or may not want to go through this prep, and use avisynth.
I use avisynth for everything.
resize, crop, sharpen, blur, framerate alteration...
Install avisynth if you haven't already.
read up on it. http://avisynth.org/mediawiki/Main_Page
Get your audio to uncompressed .wav
FFmpeg would be fine for 2 channel audio,
for multichannel you'd need external downmixing
probably better to just use mplayer, straight to 2 channelCode:ffmpeg -i test.mkv -vn -acodec pcm_s16le audio.wav
Many tools, many ways...Code:mplayer test.mkv -ao pcm:fast -vc null -vo null
Basically you want to resize your material to 4/3. (Youtube display)
If it's 4/3 already it's dead simple.
If it's wide, you have to letterbox.
This is not a resizing guide.
Read DJRumpy's guide for a better understanding of such things:
You may also wish to reduce framerate,
and do other filtering in avisynth.
you have your source.
If it's Mpeg1/2, index with DgIndex (read the documentation)
Open a text file with notepad and write your script,
something like this:
Save with the avs extension, say "300.avs", in the folder containingCode:LoadPlugin("C:\Program Files\AviSynth 2.5\dgdecode.dll") a = mpeg2Source("300.d2v").crop(106,0,-106,-0).lanczos4resize(448,336).changefps(20) b = wavsource("300.wav") audiodub(a,b)
your source video and ffmpeg.
The above was 2.35:1, and I preferred to chop the sides rather than pad top/bottom.
I use a sharp resizer, because that's what I like.
(Although i used bilinear in most of my testing)
I dropped the framerate to get more mileage from the bitrate.
I opted for a resolution the size of the standard youtube display.
You can do anything you like!
Continuation for step 1...
Remember,Code:ffmpeg -i 300.avs -pass 1 -ab 48k -ar 22050 -ac 1 -vcodec flv -b 400k -g 160 -cmp 3 -subcmp 3 -mbd 2 -flags aic+cbp+mv0+mv4+trell 300.flv ffmpeg -i 300.avs -pass 2 -ab 48k -ar 22050 -ac 1 -vcodec flv -b 400k -g 160 -cmp 3 -subcmp 3 -mbd 2 -flags aic+cbp+mv0+mv4+trell -y 300.flv
there's a 350kbps total bitrate limit.
If you don't wish to cheat and change the duration info of your file,
you have to stay under that limit.
If not, you have the 10 min youtube limitation.
In which case your file can be up to ~27MB
(If you're going to use ffmpeg, you might consider using a nice gui like
there's a flash template ready for easy configuration)
note: audio samplerate must be 44100, 22050 or 11025.
you can of course change samplerate before you get to the encoder.
Skipped step 1...
You can use mencoder to simplify the process.
Mencoder has powerful filters and is capable of many things,
so if you just want to get on with encoding you can probably just
feed your source to mencoder and go.
More complex would be say working with an elementary mpeg2 fileCode:mencoder input.avi -o men.flv -af resample=22050:0:0 -sws 9 -vf scale=448:-3,expand=448:336 -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=400:trell:v4mv:mv0:mbd=2:cbp:aic:cmp=3:subcmp=3 -oac mp3lame -lameopts abr:br=48:mode=3
telecined, and an external audio file:
You can of course do 2 pass encoding,Code:mencoder videofile.m2v -fps 30000/1001 -ofps 24000/1001 -o men2.flv -audiofile audio.wav -af resample=22050:0:0 -sws 9 -vf filmdint,scale=448:-3,expand=448:336 -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=400:trell:v4mv:mv0:mbd=2:cbp:aic:cmp=3:subcmp=3 -oac mp3lame -lameopts abr:br=48:mode=3
and use more mencoder filters,
but i'd be using avisynth if i wanted to tamper.
You cheat by changing the reported duration info in the flv header.
Actual duration doesn't change.
Open your flv in a hex editor.
I used HEXcellent. ( http://www.torry.net/pages.php?id=1176 )
Look for "duration"
you're looking for the block of 16 numbers after '40'
starting from the left you have the first value, we'll call it 'a'.
That signifies 2*2^a seconds,
so "5000 0000 0000 0000" is 2*2^5=64 seconds.
The second value, say 'b', is b/16*(2*2^a).
The third value is sixteenths of the second value and so on...
"82C0 0000 0000 0000" is 10 mins, our limit.
Although up to 11 min has been successfully tested:
"84A0 0000 0000 0000"
(A is 10, B=11, C=12, D=13, E=14, F=15)
See appendix for useful hex values.
So say we have this file:
open it in the hex editor,
change the values, either using a calculator and 'reason',
or just keep trying upping the duration bit by bit.
And you get this:
(don't use the uploader mentioned in the thread,
this may result in a youtube re-encode,
upload at youtube directly)
and you end up with something like this:
where i upped things just a bit.
448x336 keeping 400k, audio at 48k, dropping frames to 20fps
original duration 1m48sec, changed to 2m23sec
I also put up a sample pushing things to the max. (Not that i recommend you do so)
Took a 1280x720 sample and cropped to 960x720. It was an avc mkv with 5.1 aac
(shooting myself in the foot a bit) with roughly a total bitrate of 1300k and i
encoded 2 mins, to flv (1500k) with 192k audio. Got about 25MB.
Changed duration in header to 10 mins.
As a note I think one should aim at getting acceptable quality with a total bitrate
Having 'heavy' videos that aren't streamable is not the point of the guide.
But basically you have the freedom to do what you please.
The whole process has the benefit of flexibility.
You have a great amount of control this way.
4E00 (the rest zeroes) = 1 min
5E00 = 2 min
6680 = 3 min
6E00 = 4 min
72C0 = 5 min
7680 = 6 min
7A40 = 7 min
7E00 = 8 min
80E0 = 9 min
82C0 = 10 min
849F = 10:59 min
84A0 = 11 min
+ Reply to Thread
Results 1 to 30 of 1969
Helluva guide, 45tripp, for someone that says he doesn't write guides. I'm sure it'll be much appreciated.
45tripp, that is probably the best quality video I've ever seen on Youtube!
Way to go!
Still not quite clear about the hex values for the time fields, but I can play with it...
And, is it just the standard h.263Sorenson codec that is allowed for video?
Also noticed you said early on to use 11/22/44kHz, but then you ended up using 48k--so you can cheat there too?
Originally Posted by Cornucopia
vp6 gets re-encoded.
no I couldn't have used 48khz.
It's an flv container limitation.
Where you can also cheat is framerate.
A youtube re-encode won't let you keep anything above 30fps.
this way you can keep say 40fps
However, with Flash 9.0 none of this will be necessary.Matters of great concern should be taken lightly.
Matters of small concern should be taken seriously.
superb guide. thanks.
i looked at winff, and it seems to use the command almost verbatim.
you may want to edit the preset to remove framerate,scaling options.
you could also ask Chris K to add a preset for Avanti. http://forum.videohelp.com/topic336318.html
With mencoder the easiest would probably be simple mencoder shell gui (smsg)
don't really know what else.
winff is ready to go though
so far i tried:
Riva flv encoder but macroblocks were visible a bit to much even at 500 bitrate at 320.240
AutoFF refused to open avs files and avi(dv) files
Avanti needs a profile for flv
Automen, nice tool that at the same bitrate of the others prouced by far the better quality, not as any blocks.
will try winff, thanks for your suggestions
Originally Posted by ricardouk
Hadn't noticed Autoff.
I don't like the way you have to have mediainfo
and what not in the same folder as Automen, plus it's not configurable.
slight hinderance as it may be, it's stopped me from trying it so far.
hi i tried several programs and using a dv video as source i cant get the video quality as your 300 trailer at 400k at 448.336 resolution.
i need to use 500k+bitrate for the blocks to disappear
Originally Posted by 45tripp
My video is not block free.
Tried DV and can confirm,
it looks like shit.
Originally Posted by ricardouk
could drop resolution, framerate, maybe crop.
I butchered framerate, dropping almost 20% of the frames.
could probably attempt using some filtering.
Nothing better than what you've already done though:
Originally Posted by ricardouk
You can use higher bit rates with method below, but time limit around 2:00-2:45 minutes only. Here is a vid at YT I made using 960 Kbps, Frame rate=15. Source was vhs in SP mode from cable TV:
This method uses Total Video Converter v3.10. Avi source vid file must be in 640x480 size. For a 2 minute vid wth 1000 bit rate use these settings:
Frame Rate: 15 (custom, enter no less then 15 but can be higher if you lower bit rate)
Bit Rate: 1000 (1000 for 2 minutes which YT calcs each 1000 as 4 minutes, or if vid is 1 minute you can use 2000 brate, which YT calcs as 8 minutes)
Activate high quality settings: checkmark
Video Resize: Original, 4:3
MUST use TVC v3.10, not 3.11.
The trick is to use the highest bit rate and not have YT recode. A 2:30 minute video might work with 15 frame rate, at 860 bit rate. If YT recodes, try again with lower bit rate. At 15 frame rate a 1000 bit rate seems to = 4 minutes on TY. I have not tried editing the header with hex editor to try and post longer vids, it may work.
The vid posted above was made with TVC, and oddly MediaInfo reports zero frame rate of .flv file:
General File size:20.8 MiB
General StreamSize: 274 Bytes
Codec: Sorenson H263
Video#0 Frame rate of 0:000. (don't know why it reports zero, it was made at 15)
Video#0 Bit rate: 960 Kbps
Video#0 StreamSize:15.6 MiB
goyomora posted his method in the thread.
and it helped directing me towards my method.
Mine is superior.
a. no crap payware
b. i.e better encodes
c. no stupidly high audio bitrates.
d. any resolution you like, above 640x480 too
e. A 2:30 minute video might work with 15 frame rate, at 860 bit rate.
If YT recodes, try again with lower bit rate.
I already know what works before uploading.
Originally Posted by 45tripp
Originally Posted by mikejf
No. A reported total bit rate under 350k
File duration is altered to cheat.
If you follow the guide you'll see how it works.
The limit is the youtube 10min mark.
So if you want to upload 5 mins, the best you can do is double reported duration,
hence doubling max total bitrate to ~700k
Excellent tutorial. I used 'SUPER' for the encoding, it produced excellent 345-347 KBps videos, and YouTube was happy to pass them through unscathed. I used the default webpage uploader.
However, there are now three native resolutions used by YouTube
448 x 336 for the old format pages
480 x 360 for the new Beta YouTube pages
424 x 318 is the default embedded resolution in the HTML it offers
So, what is the best resolution to encode a video so that it will display best in all three modes? Is there any mathematical whiz that can point out a resolution which scales cleanly to all these modes ? One problem is that 360 is not divisible by 16, which means it can't be encoded, I think. Sigh... Maybe I made an error...
They're all 4:3,
so you want to be in 4:3 too.
320x240 is fine.
if you want to up the rez, you have to up the bitrate too,
else you'll litter your material with artifacts.
I am sorry. I should have been more clear in my question. My point is that there is significant advantage from being in the native display resolution, so that scaling is not required on playback.
Doesn't change my answer much.
Originally Posted by trevmar
It's just more efficient having mod16 encodes, and hence preferable.
Originally Posted by trevmar
Pick the resolution you're most likely to be displayed in then.
You could do that,
or you could just go to the highest rez so you're always downscaled,
or to the mod16 rez closest to the highest rez,
or the mod16 rez of the existing choices.
I tried virtually every type of encoding software, including the TVC Goyomora Method and other methods.. AND BE FAR , The BEST Method is yours..
In My YouTube Channel (anyonecancopy), I started off with regular YouTube encoding while then graduating from Regular to The "Goyomora" Technique, to finally Your High End Encoding Method.....Its easy and Free
Now all My newer videos ARE of Very High Quality, I have even received Honors from YT
I appreciate Your wonderful tutorial here.
PS: I am a Female, so If I can do it, anyone can
You are welcome
Well, I d/l avanti and have no idea what it is for or what to do with it. I don't think there's anything you could do to improve my I.Q. It's obviously a great guide judging by the comments here, it's just completely beyond my comprehension from Step 1. I do appreciate your response.