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: FoobarSync - official disussion thread (Read 16302 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

FoobarSync - official disussion thread

Reply #25
Hey,

im still trying to get FoobarSync to work. After I finally edited my config, I wondered why nothing is copied to my specified destination. Only the FLAG files were copied and not deleted. I recognised as well that it is not possible to see any analysis results like it should. Seemed like the script ended too early without any error message even with Debuglevel=5...

Only after I changed the tasks from "mptr" to "mpt" and added a runid="L:\" cmd had an error for me:

Code: [Select]
C:\windows\system32>cscript "C:\Program Files (x86)\foobar2000\sync.vbs" tasks=mpt Debuglevel=5
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

FB-Home is:C:\Program Files (x86)\foobar2000


FOOBARSYNC 0.9.9 - Sync MediaLibrary and Playlists from foobar2000 to targets
http://foobarsync.lima-city.de

*** PROCESSING 'L:\foobarSYNC.id' (SansaClip+)
    OPTIONS..: TEST, MediaLibrary, Playists

  Preparing: setting attributes on target...
  Medialib.: there are 14424 items in Medialibrary
  Medialib.: analysed 3 items in 30.11.1999 00:00:02 (3 items/s)
  Playlists: there are 55 playlists with 42566 items in foobar2000
C:\Program Files (x86)\foobar2000\sync.vbs(175, 2) Microsoft VBScript runtime error: Invalid procedure call or argument: 'left'


I looked for the indicated argument:
   
Code: [Select]
[#175] wscript.StdOut.write s&left(SCstr,79-len(s))&left(BSstr,79-len(s))

and after I changed it to
Code: [Select]
[#175] wscript.StdOut.write s


the analysis shows up and Im even able to copy tracks to the specified destination.

I dont know what the left-argument is about. Is it necessary? Why is it buggy? Help is appreciated. Thanks:)

FoobarSync - official disussion thread

Reply #26
Hi matzekatze! Guess you found a bug 

I dont know what the left-argument is about. Is it necessary? Why is it buggy? Help is appreciated. Thanks:)

Line #175 gives any (!) output to the console. I gave the script a very fancy output like progress calculations and so on, thats why it is quite difficult to guess whats going wrong.

If you like to help to find the error, do the following modifications and send me the output via PM.
  • Insert a line with wscript.StdOut.write "~"&s before line 175.
Script should aferwards look like this:
Code: [Select]
[#175] wscript.StdOut.write "~"&s
[#176] wscript.StdOut.write s&left(SCstr,79-len(s))&left(BSstr,79-len(s))

Thank you.

Re: FoobarSync - official disussion thread

Reply #27
Thanks for this.

Does this work with a portable install. I cannot seem to connect to the Comserver or do I install the server to the portable path. I'm afraid to do this as there's already a COMServer2Helper.exe file in there.

Here's the output from: cscript sync.vbs tasks=mptr

Code: [Select]
W:\Apps (Portable)\Music Apps\foobar2000>cscript sync.vbs tasks=mptr
FB-Home is:W:\Apps (Portable)\Music Apps\foobar2000

FOOBARSYNC 0.9.9 - Sync MediaLibrary and Playlists from foobar2000 to targets
http://foobarsync.lima-city.de

Searching for configuation files in root of drives D-Z...
*** PROCESSING 'D:\tutorial.id' (Synchronization tutorial)
WARNING:No connection to foobar2000! Foobar Comserver not set up correctly?
FOOBARSYNC ENDS NOW.

W:\Apps (Portable)\Music Apps\foobar2000>

Re: FoobarSync - official disussion thread

Reply #28
Does this work with a portable install. I cannot seem to connect to the Comserver or do I install the server to the portable path. I'm afraid to do this as there's already a COMServer2Helper.exe file in there.

Hello Stevehero,

I stopped development of "Foobar-Sync" with Version 0.9.9 but I still use my tool to assemble and sync audiofiles & playlists across multiple devices.
Because I don't have any additions/changes to my media-files anymore, I am still at Foobar V.1.3.7 (portable).
So my usage is limited to Foobar-Sync and management of the media I like to sync.

I think there were significant changes after 2015 in the Foobar API and the way developers can add code. Existing plugins had a problem in theese days and many developers rejected to obey the new rules.
Therefore I am not sure if Foobar-Sync can run at newer versions.

BUT:
If
"COM Automation Server" (foo_comserver2) can run with newer Versions, all should be fine.

So we should focus on COMServer !

  • "COMServer2Helper.exe" is in my portable Foobar-folder too.
  • I used "foo_comserver2-0.7-setup.exe" for my old portable Foobar.
  • I can see a help-file in .\Foobar\comserver2\help.

Also I found a note about issues in my chaos. The snipples seems from here: https://hydrogenaud.io/index.php?topic=39946.0
Quote
Known installer issues

The uninstallation function fails to remove some information from the registry. The following batch file can be used to remove the entries in question from the registry:

Code: [Select]

reg delete HKCR\TypeLib\{CB8F14D8-736E-4BB7-ADCF-BE26C39B576B} /f
reg delete HKCR\CLSID\{1bffc1e4-21a6-45af-8831-5ee045281633} /f
reg delete HKCR\Foobar2000.Application.0.7 /f

Coming back to your issue I would try following things:
  • uninstall COMServer
  • remove reg-entries (issue descriped above)
  • move your portable foobar folder to a path without spaces any special characters (I think I had issues with that in the past!)
  • install COMServer, make sure you install it to the portable location because setup defaults to the "regular" installation path of foobar!

Please try that first and report back.

Good luck!
Andreas

Re: FoobarSync - official disussion thread

Reply #29
Thanks for the reply.

I've created a new portable install and found that it is indeed the whitespace in the path that is the issue.

This worked:
C:\Users\username\Desktop\foobar2000

This did not:
C:\Users\username\Desktop\foobar2000 space

Re: FoobarSync - official disussion thread

Reply #30
Just a few questions:

1. Is there a way to convert lossless files only and transfer mp3 over? My files are either FLAC or MP3.
 
2. I don't seem to get how the convertFormat sections works and how to set it up for FLAC to MP3.
Currently, the file that appears in the folder is:
    filename_q2.OGGFLAG

I've taken a look at https://foobarsync.lima-city.de/wikka/SyncRules but can't quite understand how to set it up for my needs.

3. Is there a way to embed the folder.jpg that resides in the folder where the file is? I know this can be done with metaflac.exe --ti "pathto/folder.jpg"

Re: FoobarSync - official disussion thread

Reply #31
1. Is there a way to convert lossless files only and transfer mp3 over? My files are either FLAC or MP3.
Code: [Select]
SyncRules=FLAC*0*MP3_160
SyncRules=*0*copy

Read on to understand the two lines.

2. I don't seem to get how the convertFormat sections works and how to set it up for FLAC to MP3.

Example:
Code: [Select]
SyncRules=$if($greater($strstr(%KNI_SYNC%,'Wecker'),0),'T')*0*Vorbis_q2
SyncRules=IT*0*copy
SyncRules=MOD*0*copy
SyncRules=669*0*copy
SyncRules=XM*0*copy
SyncRules=*<115*copy
SyncRules=*>115*Vorbis_q2

Important:
Syncrules are processed from top to buttom.
The first matching for the processed item will decide what ConvertFormats is used.

The example above reads as follows:
$if($greater($strs   ... shows that very complex things are possible. Just ignore for the moment. :-)
Files from media lib with extensions IT, MOD, 669 or XM will just be copied.
All other files than theese will be copied if bitrate is < 115kbit.
Rest of files (with more than 115 kbit bitrate) will be converted to Vorbis codec with profile "Vorbis_q2" (see below).

profile Vorbis_q2
Code: [Select]
ConvertFormats=Vorbis_q2*OGG*-vn -c:a libvorbis -ac 2 -ab 96k*96*_q2

The stars (*) are used as delimiters. The meaning of the arguments are descibed in the Wiki.
Most of this stuff is related to ffmpeg, that does the conversion.
It's not easy to get it all setup but thats the price you pay for the flexibility you get.  ;)

Here some more examples for ConvertFormats:
Code: [Select]
ConvertFormats=MP3_128*MP3*-vn -ac 2 -ab 128k*128
ConvertFormats=MP3_160*MP3*-vn -ac 2 -ab 160k*160
ConvertFormats=MP3_192*MP3*-vn -ac 2 -ab 192k*192
ConvertFormats=MP3_256*MP3*-vn -ac 2 -ab 256k*256
ConvertFormats=Vorbis_q4*OGG*-vn -c:a libvorbis -ac 2 -ab 128k*128*_q4
ConvertFormats=Vorbis_q5*OGG*-vn -c:a libvorbis -ac 2 -ab 150k*150*_q5
ConvertFormats=OPUS_96*-vn -c:a libopus -ac 2 -ab 96k*96
ConvertFormats=OPUS_128*OGG*-vn -c:a libopus -ac 2 -ab 128k*128
ConvertFormats=AAC_HE_80*AAC*-vn -c:a libvo_aacenc -profile:a aac_he_v2 -ac 2 -ab 80k*80

Currently, the file that appears in the folder is:
    filename_q2.OGGFLAG

Theese FLAG-files are just placeholders for the conversion and disappear when sync is finished.
They are used to judge if an item in a playlist must be copied to PLSyncBaseDir.
So if an item is already in MLSyncBaseDir synced it will not get copied to PLSyncBaseDir. Instead the playlist will just link the item to the existing file.

3. Is there a way to embed the folder.jpg that resides in the folder where the file is? I know this can be done with metaflac.exe --ti "pathto/folder.jpg"

Not with FoobarSync directly but you are on the right way. If you embed the album cover into the FLAC-files and tell FoobarSync to just copy, it will contain your cover as no modifications to copied files are made. If an embedded album cover will survive conversion from one format to another is a question of the converter used: ffmpeg.

Could you do me a favour and tell me what version or Foobar you are running?
I'd like to update my wiki that it runs with newer versions and add the path-issue with comserver2.
Thanks  :D

Re: FoobarSync - official disussion thread

Reply #32
This is great. One baby step closer.

I'm running the latest and greatest v1.6.10. So it seems that this is running just fine minus the whitespace thing. I'd say that would be easily fixable. I wonder if that is still maintained by anyone?

Btw, this link you posted is empty: https://foobarsync.lima-city.de/wikka/SyncRulesIDfile/backlinks

So, for artwork embedding. I've written this command separately to see if embedding artwork is possible and in itself will do that with the folder.jpg file and convert to a 320kbps MP3.

Code: [Select]
ffmpeg.exe -i input.flac -i folder.jpg -ab 320k -map 0:a -map 1:v -map_metadata 0:g:a:0 -c:v:1 jpeg -c:v:0 copy -disposition:v:1 attached_pic -metadata:s:v:1 title="Album Cover" -metadata:s:v comment="Cover (Front)" -id3v2_version 3 out.mp3

But, there's always a but!!, this doesn't work.
Code: [Select]
ConvertFormats=MP3_320*mp3*-i folder.jpg -vn -ac 2 -ab 320k -map 0:a -map 1:v -map_metadata 0:g:a:0 -c:v:1 jpeg -c:v:0 copy -disposition:v:1 attached_pic -metadata:s:v:1 title="Album Cover" -metadata:s:v comment="Cover (Front)" -id3v2_version 3*320

Is this because I'm trying to pipe another file with the -i switch? Or is it failing because the current directory when converting is not that of the file?


Re: FoobarSync - official disussion thread

Reply #33
Yes, link was not correct.
SyncRules are described here.

I think embedding the cover at conversion-runtime via SyncRules is not possible, because my script simply wasn't built to do this.

As I wrote you could try to store the cover in the original file, that is listed in your Foobar.
You could write a script yourself to do that.
But: I don't know if the cover will survive conversion. Just test that and see if cover is still there in the destination file.
If it doesn't survive, you could configure the SynRule to COPY instead of convert.

Note:
Yesterday I sent a hour to update my installation to newest release of Foobar2000.
Beside some component-troubles I managed to update with all exisiting configuration and components.
I am happy to know, that my script is still fully functional with the current release.

Answer to your other questions:

Yes, Foobar2000 is still maintained.

The whitespace-issue comes from COMserver component. So it's up to the developer of this comonent to fix it.

Yes, I am pretty sure folder.jpg would be searched in yout Foobar2000-folder because my script operates from the installation path and access to media is done by full path of the items.
Without futher development I see no chance to cover your needs for embedding covers at conversion.

If someone wants to implement that, feel free! :-)

Re: FoobarSync - official disussion thread

Reply #34
Just wondering if this can use a DSP chain when converting? I looked at the code and I can't see anything there that shows it can.

Re: FoobarSync - official disussion thread

Reply #35
No, I see no change to route encoding via DSP.
Encoding is done with ffmpeg.