Wiki source for Tips


Show raw source

======Tips & Tricks======



<<{{{toc title="Table of Contents" levels="h2,h3,h4,h5"}}}<<::c::
=====Tutorials=====
Make sure you have read the tutorials in this wiki: [[TaggerPanel|Tagger Panel]], [[AlbumList|Album List view]]

=====Did you know that...=====
- you can start the script and foobar2000 will get launched if not already running?
- there are text-files in the folder of foobar2000.exe, that contain last analysis results per target?
- you can edit or comment any page in this wiki to add your own tips? Just sign up as a new user! :-)

=====Automatic sync when your target gets connected with USBDLM=====
can be archived with the freeware [[http://www.uwe-sieber.de/usbdlm.html|USBDLM]]. A really great tool that manages drive letters for USB devices. You should check it out even if you are not interested in an automatic sync.

Here is a sample section, showing how to configure the sync in USBDLM.INI
%%[DriveLetters29]
Letters=GHIJ

;Start FoobarSync if FoobarSync.flag exists on drive
[OnArrival13]
FileExists1=%Drive%\""FoobarSync"".flag
open1=c:\windows\system32\cmd.exe /k cscript "c:\foobar\Sync.vbs" tasks=mp runid=%root%
open2=%usbdlmpath%\usbdlm.exe -balloon -time=4000 -title="FOOBAR SYNC %FriendlyName%" -text1="FOOBAR SYNC for %root% (%FriendlyName%)" -icon=113 -onclick=%windir%\explorer.exe %root%
%%

=====""FFmpeg knowledge""=====
FFMPEG is a very very powerful tool. So do not expect deep knowledge from me! But for audio conversion with ""FoobarSync"" I can provide you the following hints:

First, here are some command line examples:
- ''ffmpeg.exe -i "c:\infile.m4a" -c:a speex -ab 30000 d:\outfile.spx''
- ''ffmpeg -i "c:\infile.m4a" -vn -c:a libvorbis -q:a 6 d:\outfile.ogg''
- ''ffmpeg -i "d:\infile.mp3" -vn -c:a libopus -ac 2 -ab 200k d:\opustest.ogg''

... and here are some explainations about their meaning:
-c:a <codec> select codec for audio, (speex,libvorbis,aac_he_v2,...)
-vn video none (do not encode any video streams)
-ab <n> average bitrate (numberformat depends on codec!), ex. -ab 150k
-ac <n> number of audio channels, ex. -ac 2
-q:a <n> quality level <n> for audio, ex. -q:a 5

Detailed codec-specific command-line options are listet in the [[https://www.ffmpeg.org/ffmpeg-codecs.html#Audio-Encoders|FFmpeg Codecs Documentation]].

I also recomment to read this [[https://trac.ffmpeg.org/wiki/Encode/HighQualityAudio|FFmpeg Guidelines for high quality lossy audio encoding]].

=====Some codec knowledge=====

====""MP3""====
Is very well known and supported by 99.9% on all targets. But this codec is the oldest too and there are some better ones, which provide higher quality at the same bitrates. Beside that, there are codecs for special needs and purposes: use very limited bitrate, low latency on networks, low CPU consumption on decode, special frequencies (human speach) ...

- only one __audio__ stream is supportet (no need for option -vn)
- MP3 does not have multichannel support
- use variable bitrate for better quality (-ab)

====Vorbis====
Is - what I know - the successor of MP3. I really recomment this codec, if your targets can play it. It uses OGG as container format, has a better quality than MP3 is quick to encode and doesn't consume much CPU power when decoded.
- Use -vn to supress any existing video stream (OGG can have multiple video/audio streams)
- Use -ac 2 to downsample to stereo. If you want to sync multichannel: Tell me if it works. I didn't try!
- Vorbis does not provide a "//real//" variable bitrate! Vorbis will ALWAYS use a quality-setting! There is no way to forecast the bitrate. You also should know, that Vorbis will put a bitrate-label on the audio stream. But this label simply bound to the quality setting - look at the table below.
- This is why you **must **use //[[ffprobe|FFprobe]]// or a //fileprefix// within //SyncRules//.

|=|Vorbis quality|=|label in stream|=|Vorbis quality|=|label in stream||
||-q 0||?||-q1||80 kbit/s||
||-q 2||96||-q 3||112||
||-q 4||128||-q 5||160||
||-q 6||192||-q 7||224||
||-q 8||256||-q 9||320||
||-q 10||500|| || ||
**Be aware, that due to past and future improvements in Vorbis, your final bitrate will be ca. 10 % less.**

====Opus====
is - what I think - the best codec out there. But it is not supported on most targets. My Android 4 device did have no native support. And because Opus needs some CPU power while decoding my [[Rockbox|Rockbox-based]] Ipod Video did not decode in realtime.

====""AAC-LC""====
is also very common and well known on targets. It should provide slightly better quality then MP3.

====""AAC-HE""====
Should (!) be a good codec for low bitrates but as I know there are problems because of patents. ""AAC-HE"" is supported by the official FFmpeg binaries (library //aac_he_v2//), **but **it is known to give bad quality. I've testet it and must say: Yes, quality IS bad. :-) If you need very low bitrates use other codecs where possible or get your hands on a FFmpeg binary with a better library. If you found such library and it is legal, please let me know!

====SPEEX====
is a special purpose codec for spoken content that is supported on few targets like [[Rockbox|Rockbox Player]]. You can get very low bitrates with a good quality. Very nice for audio books, but as soon as there are some environmental sounds or some music, quality will be bad.


=====Run ID-files at doubleclick=====
Want to make synchronization happen, when you double-click an *.id file in explorer?

**You can make life easier with following steps:**
1) Open a command prompt
1) Run %%assoc .id=FoobarSync%%
1) Run %%ftype FoobarSync=cmd /k ""c:\windows\system32\cscript.exe" //NOLOGO "E:\User Shell Folders\kNiL\Foobar\sync.vbs" Tasks=mp RunId="%1""%%


=====Run scripts easier=====
As soon as you often run ""FoobarSync"" manually from command line you'll get nerved to have "cscript" added as prefix.

**You can make life easier with following steps:**
1) Open a command prompt
1) Run %%ftype VBSFile=cmd /c ""c:\windows\system32\cscript.exe" //NOLOGO "%1" %*"%%

From now on you sould be able to run any VBS-scripts directly from command prompt.

**Test changes with ""FoobarSync""...**
1) Open a command prompt
1) Navigate to location of sync.vbs
1) Run %%sync.vbs /help%%

**Read carefully before you do this**:
- I set this up on Windows 7 x64 successfully with administrator rights. Maybe you need such special rights!
- Other versions of Windows may need different setup!
- You may have some existing registery entries, which point to .vbs-files. In most cases their assignment will have a higher priroity and you will need to delete/change them. If you do any changes in registery, make sure to leave ''HKEY_CLASSES_ROOT\.vbs -> (Standart) "VBSFile"'' untouched and export keys before modification!

----
- Check out the other Pages, that belong to the wiki-category [[Documentation]] !
- Ask and discuss at the [[http://www.hydrogenaud.io/forums/index.php?showtopic=108834|FoobarSync discussion thread on Hydrogenaudio Forums]]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki