View Single Post
  #1654  
Old 30.01.2021, 12:46
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by KERNEL59 View Post
... for bitrate 128kbps to 320kbps where is it in the script ?
Transcoding drawbacks (wikipedia):
Quote:
The key drawback of transcoding in lossy formats is decreased quality. Compression artifacts are cumulative, so transcoding causes a progressive loss of quality with each successive generation, known as digital generation loss. For this reason, transcoding (in lossy formats) is generally discouraged unless unavoidable.
The script transcodes the file at the same bitrate as input. YT does not provide audio streams higher than 192kbps (in older formats) and 160kbps (in newer formats). Trancoding a file to higher bitrate than the source does not improve the quaility in anyway. If anything, it will be even worse. Transcoding itself from one lossy format to another (as in what is done by the script) should be avoided wherever possible.

That being said, the following script ignores the input bitrate and converts the file @320kbps.
Code:
/*
    Convert aac/m4a/ogg files to 320 kbps mp3.
    Trigger required: "A Download Stopped".
*/

if (link.finished) {
    var input = link.downloadPath;
    var output = link.downloadPath.replace(/(.+\.)(aac|m4a|ogg)$/i, "$1mp3");

    if (input != output) {
        var interfaceName = "org.jdownloader.controlling.ffmpeg.FFmpegSetup";
        var ffmpeg = callAPI("config", "get", interfaceName, null, "binarypath");

        callSync(ffmpeg, "-n", "-i", input, "-b:a", "320k", output);
        getPath(output).size && getPath(input).delete();
    }
}
Reply With Quote