All times are UTC+02:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Jun 09, 2024 12:38 pm 

Joined: Sat Jun 08, 2024 12:50 am
Posts: 6
I'm struggling to find any documentation and the 'more on pre- and postcommands...' link in WatchCat does not go anywhere.
Is there any help or further guidance anywhere?

Thanks
Stu

_________________
https://rave-one.com/


Top
   
PostPosted: Sun Jun 09, 2024 1:05 pm 

Joined: Sat Jun 08, 2024 12:50 am
Posts: 6
Found some guidance. The 'more on pre- and postcommands...' link in WatchCat under Watch Folder works. It's just the link under drag and drop is dead.

_________________
https://rave-one.com/


Top
   
PostPosted: Sun Jun 09, 2024 2:39 pm 
User avatar

Joined: Sun Dec 23, 2018 7:44 pm
Posts: 976
Location: Texas, USA
You're right, the link isn't working for the outputs. Here's what the information on the input says for posterity:

Pre- and postcommands
Precommands and postcommands are a powerful way of extending WatchCat's functionality. They allow you to invoke any command on an input file, and any command on an output (processed) file. This way you can process audio files of any format (by using a precommand to decode to PCM wave first), or even video files (by extracting the audio stream with a precommand). WatchCat can then perform any processing with Stereo Tool, normalise the level (peak, RMS or R128), and encode the file to PCM wave, FLAC or Ogg/Vorbis. If you'd like any other codec (e.g. AAC), simply use a postcommand to convert the wave or FLAC file using a third-party encoder. You can also use postcommands to merge the processed audio stream back into a video file, so that you can use WatchCat to perform R128 normalisation and/or processing on video files.

Available placeholders
Use these placeholders in your commands to point to the appropriate input, intermediate or output file.

$infile Path to original input file -- Pre & post
$inext Extension of original input file (eg. "mp3") -- Only post
$tempfile Path to file with processed audio -- Pre & post
$outfile Suggested path for output file (without extension) -- Only post
$outext Suggested extension for output file (eg. "ogg") -- Only post


Always wrap complete filenames in quotes (eg. "$outfile.$outext") to prevent problems with spaces.

Command examples

Converting to MP3 using LAME
Download lame. Then use this post-processing command:
Code:
/path/to/lame -q0 -b320 "$tempfile" "$outfile.mp3"
Explanation:
-q0 tells lame to use the highest quality encoding mode
-b320 tells lame to use a bit rate of 320kb/s
-$tempfile contains the audio processed by WatchCat
-$outfile.mp3 is the name of the output file

Extracting audio from a video file
Download and install ffmpeg. You can now use ffmpeg to extract audio which can then be processed by WatchCat. For example, use this pre-processing command:
Code:
/path/to/ffmpeg -i "$infile" -f wav -acodec pcm_s16le -ac 2 "$tempfile" -y
Explanation:
-i "$infile" tells ffmpeg to use $infile as the input file
-f wav -acodec pcm_s16le -ac 2 tells ffmpeg to convert the audio to PCM wave, 16 bit signed, 2 channels (whatever the original codec or format is)
"$tempfile" -y tells ffmpeg to write the output audio to a file named $tempfile, -y forces it to overwrite this file (it will already exist because WatchCat created it).

Merging processed audio back into a video file
If you haven't done so yet, install ffmpeg. You can now use ffmpeg to merge audio processed by WatchCat back into the video file. For example use this post-processing command:
Code:
/path/to/ffmpeg -y -i  "$infile" -i "$tempfile" -map 0:v -map 1:a -codec copy -shortest "$outfile.$inext"
Explanation:
-y tells ffmpeg to not ask for permission to overwrite a file. Use -n to disable overwriting. Waiting for user input would block WatchCat.
-i "$infile" -i "$tempfile" tells ffmpeg to use $infile (the original file that was fed into WatchCat, which will be a video file for this example), and $tempfile (the file that contains the processed audio for now) as the two input files.
-map 0:v -map 1:a tells ffmpeg to take the video from the first file ($infile) and to use the audio from the second file ($tempfile).
-codec copy tells ffmpeg to not perform any codec conversion. (This does not work for MP4 files with PCM data.)
-shortest tells ffmpeg to generate an output file that is as long as the shortest of the two inputs (though WatchCat should not have changed the duration of the audio).
-"$outfile.$inext" tells ffmpeg to put the resulting file at $outfile and to use the extension of the original input file ($inext).


Top
   
PostPosted: Sun Jun 09, 2024 8:14 pm 

Joined: Sat Jun 08, 2024 12:50 am
Posts: 6
Many thanks MrKlorox 8-)

_________________
https://rave-one.com/


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+02:00


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited