Log in

View Full Version : Cannot achieve desired quality when encoding to FLV


Lincoln Burrows
14th July 2008, 19:28
Hi folks,
sorry if this is the wrong area but I am totally lost here. :helpful:

I tried to convert a simple AVI file (about 10-13 seconds), which is using XVID and 576x432 pixels using SUPER from eRightSoft and Adobe Video Encoder.

Both give me FLV videos with 320x240 and different resolutions/bitrates/several different configs, but the image looks bad, with macroblocks yelling at me that the videos were compressed. They were not good enough. I even used higher bitrates and file sizes, but the result was always the same!

So I did uploaded the original AVI to Youtube. The results were downloaded using Keepvid.com.

The first file is FLV, 320x240 and about 600 KB.
The second file is MP4, 480x360 and about 1 MB. Also using H.264.

The second I believed was better anyway, so I checked the first. And no macroblocks at ALL! The image was of course worse than the original source, but this is what is annoying me - their method of encoding is far, far, better!!!!!

Is there a logical explanation for this? And some guidelines I should follow when encoding any file to FLV? I really don't know what to do.

This is very important for everyone who wants to use their own server/bandwith and player, and not rely on Youtube. But we can't do that when all converted videos are worse than if they were uploaded to Youtube. :mad:

If this can't be solved, then I would have to upload my videos to Youtube, and download them using Keepvid.com. A considerable waste of time.

dat720
15th July 2008, 08:01
I use mencoder with a batch file to create video's for youtube, the problem with youtube is the file size needs to be small, hence the compresion is high!

You will get macro blocking on fast content....

Here is my bat file:
youtube.bat
"D:\VidTools\mplayer\mencoder.exe" -of lavf -vf harddup,scale=320:240 -sws 9 -priority normal -o "%~dpn1.youtube.flv" -ovc lavc
-lavcopts vcodec=flv:vpass=1:vbitrate=455370:mbd=2:turbo:v4mv:mv0:trell:cbp:last_pred=2 -nosound %1
"D:\VidTools\mplayer\mencoder.exe" -of lavf -vf harddup,scale=320:240 -sws 9 -priority normal -o "%~dpn1.youtube.flv" -ovc lavc
-lavcopts vcodec=flv:vpass=2:vbitrate=455370:mbd=2:v4mv:mv0:trell:cbp:last_pred=2 -af volnorm=1 -srate 22050 -oac mp3lame
-lameopts aq=3:cbr:br=48 -srate 22050 %1

It uses a video bitrate of 448k and audio bitrate of 48k, it gives a good trade off between quality and size, on a 700mb video it acheives about 2:1 compresion.

robinsonlove
15th July 2008, 15:01
when i used super, Freezes every time I click the "Encode" button after dragging and dropping an file into the program. SO iv tried with different encoders, ediaEncoder, ffmpeg, total ,riva, Moyea, sothink geovid etc..

Dark Shikari
15th July 2008, 15:14
Youtube just uses ffmpeg for their FLV encoding; nothing fancy. They don't do a very good job at it either; they use very fast settings.

miltHTPC
1st August 2008, 17:29
I use Adobe Premiere Elements 3 to encode to .flv for the videos
on my site. Its pretty slow to encode, but the results look as
good as the original. (Adobe is now the owner of the .flv format.)

--Milt--

robinsonlove
4th August 2008, 08:43
just go to google search flash video soft to get good flv encoder tools,

foxyshadis
8th August 2008, 00:49
Recommending trialware that's equal or worse than SUPER or other free converters is a quick route to a strike, especially when the OP's looking for something better.

Premiere Elements 3 is good for commercial software, for a totally free FLV converter you might look at WinFF, they have some very high quality presets.

robinsonlove
12th August 2008, 08:33
:) Winff is a little program, same with ffmpwg, Convert videos quickly, easily, but its command line is complicated to me

smok3
12th August 2008, 08:39
uf,

1st

you need to decide what versions of flash you will support, for example;

a. support all: made the dumbest possible encode that will be compatible with all of them (youtube is doing that i belive)
b. support all: made multiple formats (sorenson, vp6, h.264) and make flash version detection online that will deliver the clip that is compatible with that specific user...
c. support only new: made the best format (h.264) and annoy visitors with 'upgrade your flash' message).
p.s. In most cases i would pick c.

2nd

From there you can start tinkering with technology of encoders, for example;
a. vp6: there is a way to encode via vfw interface, do some searching
b. use x264 to support new versions of flash
c. no, i wouldn't bother with sorenson, but that is up to you...

dat720
12th August 2008, 09:59
:) Winff is a little program, same with ffmpwg, Convert videos quickly, easily, but its command line is complicated to me

WinFF is not a command line program, it is a GUI to ffmpeg.....

Lincoln Burrows
15th January 2010, 06:18
I decided to check WinFF today and I did two different tests. First I downloaded (using KeepVid) the Youtube video, which is using 470x360 and 540 kbps of bitrate according to MediaInfo, it also says the video codec is AVC and the audio AAC, using 96 kbps, 44.1 KHz and 2 channels. Original video was fullscreen (4:3). It also says the Youtube video (which on better resolution when downloaded uses the .MP4 extension) has 30 fps, AVC (Baseline@L3.0) 1 Ref Frames.

First test: I selected Flash Video to for Web use fullscreen. Plus I inserted: Video bitrate (the same) and the res. 470x360.
Audio bitrate 96, 2 channels.

No luck. Bad image quality

Second test: Same as above, but using 1020 kbps as video bitrate instead (which means the filesize would be from 3 to 6 MB). At first I was convinced it was exactly like the Youtube MP4. Then I noticed (and this is painfully obvious in one scene) the macroblocks on the entire screen. And I put both videos side by side to compare.

So clearly no one have figured out yet the exact way Youtube is compressing those videos. But judging from the AVC/AAC information obtained above, what I did wrong on Winff (or what should I do now)?

Hey, I think I did it now! MP4 Fullscreen was the correct choice (that's right, we should not use FLV, only MP4). What I don't understand is why the YT video has 3,66 MB and my MP4 with the same settings is 7,76 MB. MediaInfo says it's using 1256 kbps of video bitrate and AVC (Main@L3.0) CABAC/2 Ref Frames. But that's not what I asked WinFF to do:

http://img136.imageshack.us/img136/4890/imagemtn.png

Any idea what's wrong?

P.S. Using a lower number on that image (like 226) will make no difference, it still uses 1256 kbps as video bitrate.

P.S.²: MediaInfo says about the Youtube MP4 (3 MB):

Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 3.66 MiB
Duration : 47s 933ms
Overall bit rate : 641 Kbps
Encoded date : UTC 2009-12-26 01:17:00
Tagged date : UTC 2009-12-26 01:17:00
gsst : 0
gstd : 48436
gssd : BC92F0026HH

Video
ID : 2
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L3.0
Format settings, CABAC : No
Format settings, ReFrames : 1 frame
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 47s 933ms
Bit rate mode : Variable
Bit rate : 540 Kbps
Maximum bit rate : 724 Kbps
Width : 470 pixels
Height : 360 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 30.000 fps
Resolution : 8 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.106
Stream size : 3.08 MiB (84%)
Title : (C) 2007 Google Inc. v08.13.2007.
Encoded date : UTC 2009-12-26 01:17:00
Tagged date : UTC 2009-12-26 01:17:01

Audio
ID : 1
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : 40
Duration : 47s 925ms
Bit rate mode : Variable
Bit rate : 98.6 Kbps
Nominal bit rate : 96.0 Kbps
Maximum bit rate : 113 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 44.1 KHz
Stream size : 577 KiB (15%)
Title : (C) 2007 Google Inc. v08.13.2007.
Encoded date : UTC 2009-12-26 01:17:00
Tagged date : UTC 2009-12-26 01:17:01And my generated MP4 file:

Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 7.76 MiB
Duration : 47s 947ms
Overall bit rate : 1 358 Kbps
Writing application : Lavf52.32.0

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3.0
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 47s 947ms
Bit rate mode : Variable
Bit rate : 1 256 Kbps
Width : 470 pixels
Height : 360 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 29.970 fps
Resolution : 8 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.248
Stream size : 7.18 MiB (92%)

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : 40
Duration : 47s 914ms
Bit rate mode : Variable
Bit rate : 96.0 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz
Stream size : 562 KiB (7%)

Dark Shikari
15th January 2010, 06:29
So clearly no one have figured out yet the exact way Youtube is compressing those videos.Erm, it's pretty obvious, they just use x264 through ffmpeg.

Just because you haven't figured out how to get good results with one single terrible tool doesn't mean nobody else has figured out how to get good results with good tools.

And MediaInfo is hardly a good way of checking that your encoding settings are not completely screwed up.

sneaker_ger
15th January 2010, 19:41
I don't know WinFF but if you're trying to hit a specific bit rate doing a 2 pass ("Passo 2"?) encode is strongly recommended.
Either way you're probably better off using some other GUI (http://forum.doom9.org/forumdisplay.php?f=78) better known around these forum (and with the developers being active forum members able to answer all your questions): like MeGUI (http://forum.doom9.org/showthread.php?t=151159) or StaxRip (http://forum.doom9.org/showthread.php?t=102652).
I recommend using x264 (probably some slow setting for better quality) and Nero AAC Encoder and you should be able to easily beat YouTube in terms of quality/file size.