Compressing woes

If you have questions about compression/encoding/converting look here.
Locked
Ciato
Joined: Sat Jan 19, 2002 10:51 pm
Org Profile

Compressing woes

Post by Ciato » Mon Nov 13, 2006 4:43 pm

Ok, I would like to get my video to ~95 mb as a final product. I've been told it's possible, but things aren't working out. I'm just going to list all of the pertinent information I can, and mention what I've tried. Ok, starting from the beginning...

The scripts:

Code: Select all

AVIsource("C:\Documents and Settings\Jeff\Desktop\1\Source1.avi")
ConvertToYV12(interlaced=true)
TomsMoComp(1,5,1)
bicubicresize (512,384)
deen ("a3d",3,3,5,4)
fastlinedarken()
awarpsharp()
Tweak(cont=1.0,sat=1.5,bright=0, hue=0)
ConvertToRGB32()

Code: Select all

AVIsource("C:\Documents and Settings\Jeff\Desktop\1\Overture.avi")
ConvertToYV12()
crop (0,60,-0,-60)
bicubicresize (512,384)
deen ("a3d",3,3,5,4)
fastlinedarken()
awarpsharp()
ConvertToRGB32()
My resize script used to be lanczosresize (640,480) but I changed them attempting to reduce filesize. It did reduce the filesizes admirably, but not enough.

The resulting Huffys
Made with Fast Recompress in VirtualDubMod

Frame size, fps: 512x384, 29.970 fps
Length: 134121 frames (1:14:35.17)
Size: 28,980,011,008 bytes
FourCC code: FourCC: [HYFU] Huffman Lossless
Decompressor: Huffyuv v2.1.1 CCESP Patch v0.2.5
Number of key frames: 134121
Min/Max/Avg/total key frame size: 151348/216056/290860 (28298534k)
No delta frames
Data rate: 51802 kbps (0.01% overhead)
No audio stream

-------------

Frame size, fps: 512x384, 23.975 fps
Length: 120476 frames (1:23:44.98)
Size: 27,384,602,624 bytes
FourCC code: FourCC: [HYFU] Huffman Lossless
Decompressor: Huffyuv v2.1.1 CCESP Patch v0.2.5
Number of key frames: 120476
Min/Max/Avg/total key frame size: 147568/219260/439180 (25796526k)
No delta frames
Data rate: 42055 kbps (0.01% overhead)

Audio Stream
Sampling rate: 48000Hz
Channels: 2 (Stereo)
Sample Precision: 16 bit
Audio tag: Tag 0x0001, not decodable. Microsoft PCM Format
Compression: PCM (Uncompressed)
Layout: 50 chunks (1630|0.50s preload)
Length: 241198848 samples (1:23:44.97)
Min/avg/max/total frame size: 8008/9768/96000 (477k)
Data rate: 1536 kbps (0.25% overhead)

Now the story about the audio stream...
I got rid of it entirely in one source, but I wanted a small 5 second or so audio clip from the second source so I left it in. It was suggested to me that I should extract the audio from the source, compress it as per EADFAG, import it into my project seperately, and use KillAudio() in my script, so I attempted to do so. And got a 14mb or so mp3, but unfortunately I started editing my timeline before I knew anything about AVIsynth and was editing the mjpeg that had the sound file. When I tried swapping in the Huffy with the KillAudio() filter, Premiere complained that the filetypes of the mjpeg and the Huffy don't match and wouldn't let me import the Huffy.
Would it be advisable to use the audio clip straight from the source? Or keep the seperate mp3 I created. But unless there is a way of getting around this I don't think I can kill the sound.

Put it all together and what have you got?

Frame size, fps: 512x384, 29.970 fps
Length: 10956 frames (6:05.56)
Size: 2,407,497,728 bytes
FourCC code: FourCC: [HYFU] Huffman Lossless
Decompressor: Huffyuv v2.1.1 CCESP Patch v0.2.5
Number of key frames: 10956
Min/Max/Avg/total key frame size: 147460/213824/362368 (2287758k)
No delta frames
Data rate: 51267 kbps (0.01% overhead)

Audio Stream
Sampling rate: 44100Hz
Channels: 2 (Stereo)
Sample Precision: 16 bit
Audio tag: Tag 0x0001, not decodable. Microsoft PCM Format
Compression: PCM (Uncompressed)
Layout: 1 chunks (0|0.00s preload)
Length: 16121416 samples (6:05.56)
Min/avg/max/total frame size: 170576/170576/170576 (167k)
Data rate: 1411 kbps (0.01% overhead)

First thing I want to say is that though looking at the two sources, the framerates are different, they were edited in Premiere as such and there is absolutely no timing issues with my video (anymore, thanks to those who helped me in my previous thread.)

Up to this point though, I think everything is normal.

XviD compression settings:
Any omissions of a checkbox option indicates that option is unchecked

Profile @ Level: Simple @ L5
Zones: Frame 0, Weight 1
Quantization Type: H.263

B-VOPs:
Max Consecutive BVOPs: 2
Quantizer Ratio: 1.5
Quantizer Offset: 1.0

Level:
Suggested: 720x576x30
Max frame size (macroblocks): 1620
Max processing rate (mb/s): 48600

Video Buffer Verifier:
Max buffer size (bits): 1833216
Max bitrate (kbps): 8000

Pixel Aspect Ratio: Square pixels

Full Quality First Pass

FourCC used: DX50

Motion:
Motion Search Precision: 6
VHQ Mode: 4
Use Chroma Motion


Frame Drop Ratio: 0
Maximum I-Frame interval: 300

Quantization:
Min I-Frame Quantizer: 2
Max I-Frame Quantizer: 31
Min P-Frame Quantizer: 2
Max P-Frame Quantizer: 31
Min B-Frame Quantizer: 2
Max B-Frame Quantizer: 31
Trellis Quantization

The Output
Fast recompress

Image

I look at that and I see a file of about 12.5mb when it's 10% finished. So I think "Great, my first pass is going to be about 130mb, shouldn't be too hard to get it to 95mb or so."

Now, when the dub finished, it SAID 130 or so mb in the XviD screen, but what I got was a bit different...

The First Pass

Frame size, fps: 512x384, 29.970 fps
Length: 10956 frames (6:05.56)
Size: 185,753,600 bytes
FourCC code: FourCC: [DX50] DivX5
Decompressor: XviD MPEG-4 Codec
Number of key frames: 566
Min/Max/Avg/total key frame size: 2164/25235/63471 (13949k)
Min/Max/Avg/total delta frame size: 7/10244/63674 (103946k)
Data rate: 2642 kbps (0.22% overhead)

Audio Stream
Sampling rate: 44100Hz
Channels: 2 (Stereo)
Sample Precision: 16 bit
Audio tag: Tag 0x0001, not decodable. Microsoft PCM Format
Compression: PCM (Uncompressed)
Layout: 1 chunks (22050|0.50s preload)
Length: 16121416 samples (6:05.56)
Min/avg/max/total frame size: 88200/88200/88200 (87k)
Data rate: 1411 kbps (0.03% overhead)


Now I was starting to get a little bit anxious. Things didn't look too promising but I decided to use the XviD calculator and try for a second pass.

95 x 1028 = 97660, so that's what I entered as my target size.
The other information in the calculator was:

Subtitles (kbyes): 0
Format: AVI-OpenDML
Overhead (kbytes): 1918
6 mins, 5 secs, 29.97 FPS (NTSC)
Audo format of MP3-CBR, size of 13778 kbytes

The values it gave me was:
Size(kbytes): 83696
Average bitrate (kbps): 1878

So I entered the target filesize as 83696 and prepared my second pass. Here is how it looked.

(Again, quick recompress in VirtualDubMod)

I-Frame boost (%): 10
I frames closer than... (frames): 1
Are reduced by (%): 20
Overflow Control Strength (%): 20
Max Overflow Improvement (%): 5
Max Overflow Degradation (%): 5
High Bitrate Scenes Degredation (%): 0
High Bitrate Scenes Improvement (%): 0

Image
Image

The final filesize in the XviD console indicated about 83mb. But of course things aren't always as they seem.

Frame size, fps: 512x384, 29.970 fps
Length: 10956 frames (6:05.56)
Size: 150,618,112 bytes
FourCC code: FourCC: [DX50] DivX5
Decompressor: XviD MPEG-4 Codec
Number of key frames: 566
Min/Max/Avg/total key frame size: 2164/21878/63471 (12094k)
Min/Max/Avg/total delta frame size: 7/7045/52708 (71489k)
Data rate: 1873 kbps (0.31% overhead)

Audio Stream
Sampling rate: 44100Hz
Channels: 2 (Stereo)
Sample Precision: 16 bit
Audio tag: Tag 0x0001, not decodable. Microsoft PCM Format
Compression: PCM (Uncompressed)
Layout: 1 chunks (22050|0.50s preload)
Length: 16121416 samples (6:05.56)
Min/avg/max/total frame size: 88200/88200/88200 (87k)
Data rate: 1411 kbps (0.03% overhead)


That's about all there is.
I'm very sorry if this is too much info, but I'm really at my wits end here and I have no idea what to do.
I saw in the example in EADFAG that the bitrate there was 780kbps so I tried setting that as my goal, but it ended up looking like what EADFAG said it shouldn't (lots of frames with low quantizers.)

I just want to get this video over with and put it behind me so I can get a better start on my next video. I just didn't want to have to redo my entire timeline with this video after I figured out AVIsynth.

User avatar
Scintilla
(for EXTREME)
Joined: Mon Mar 31, 2003 8:47 pm
Status: Quo
Location: New Jersey
Contact:
Org Profile

Post by Scintilla » Mon Nov 13, 2006 5:38 pm

Compress your audio. Also, try entering a target average bitrate instead of a target filesize; start at 1878 kbps, and if that produces a file that's still too big, lower it until you get the size you're looking for.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

User avatar
CrackTheSky
has trust issues
Joined: Sun Aug 27, 2006 11:01 pm
Status: Maybe editing?
Location: Chicago
Org Profile

Post by CrackTheSky » Mon Nov 13, 2006 5:42 pm

I've expereinced this nightmare before, and it's almost definitely an audio problem. I'm not sure I quite understand your story behind the audio, but if you exported your video from your editing program with the audio attached, open the .avi file in VirtualDubMod and go to "Streams>Stream List" and select the audio stream and click "Disable". Now follow the XviD compression steps that you've been following thus far...my *guess* is that the file will be significantly smaller.

Now you have to attach your audio. Follow the instructions in EADFAG to compress your audio source to an MP3. Open your compressed video file in VDM, and go to "Streams>Stream List". Click "Add" and choose your MP3 file to attach. If you need to keep the song from playing for a couple seconds beforehand (like if you have a bumper or something in your video that you're running first), right-click on the audio stream and go to "Interleaving". A menu should pop up where you can edit how long you want to delay your track. Now go to "Video>Direct Stream Copy" and save your video file.

Voila! You should now have a much smaller .avi that can be distributed here on the .org.

Ciato
Joined: Sat Jan 19, 2002 10:51 pm
Org Profile

Post by Ciato » Mon Nov 13, 2006 6:29 pm

I DID compress my audio, but I think I might have been going about it the wrong way. I compressed the audio and put it back (compressed) into the Premiere timeline, I didn't export the audio and video seperately and reunite them in VirtualDubMod.

I think I'll also be a little less hung up on 320kbps audio, 192 should be fine. I think this might work out ok.

User avatar
Scintilla
(for EXTREME)
Joined: Mon Mar 31, 2003 8:47 pm
Status: Quo
Location: New Jersey
Contact:
Org Profile

Post by Scintilla » Mon Nov 13, 2006 6:50 pm

Ciato wrote:I DID compress my audio, but I think I might have been going about it the wrong way. I compressed the audio and put it back (compressed) into the Premiere timeline, I didn't export the audio and video seperately and reunite them in VirtualDubMod.
Yyyyeah, that would explain it. Looks like when you exported from Premiere, you exported the audio as uncompressed PCM, which made it even worse than before you compressed it: not only has that audio gone through a round of compression so it doesn't sound as good, but now it's uncompressed again and therefore huge... so to get it back down to size again, you have to hit it with <i>another</i> round of lossy compression.

You generally want to leave the audio uncompressed until the very end of the encoding process. NLEs often don't like compressed audio in their timelines anyway.

Actually, you don't even have to do them separately; you can compress the audio and the video at the same time in VirtualDubMod if you want (by using the Lame ACM rather than BeSweet to compress the audio stream to MP3).
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

Ciato
Joined: Sat Jan 19, 2002 10:51 pm
Org Profile

Post by Ciato » Mon Nov 13, 2006 7:19 pm

Well, it's a decent size now.
Though what I'd consider to be a quarter billion things went wrong with this video in the technical aspect, I can tell I'm heading in the right direction, and I'll have plenty of other opportunities to get perfectly clean and crisp audio/video under 100mb :P

Thanks for your patience everyone :D

Locked

Return to “Conversion / Encoding Help”