Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: QT 6.3 automatic encoding w/foobar - solution (Read 12069 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

QT 6.3 automatic encoding w/foobar - solution

You need:

1. QT 6.3 Pro (registered) and tweaked to encode mp4 as you want (bitrate etc)
2. Foobar (tested 0.7 rc6)
3. AutoIt (v2.64) http://www.hiddensoft.com/AutoIt/
4. this autoit script compiled into exe (with autoit script compiler)

Code: [Select]
FileCopy, %1%,C:\\temp.wav
FileDelete, %1%
run,c:\\Program Files\\QuickTime\\QuickTimePlayer.exe c:\\temp.wav
WinWait,temp.wav
WinActivate,temp.wav
Send,^e
WinWaitActive,Save exported file as:
Send,c:\\temp.mp4{Enter}
WinWaitClose,,Exporting
WinActivate,temp.wav
Send,^w
WinWaitClose,temp.wav
Sleep,6000
FileCopy, C:\\temp.mp4, %2%
FileDelete, C:\\temp.mp4
FileDelete, C:\\temp.wav


Foobar set to encode CLI as follows:
ext: mp4
command: c:\code\qtauto.exe %s %d

For me it works perfect. (Athlon-1400, for slower systems you may need to change 6000 to bigger value)

I can browse inet in background, etc.

ps. this doesn't preserve tags, use foobar's masstagger after conversion.

(my masstagger is configured as below:
ADD:guess values from filename %tracknr%. %title%
ADD:format value from other fields:ALBUM:$right($directory(%_path%,1),$sub($len($directory(%_path%,1)),5))
ADD:format value from other fields:YEAR:$left($directory(%_path%,1),4)
ADD:format value from other fields:ARTIST:$directory(%_path%,2)
ADD:format value from other fields:GENRE:$directory(%_path%,3)

for ephpod use, you may need to add another field:
ADD:format value from other fields:iTunNORM:0)

QT 6.3 automatic encoding w/foobar - solution

Reply #1
Thanks, I gotta try this. Innovative posts like this are very much appreciated.
Juha Laaksonheimo

QT 6.3 automatic encoding w/foobar - solution

Reply #2
nice!
any way of doing the same thing with nero's aac encoder ?

QT 6.3 automatic encoding w/foobar - solution

Reply #3
for nero's aac, try to read autoit help.

personally i'll stick with apple for mp4 ('cause i own ipod).

QT 6.3 automatic encoding w/foobar - solution

Reply #4
If i add  ITUNNORM = 0)  or not EphPod don't recognize the tag.  Why?

QT 6.3 automatic encoding w/foobar - solution

Reply #5
Quote
ps. this doesn't preserve tags, use foobar's masstagger after conversion.

If you have recent version of clienc you can make it tag the files too, just configure tag type to 'default' and foo_mp4 will be called to do the tagging.

QT 6.3 automatic encoding w/foobar - solution

Reply #6
Just wondering, why hasn't anyone used the QuickTime SDK to write an exporter? As an added bonus, it would allow you to encode AAC with an unregistered version of QuickTime.

There's some sample code available, but it's mac specific. It should be a good starting point, though.

QT 6.3 automatic encoding w/foobar - solution

Reply #7
zeer... THANK YOU  I just did everything you said and it worked perfectly on my 2.53Ghz P4 machine  Thank you so so much for your guide.

[edit]
Wow!  Thank you so much!  Because of this guide I am now able to batch encode my entire CD collection, which I have stored on my computer in the Monkey's Audio format, into Quicktime AAC/MP4 files without decoding all 702 APE files to WAV's then individually encoding each WAV to MP4 then tagging the MP4's in Foobar!  With this it takes one click! F**kin A!  Thanks!

p.s.  Anyone know an easy way to mass-rename all my files from .mp4 to .m4a so I don't have to do it manually before I put it on my iPod?  Is there maybe a simple little addition to the code zeer provided above that would do this automatically?  I'm not even close to being a coder so I really have no idea

QT 6.3 automatic encoding w/foobar - solution

Reply #8
This is good stuff!   

The same script also works with EAC.

QT 6.3 automatic encoding w/foobar - solution

Reply #9
Quote
p.s.  Anyone know an easy way to mass-rename all my files from .mp4 to .m4a so I don't have to do it manually before I put it on my iPod?

If all files are in the same folder: "rename *.mp4 *.m4a" in command window
If the files are in different folders (one possible solution): use Total Commander and search for *.mp4 -> feed to listbox -> select all -> Multi-Rename Tool -> ...

Edit. Or even easier:  use Total Commander and search for *.mp4 -> feed to listbox -> select all -> F6 Move -> "*.m4a"

QT 6.3 automatic encoding w/foobar - solution

Reply #10
Oh duh.  I can't believe I didn't think of this until now.  In Foobar, under "Preferences/Components/Diskwriter/CLI encoder", simply put .m4a in as the desired "extension" instead of .mp4.  I just tried it out and it worked perfectly

QT 6.3 automatic encoding w/foobar - solution

Reply #11
Call me retarded, but I'm failing to see where in quicktime 6.3 pro I can adjust the bitrate, etc. for the ACC encode.  Anyone wanna help me out?

QT 6.3 automatic encoding w/foobar - solution

Reply #12
Quote
Call me retarded, but I'm failing to see where in quicktime 6.3 pro I can adjust the bitrate, etc. for the ACC encode. Anyone wanna help me out?


You will first need to select File>Import to import a WAV.  Then in the new window select File>Export and a window fill appear with a file directory and an options button at the bottom.  Firstly select the export filetype as MP4 (quicktime MP4 or something like that) then select the options button.  There will be option settings for General, Video, Audio, and Streaming.  Select Audio and from there you can select the bitrate and the encode quality.  I tried all 3 (good, better, and best) and didn't notice a difference in encode speed so I stuck with best quality.  Everytime you use Quicktime it will default to whatever settings you used last.

QT 6.3 automatic encoding w/foobar - solution

Reply #13
Edit, nevermind I've figured most of it out with a bit of trial and error. 

Thanks RIV@NVX.

QT 6.3 automatic encoding w/foobar - solution

Reply #14
Quote
At the moment for example, 10-No Surprises.wav generates a file with the name 001 10-No Surprises.mp4 Why is it adding '001'?

Because you still have $num(%_diskwriter_index%,3) in title formatting for output file name.

QT 6.3 automatic encoding w/foobar - solution

Reply #15
Does it work with foobar2000 0.7 final ?
I tried (sorry, I totally missed this topic) today, but my system became silly (100% CPU, need to reboot). I tried different things, but nothing works properly.

Quote
ext: mp4
command: c:\code\qtauto.exe %s %d


Sorry, but I have :
ENCODER :
EXTENSION :
PARAMETERS :

I tried to fill ENCODER with the path, with the path %s %d, with nothing ; and PARAMETERS with %s %d, path + %s %d, etc..;

I'm running with WinXPSP1, QT 6.3 english, foobar2000 0.7 final and CLI diskwriter bundled with le latest special installer.
Thank for help
Wavpack Hybrid -c4hx6

QT 6.3 automatic encoding w/foobar - solution

Reply #16
For me it worked with

Encoder: c:\code\qtauto.exe
Extension: mp4
Parameters: %s %d

Also, make sure that on the Diskwriter tab, Output format is set to CLI encoder. The first time I tried it was set to the default setting (WAV (PCM 16bit undithered)) and I too couldn't figure out why it wasn't working.

Hope this helps
Happiness - The agreeable sensation of contemplating the misery of others.

QT 6.3 automatic encoding w/foobar - solution

Reply #17
Thank for answer.
I made some progress by changing thread priority

Unfortunately, I have an error with the setting you gave me :
" Couldn't open the file"temp.wav" because the sound information was in a bad or damaged format "
I don't understand why...
Wavpack Hybrid -c4hx6

 

QT 6.3 automatic encoding w/foobar - solution

Reply #18
It works now. I recompiled another time the script, change the path, and encoding are fine. Tagging too. Whooww !!!
Thank you zeer, case, Peter for these nice tools, and rpop for your help
Wavpack Hybrid -c4hx6

QT 6.3 automatic encoding w/foobar - solution

Reply #19
edit: nevermind you beat me to it

QT 6.3 automatic encoding w/foobar - solution

Reply #20
Quote
guruboolez - I had the same problem at first.  Look in the directory where foobar extracts the temp wav file and delete any trashed or temp wav files.  That should fix it.

That's maybe the answer of my problem : I deleted some wave file before recompiling the script. Nice to know the tip. Thanks
Wavpack Hybrid -c4hx6

QT 6.3 automatic encoding w/foobar - solution

Reply #21
Is this method different than using the FAAC encoder diskwriter plug-in in foobar2000 0.7 special?