Different file size?

Discussion of the cross-platform HandBrake command line interface (CLI)
Forum rules
Activity Log is required for support requests. See Must Read: How To Get Questions Answered on These Forums for details
Tobbev
Posts: 6
Joined: Fri Nov 27, 2009 6:57 am

Different file size?

Postby Tobbev » Wed May 19, 2010 7:01 pm

Hi

I tried out the CLI to convert files for my iPod Touch. I tried to reproduce the settings I have in my custom made GUI preset.

I took screenshots from the GUI so you can see my settings:

Image

Image

Image

Image

Click the images to get them larger, and click again to get them even larger in the window that opens.

when I use these settings the resulting file becomes 189 MB (199 188 838 bytes)

The CLI command I have used is as follows:

HandBrakeCLI -i File.mkv -o File.mp4 --quality 0.6078 --encoder x264 --ab 128 --maxWidth 480

The resulting file then becomes 168 MB (176 328 846 bytes)

I dont see what I do different in the GUI compared to the CLI, but I must have forgotten something.

Anyone can see the error?

Best regards

Tobbe, Sweden

mduell
Veteran User
Posts: 4929
Joined: Sat Apr 21, 2007 8:54 pm

Re: Different file size?

Postby mduell » Wed May 19, 2010 8:56 pm

Instead of incomplete screenshots how about you post encoding logs from both like the forum rules at the top of every page tell you to.

rkillcrazy
Posts: 20
Joined: Fri Apr 10, 2009 9:44 pm

Re: Different file size?

Postby rkillcrazy » Fri Mar 02, 2012 12:57 am

I too am having the same issue. I've tweaked the preset "High Profile" to my liking. I did this because creating my own preset didn't produce any better results. When I open the GUI and choose that preset, I create the MP4s without issue. However, when I call the preset in a batch file, it creates the MP4s but they end up smaller - leading me to believe I've lost quality in my batch process.

Tweaked presets.xml file.

Log from manual process via the GUI which produces a 1.84-GB MP4.

Log from batch creation process which produces a 1.28-GB MP4.

Windows Batch File

Code: Select all

@ECHO off
:: Last modified: 2012-03-01

SETLOCAL
SET _HandBrake=%ProgramFiles%\HandBrake\HandBrakeCLI.exe
SET _source=C:\temp\MainMovie
SET _destination=C:\temp\MainMovie

:: Using a FOR loop, processes raw rips to mp4 files.
:: Example: Rip DVD's raw VOB files to a folder named "Avatar (2009)" and running this command will spit out "Avatar (2009).mp4."
FOR /D %%V IN ("%_source%\*") DO "%_HandBrake%" --preset="High Profile" --markers --subtitle scan --subtitle-forced -i "%%V" -o "%_destination%\%%~nV.mp4"


::Using a FOR loop, processes ISOs to mp4 files.
::Creates "Avatar (2009).mp4" from "Avatar (2009).ISO."
FOR %%V IN ("%_source%\*.iso") DO "%_HandBrake%" --preset="High Profile" --markers --subtitle scan --subtitle-forced -i "%%V" -o "%_destination%\%%~nV.mp4"
IF %errorlevel%==0 (GOTO EOF) ELSE (GOTO ERROR)

:Error
ECHO Something bad happened.  Check your script, files and paths.
PAUSE
:EOF
ENDLOCAL

User avatar
Rodeo
HandBrake Team
Posts: 11318
Joined: Tue Mar 03, 2009 8:55 pm

Re: Different file size?

Postby Rodeo » Fri Mar 02, 2012 1:15 am

Please provide the full log for the GUI encode.

rkillcrazy
Posts: 20
Joined: Fri Apr 10, 2009 9:44 pm

Re: Different file size?

Postby rkillcrazy » Fri Mar 02, 2012 11:38 am

Rodeo wrote:Please provide the full log for the GUI encode.


Sorry; I thought I did... Where is it if it's not one of the two I submitted? I see several in "%appdata%\HandBrake\logs" but I thought I had what I needed.

rollin_eng
Veteran User
Posts: 1508
Joined: Wed May 04, 2011 11:06 pm

Re: Different file size?

Postby rollin_eng » Fri Mar 02, 2012 11:54 am

rkillcrazy wrote:Log from manual process via the GUI which produces a 1.84-GB MP4.


This log is incomplete, can you make sure you copied it all to pastebin.

rkillcrazy
Posts: 20
Joined: Fri Apr 10, 2009 9:44 pm

Re: Different file size?

Postby rkillcrazy » Fri Mar 02, 2012 12:05 pm

rollin_eng wrote:
rkillcrazy wrote:Log from manual process via the GUI which produces a 1.84-GB MP4.


This log is incomplete, can you make sure you copied it all to pastebin.


I've since deleted all the logs from that directory. I'm currently creating an MP4 via the GUI. When that's done, I will attempt to create the same MP4 via my script. Between those two operations, I will be collecting ALL logs inside that directory and if those aren't complete, I'll be at a loss....

rkillcrazy
Posts: 20
Joined: Fri Apr 10, 2009 9:44 pm

Re: Different file size?

Postby rkillcrazy » Fri Mar 02, 2012 1:14 pm

Here are the new logs for the GUI:
The Smurfs (2011)_GUI
The Smurfs (2011)_GUI - last_scan
The Smurfs (2011)_GUI - last_encode

Oddly enough, the batch file never dumped anything in that directory.

At any rate, the process was still the same. The same batch file was used... The GUI produced a 2.43-GB file whereas the batch file produced 1.70-GB file.

rollin_eng
Veteran User
Posts: 1508
Joined: Wed May 04, 2011 11:06 pm

Re: Different file size?

Postby rollin_eng » Fri Mar 02, 2012 1:36 pm

We need to see 2 complete logs for the same movie to figure out the issue.

So far we have a batch log for bridesmaids and a gui log for smurfs.

rkillcrazy
Posts: 20
Joined: Fri Apr 10, 2009 9:44 pm

Re: Different file size?

Postby rkillcrazy » Fri Mar 02, 2012 4:06 pm

rollin_eng wrote:We need to see 2 complete logs for the same movie to figure out the issue.

So far we have a batch log for bridesmaids and a gui log for smurfs.


Here are the new logs for the GUI:
Bridesmaids (2011)_GUI
Bridesmaids (2011)_GUI - last_scan
Bridesmaids (2011)_GUI - last_encode

rollin_eng
Veteran User
Posts: 1508
Joined: Wed May 04, 2011 11:06 pm

Re: Different file size?

Postby rollin_eng » Fri Mar 02, 2012 4:14 pm

Your batch and gui encode look the same size to me.

Batch:

282.[08:40:07] mux: track 0, 179802 frames, 1405999411 bytes, 1499.79 kbps, fifo 4096
283.[08:40:07] mux: track 1, 234366 frames, 419983872 bytes, 448.00 kbps, fifo 4096
284.[08:40:07] mux: track 2, 351549 frames, 149746203 bytes, 159.74 kbps, fifo 8192

GUI:

282.[10:39:17] mux: track 0, 179802 frames, 1405999411 bytes, 1499.79 kbps, fifo 4096
283.[10:39:17] mux: track 1, 234366 frames, 419983872 bytes, 448.00 kbps, fifo 4096
284.[10:39:17] mux: track 2, 351549 frames, 149746203 bytes, 159.74 kbps, fifo 8192

rkillcrazy
Posts: 20
Joined: Fri Apr 10, 2009 9:44 pm

Re: Different file size?

Postby rkillcrazy » Fri Mar 02, 2012 4:22 pm

rollin_eng wrote:Your batch and gui encode look the same size to me.



WTF!? Yeah, you're right...... Now I'm on this side of the fence! :oops: I'm in IT and I've lost count of how many times someone has described an issue to me, went to duplicate it in front of me and then couldn't.

I'll watch it with a few more and will report back as needed. However, the last time I fired off my batch file, it never dumped anything in that logs directory. Does the CLI not drop logs or do they drop them elsewhere? What could cause logs not showing up?

rollin_eng
Veteran User
Posts: 1508
Joined: Wed May 04, 2011 11:06 pm

Re: Different file size?

Postby rollin_eng » Fri Mar 02, 2012 4:27 pm

I dont use the cli directly so im not sure, but I thought the cli creates the same logs. Maybe someone else can answer that.

User avatar
Rodeo
HandBrake Team
Posts: 11318
Joined: Tue Mar 03, 2009 8:55 pm

Re: Different file size?

Postby Rodeo » Fri Mar 02, 2012 5:50 pm

CLI logs are written to standard error.

rkillcrazy
Posts: 20
Joined: Fri Apr 10, 2009 9:44 pm

Re: Different file size?

Postby rkillcrazy » Fri Mar 02, 2012 6:02 pm

Rodeo wrote:CLI logs are written to standard error.


So, if it's using stderr, I should be able to redirect it right? If so, how so? I'd tried adding >> some_text_file.txt to the end of the command but it looks more like it spits out general progress of the creation (10% complete, 15% complete, etc.) but not the actual nitty-gritty of the work being done.

User avatar
Rodeo
HandBrake Team
Posts: 11318
Joined: Tue Mar 03, 2009 8:55 pm

Re: Different file size?

Postby Rodeo » Fri Mar 02, 2012 6:32 pm

That's redirecting stdout.

Try 2>> /path/to/some/file

rkillcrazy
Posts: 20
Joined: Fri Apr 10, 2009 9:44 pm

Re: Different file size?

Postby rkillcrazy » Fri Mar 02, 2012 7:46 pm

Okay, there's definitely a difference between these files. Maybe I had the wrong log file last time. I've dropped in the redirect. I've got the batch running & dumping to a new log file for each MP4. When that's done, I'm going to do a few via the GUI. It may take a while so I'll get the info back up here as soon as I can.

rkillcrazy
Posts: 20
Joined: Fri Apr 10, 2009 9:44 pm

Re: Different file size?

Postby rkillcrazy » Mon Mar 05, 2012 1:17 pm

Okay, here's one....

GUI = 2.43-GB
CLI = 1.70-GB

rollin_eng
Veteran User
Posts: 1508
Joined: Wed May 04, 2011 11:06 pm

Re: Different file size?

Postby rollin_eng » Mon Mar 05, 2012 1:38 pm

GUI RF = 17
CLI RF = 20

This might be the cause.

rkillcrazy
Posts: 20
Joined: Fri Apr 10, 2009 9:44 pm

Re: Different file size?

Postby rkillcrazy » Mon Mar 05, 2012 1:46 pm

rollin_eng wrote:GUI RF = 17
CLI RF = 20

This might be the cause.


Which makes sense. However, the batch file calls the high profile preset and the GUI is set to use it as well. Why would they differ if they are supposed to call the same preset - with the same quality setting?

rollin_eng
Veteran User
Posts: 1508
Joined: Wed May 04, 2011 11:06 pm

Re: Different file size?

Postby rollin_eng » Mon Mar 05, 2012 1:55 pm

I seem to remember reading that the cli cannot use custom presets, perhaps a dev can confirm.

rkillcrazy
Posts: 20
Joined: Fri Apr 10, 2009 9:44 pm

Re: Different file size?

Postby rkillcrazy » Tue Mar 06, 2012 8:25 pm

rollin_eng wrote:I seem to remember reading that the cli cannot use custom presets, perhaps a dev can confirm.

Oh, and it's not a custom one... It the default "High Profile" preset though I did tweak the XML a little to reflect the 17 in lieu of 20 on the quality setting. Again, the preset works in the GUI and doesn't give me fits in any way at all. Although I may have edited the XML to reflect the quality setting, HB shouldn't care, right? After all, it just calls the preset and uses what's in there, right?

rollin_eng
Veteran User
Posts: 1508
Joined: Wed May 04, 2011 11:06 pm

Re: Different file size?

Postby rollin_eng » Tue Mar 06, 2012 8:36 pm

I think the presets are baked into the cli and cannot be changed.

rkillcrazy
Posts: 20
Joined: Fri Apr 10, 2009 9:44 pm

Re: Different file size?

Postby rkillcrazy » Tue Mar 06, 2012 8:40 pm

rollin_eng wrote:I think the presets are baked into the cli and cannot be changed.


Then, what's the point of the XML if it's all baked in? Seems like something you could just set a switch/argument for.

In either case, I've reverted the XML back to 20 and am testing it again.

rollin_eng
Veteran User
Posts: 1508
Joined: Wed May 04, 2011 11:06 pm

Re: Different file size?

Postby rollin_eng » Tue Mar 06, 2012 8:42 pm

The xml is for the gui. You can set all your encoding switches in the cli.


Return to “Command Line Interface”