Log in

View Full Version : GK and 2nd pass movie size incorrectly


Xleon
24th December 2004, 12:52
Hi, I'm using the latest release version of GK. I encoded two files to 350BM target size correctly and many, many more with the previous version. I'm also using the latest release XVid version.

When I went to encode a third MPEG to 350MB target size, it outputs the final file as a size between 395 and 405MB!!! I've encoded it several times with the same result. The log states it has adjusted the 2nd pass Xvid encoding run to be 356MB.

I tried setting the target size to 300MB instead and it did indeed come out to be 300MB!! So I'm lost. What could be the problem? It appears to have calculated the correct target size but final output is way out. I'm not using QPel or B frames (so it's Xcard playable)

I've included the log below.....


24/12/2004 01:21:45: Job " 1 - e3.avi" started.

o Transcode source -> MP3: W:\--conversions--\e3 MPA T01 DELAY -22ms.mpa
o Xvid - First Pass: W:\--conversions--\e3.avs
o Xvid - Second Pass: W:\--conversions--\e3.avs
o Mux Audio.
End of Job 1 ( 1 - e3.avi).
_______________________________________________________________________________________________________________________

Gordian Knot
Encoding Job Data:

Type: EncXvid_All
Container: Audio-Video Interleave (AVI)
Number: 1
Name: 1 - e3.avi
Platform: WinXP (5.1.2600).2

Files:
VirtualDubModExe: C:\PROGRA~1\GORDIA~1\VirtualDubMod\VirtualDubMod.exe
NandubExe: C:\PROGRA~1\GORDIA~1\nandub\Nandub.exe
AviFinal: W:\--conversions--\e3.avi
AviMovie: W:\--conversions--\e3_Movie.avi
AviCredits: W:\--conversions--\e3_Credits.avi
MovieFS: W:\--conversions--\e3.avs
CreditsFS:
Log : W:\--conversions--\e3.log
Stats: W:\--conversions--\e3.stats
Ecf : W:\--conversions--\e3.ecf

Options:
Quality/DRF: 0
CreditsStart: 0
UseEcf: 1
CreditsIVTC: 0
CreditsAppend: 0
DeleteInterm.: 0
EnforceBitrate: 0
AntiShit: 0

Calculator:
VideoSize: 358032 kbyte.
Audio1Size: 0 kbyte.
Audio2Size: 0 kbyte.
Overhead: 367 kbyte.
AviSize: 358400 kbyte (350 mbyte).
FilesSize: 0 kbyte.
TotalSize: 358400 kbyte (350 mbyte).
Interleaving: cbrmp3
Bitrate: 1157 k(=1000)Bits/s
Frames: 63345
FPS: 25.000
Duration: 042:14
Quality: 0.235 bits/(pixel*frame).
CompCheck3: 0.000 bits/(pixel*frame).
CompCheck5: 0.000 bits/(pixel*frame).
Resolution: 512 x 384

Audio 1:
Mode: ac3 -> mp3
SourceFile: W:\--conversions--\e3 MPA T01 DELAY -22ms.mpa
WavFile: W:\--conversions--\e3 MPA T01 DELAY -22ms.wav
Mp3File: W:\--conversions--\e3 MPA T01 DELAY -22ms.mp3
OggFile: W:\--conversions--\e3 MPA T01 DELAY -22ms.ogg
OggQuality: 0.200
OggLanguage: English
Azid: -c normal
Lame: -h --cbr -b 128
Delay: -22
Interval: 4
Preload: 500
Mux: 1
Recalc: 1
DeleteWav: 1

Audio 2:
none.


01:21:45: Started Transcoding Audio.

01:21:45: Using "BeSweet" to transcode W:\--conversions--\e3 MPA T01 DELAY -22ms.mpa
CommandLine: "C:\PROGRA~1\GORDIA~1\BeSweet\BeSweet.exe" -core( -input "W:\--conversions--\e3 MPA T01 DELAY -22ms.mpa" -output "W:\--conversions--\e3 MPA T01 DELAY -22ms.mp3" -logfile "W:\--conversions--\e3 MPA T01 DELAY -22ms.log" ) -ota( -hybridgain ) -azid( -c normal ) -lame( -h --cbr -b 128 )
01:26:52: Finished. Duration: 5 minutes, 7 seconds.

01:26:52: Audio Done.
01:26:52: MP3-File-Size is 39593 kb.
01:26:52: Audio 1, determined: 39593 kb
01:26:52: Audio 1, calc: 0 kb
01:26:52: New Bitrate for Movie = 1029 k(=1000)Bits/s

Adding this script to C:\PROGRA~1\GORDIA~1\VirtualDubMod\LastJob.vcf :

// $job "XviD First Pass"
// $input "W:\--conversions--\e3.avs"
// $output "W:\--conversions--\e3_Movie.avi"
// $state 0
// $start_time 0 0
// $end_time 0 0
// $script

VirtualDub.Open("W:\\--conversions--\\e3.avs",0,0);
VirtualDub.video.SetDepth(24,24);
VirtualDub.video.SetMode(1);
VirtualDub.video.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetRange(0,0);
VirtualDub.video.SetCompression(0x64697678,0,10000,0);
VirtualDub.video.filters.Clear();
VirtualDub.subset.Delete();
VirtualDub.SaveAVI("W:\\--conversions--\\e3_Movie.avi");
VirtualDub.Close();

// $endjob
//
//--------------------------------------------------
// $done

01:26:52: Started Xvid - First Pass: W:\--conversions--\e3.avs
02:09:10: Finished Xvid - First Pass: Duration: 42 minutes, 17 seconds.
02:09:10: Trying to open Log-file.
02:09:10: Success: Log-file open.
02:09:10: Encoded: 63344 Frames.
02:09:10: Speed: 24.966 Frames per Second.
02:09:10: New target size = 318439 Kb

Adding this script to C:\PROGRA~1\GORDIA~1\VirtualDubMod\LastJob.vcf :

// $job "XviD Second Pass"
// $input "W:\--conversions--\e3.avs"
// $output "W:\--conversions--\e3_Movie.avi"
// $state 0
// $start_time 0 0
// $end_time 0 0
// $script

VirtualDub.Open("W:\\--conversions--\\e3.avs",0,0);
VirtualDub.video.SetDepth(24,24);
VirtualDub.video.SetMode(1);
VirtualDub.video.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetRange(0,0);
VirtualDub.video.SetCompression(0x64697678,0,10000,0);
VirtualDub.video.filters.Clear();
VirtualDub.subset.Delete();
VirtualDub.SaveAVI("W:\\--conversions--\\e3_Movie.avi");
VirtualDub.Close();

// $endjob
//
//--------------------------------------------------
// $done

02:09:10: Started Xvid - Second Pass: W:\--conversions--\e3.avs
03:31:05: Finished Xvid - Second Pass: Duration: 1 hour, 21 minutes, 54 seconds.
03:31:05: Speed: 12.888 Frames per Second.

Adding this script to C:\PROGRA~1\GORDIA~1\VirtualDubMod\LastJob.vcf :

// $job "DivX5 Append"
// $input "W:\--conversions--\e3_Movie.avi"
// $output "W:\--conversions--\e3.avi"
// $state 0
// $start_time 0 0
// $end_time 0 0
// $script

VirtualDub.Open("W:\\--conversions--\\e3_Movie.avi",0,0);
VirtualDub.RemoveInputStreams();
VirtualDub.stream[0].SetSource("W:\\--conversions--\\e3 MPA T01 DELAY -22ms.mp3",0x00000202,0);
VirtualDub.stream[0].SetMode(0);
VirtualDub.stream[0].SetInterleave(1,500,4,0,-22);
VirtualDub.stream[0].SetClipMode(1,1);
VirtualDub.stream[0].SetConversion(0,0,0,0,0);
VirtualDub.stream[0].SetVolume();
VirtualDub.stream[0].SetCompression();
VirtualDub.video.SetDepth(24,24);
VirtualDub.video.SetMode(0);
VirtualDub.video.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetRange(0,0);
VirtualDub.video.SetCompression();
VirtualDub.video.filters.Clear();
VirtualDub.subset.Delete();
VirtualDub.SaveAVI("W:\\--conversions--\\e3.avi");
VirtualDub.Close();

// $endjob
//
//--------------------------------------------------
// $done

03:31:05: Started Muxing Audio.: W:\--conversions--\e3_Movie.avi
03:31:39: Finished Muxing Audio.: Duration: 34 seconds.

03:31:39: Done.
03:31:39: Movie = W:\--conversions--\e3.avi
Total Encoding Time: 2 hours, 9 minutes, 54 seconds.
24/12/2004 03:31:39: Job " 1 - e3.avi" finished.
_______________________________________________________________________________________________________________________

jggimi
24th December 2004, 16:35
These are the only 2 things I see in the log. You are not accounting for your audio size nor your overhead during initial calculations.VideoSize: 358032 kbyte.
Audio1Size: 0 kbyte.
Audio2Size: 0 kbyte.
Overhead: 367 kbyte.GK corrects the audio size procedural error and recalculates video bitrate..but it will not correct your overhead error. Here's where it corrects your missing audio size estimation:01:26:52: Audio Done.
01:26:52: MP3-File-Size is 39593 kb.
01:26:52: Audio 1, determined: 39593 kb
01:26:52: Audio 1, calc: 0 kb
01:26:52: New Bitrate for Movie = 1029 k(=1000)Bits/sSee http://www.doom9.org/gknot-main5.htm for discussions of audio size estimation, overhead setting, and compressibility testing.

You are not doing compressibility tests:CompCheck3: 0.000 bits/(pixel*frame).
CompCheck5: 0.000 bits/(pixel*frame).so it is possible to have under or over size results. See http://forum.doom9.org/showthread.php?s=&threadid=24584. It is applicable to MPEG-4 codecs generally, even though its DivX focused.

Xleon
24th December 2004, 16:41
Thanks, you've been very helpful. I'll read and digest all that.

I'm confused as to why GK didn't put my audio overheads in the log as I asked it to take in to account a CBR MP3 interleaved at 4 frame intervals (not 1). On the main bitrate screen it showed these details and I assumed it was those that it used in the calculations.

Do I actually have to point GK at the MPA file as well as giving it the details on the format / interleaving?

(Merry Xmas).

jggimi
24th December 2004, 16:43
4 frame intervals? Then you may be accounting for overhead properly. My misreading of your log, then.

And no, you don't have to point to the current mpa file. All you need do is set your estimated bitrate to 128kbps in the Audio A box. But as I stated, GK corrects for this error. It will make a difference when you begin compressibility testing, though.

Xleon
24th December 2004, 17:10
Cheers.

My first compressability test has reported back (150% ish!!), and I've adjusted the settings in GK to reach the 40 to 60% the guide suggested (I chose 50%). That gives me an AVI which is 1024 x768 pixels when the original is only 704 x 576 ?! (and that pushes the H and V zoom figures in to the red). Moving it the other way to prevent them from reporting red, the bits/frame percentage box goes red. I doesn't report a setting where GK is happy with the figures. First MPEG I've seen that gives such strange results.

Xleon
24th December 2004, 17:18
Ah, I think I know what it might be (should of checked first, though I've learned a lot from this)...

The TMPEG DVD Authored MPEG has actually turned out shorter than the run time it should of been. It's 1/2 in fact. Maybe it's where the corrections are quite large to fill 350MB with a 26minute file.