Command

  • 05 Oct

    How to convert audio from one format to another format

    How to convert audio from one format to another format

    Q: We would like to archive audio, convert from one format and downsample to another format. What I’ve tested is FFmpeg.exe  This program would need to execute a command to convert the original file to another format at the destination. This seems really simple, command line execution, but you would know how best to format this process. We would be copying files from source to destination. Here’s the command we’d execute for each file (obviously the file names would be different for each file).

    ffmpeg -i audio.wav -acodec libmp3lame audio.mp3

    I figured it out how to make this work with 2 rules.

    • First rule to execute the command and convert the files.
    • The second rule to be triggered when the first rule is complete to move the files to central storage. I just processed 145 files and it was effortless.
    One question. IF the command that is being executed in rule 1 has a problem (error message “process already running”) or anything like that, how do I kill the process that is operating in the background? I experienced this when I didn’t have a setting for overwrite, it was looking for a Y or N to continue. I added the setting to overwrite, but if something else comes up?
    • Added CMD (Command Line) as Destination:
    limagito file mover command line as destination
    • Screenshot of the Command settings I used:
      • Command Line: CMD /C “C:\Temp\ffmpeg.exe” -i “%SFP%SFN” -y -ab 48k “%DFP%DFW.mp3”
        • CMD /C: Execute Command and Close afterwards
        • %SFP: Source File Path ( Path ends with a \ )
        • %SFN: Source File Name
        • -y to confirm overwrites without needing a user interference
        • %SDFP: Destination File Path, in this setup it was set to C:\Temp\Test\
        • %DFW: Destination File Name Without Extension

    limagito filemover convert audio

    A: Setup looks good. You need command line switches that do not ask any feedback to the ‘user’. In case of error it should return a value <> 0. I guess it will be possible with ffmpeg.exe and it seems you already did by adding the -y switch.

    If you need any help about this ‘convert audio’ request, please let us know.

    Best Regards,

    Limagito Team

    #ffmpeg #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team Command Conversion
  • 13 Apr

    Running a python script with Command as source but rule doesn’t end

    Running a python script with Command as source but rule doesn’t end

    Q: I’m trying to setup a rule with a cmd as source, it executes a python script. When I execute the rule, it works well (I have the expected result), but the rule doesn’t end. So, I don’t have any output in the Limagito GUI.

    It seems that the process continues to run :

    20/01/2025 12:08:02 Execute Rule Request from administrator at 192.168.92.38 []

    20/01/2025 12:08:02 Execute Command as Source: [CMD] Command, Command Line: CMD /C python xxx\mediaprint_api_v3.py

    20/01/2025 12:08:02 Set CMD as Source Output to C:\Users\ADMINI~1\AppData\Local\Temp\LimagitoX\LimagitoX.83\

    20/01/2025 12:08:02 Execute M1 Command, Exception Error: Cannot perform this operation when process is running

    20/01/2025 12:08:02 Execute Command as Source Succes, ExitCode : 4294967295, Result Path: C:\Users\ADMINI~1\AppData\Local\Temp\LimagitoX\LimagitoX.83\

    20/01/2025 12:08:07 Rule Disabled by administrator at 192.168.92.38 []

    Should I check an option when configuring the rule to avoid that ?

    A: You are using CMD /C so that part is OK. I guess you need to add something to the python script that will close afterwards.

    ChatGPT info:

    limagito file mover Running a python script

    Customer feedback:

    Indeed, i was trying things and I it ended successfully with a sys.exit(0)

    If you need any help with this ‘Running a python script’ question, please let us know.

    Best Regards,

    Limagito Team

    #python #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team Command ,
  • 28 Oct

    How to execute script on temp folder

    How to execute script on temp folder

    Q: I would like to change the content of a file located on an FTP. I am trying to do so with a python script executed thanks to command option. So, my source is an FTP, and the destination is the same FTP. Is there a way to execute the command script on the temp folder so it would follow these steps :

    1. Move file from FTP to AppData\Local\Temp…
    2. Execute script on the moved file.
    3. Move the edited file to the same FTP.

    I succeed doing it with 2 rules :

    Rule 1 :

    1. Move file from FTP to a local folder.
    2. Execute script on the moved file.

    Rule 2 :

    1. Move file from local folder to the same FTP.

    Thank you!

    A:  It should be possible in one Rule.

    Your Destination setup will have 2 Destination entries. In my example below the second destination is WIN, in your case it would be FTP.
    In the Command setup you can use parameters like %SFP%SFN
    These parameters will point to the Source file located in the temporary folder after download from FTP as Source.

    limagito file mover script on Temp folder

    It is a good idea to adjust the Function setup. We changed the ‘Destination Options’ to ‘Exit Cyclus on Error’. So if the command in the first entry fails it will not move the file to the FTP server. It will retry the Command during the next scan.

    limagito file mover function exit cyclus on error

    #command #filetransfer #filemanagement

    If you need any help with this ‘execute script on Temp folder’ option, please let us know.

    Best Regards,

    Limagito Team

    By Limagito-Team Command ,
1 2 3 4
SEARCH