Open longwu9t opened 2 days ago
Maybe it's a problem with the source files? But this cat.mkv has always been the file I use for testing, and it has always been normal.
maybe ... The Magic Number 35
I randomly changed the 35 in the svt-av1 configuration file to 36 34 33 32, and it still reported the same error, 3130..., and the error disappeared ^_!
that SVT-AV1 is your own install? because I can't replicate the error
https://github.com/Anime4000/IFME/assets/9213316/087d84c3-3e86-4bbb-8f8a-0b4c2d62adec
Svt[info]: ------------------------------------------- Svt[info]: SVT [version]: SVT-AV1 Encoder Lib v2.1.2-15-gb8d2f2b4 Svt[info]: SVT [build] : GCC 14.1.0 64 bit Svt[info]: LIB Build date: Jul 2 2024 19:07:59 Svt[info]: ------------------------------------------- Error instance 1: Invalid Input File Error in configuration, could not begin encoding! ... Run SvtAv1EncApp.exe --help for a list of options
sha1: b7b49750fb8ee57f46609b04dc88f417dbfbdae0 SvtAv1EncApp.exe
I have found the cause of the error. The configuration file of svt-av1 must be placed in the subdirectory under Plugins, not in the Plugins directory. This may mean that the source program uses a relative path instead of an absolute path.
For the robustness and configurability of the program, can consider not using relative paths to hard-code into the source program files, such as the paths of mp4box and ffmpeg in the same situation. The Plugins directory can be written in the source program, and the configuration items in the json under the Plugins directory should use absolute paths as much as possible.
configuration items in the json under the Plugins directory should use absolute paths as much as possible.
This will break "Portable"
However, it always check encoder
path is Full (Rooted) or no as this line check:
https://github.com/Anime4000/IFME/blob/master/IFME/Plugins/PluginsLoad.cs#L43
https://github.com/Anime4000/IFME/blob/master/IFME/Plugins/PluginsLoad.cs#L139
the Path.IsPathRooted();
check path is full and absolute, for example:
Windows: C:\foo\bar
Linux: /foo/bar
when condition above, means true, Plugins Loader will use full path
Windows: ..\ffmpeg64\ffmpeg
Linux: /ffmpeg64/ffmpeg
when condition above, mean false, so Plugins Loader will concat:-
D:\Users\Anime4000\Documents\GitHub\IFME\IFME\bin\Debug\Plugins\ffmpeg.audio\_plugin.audio-ffmpeg32_aac-free.json
D:\Users\Anime4000\Documents\GitHub\IFME\IFME\bin\Debug\Plugins\ffmpeg.audio
D:\Users\Anime4000\Documents\GitHub\IFME\IFME\bin\Debug\Plugins\ffmpeg.audio
+ ..\ffmpeg64\ffmpeg
..
is in the path, up one folderD:\Users\Anime4000\Documents\GitHub\IFME\IFME\bin\Debug\Plugins
D:\Users\Anime4000\Documents\GitHub\IFME\IFME\bin\Debug\Plugins\ffmpeg64\ffmpeg
Also Plugins Loader will scan _plugin.audio
and _plugin.video
prefix recursively, you can put many deep sub folder inside Plugins
so far I tested
D:\Users\Anime4000\Documents\GitHub\IFME\IFME\bin\Debug\Plugins\aac\free\_plugin.audio-ffmpeg32_aac-free.json
D:\Users\Anime4000\Documents\GitHub\IFME\IFME\bin\Debug\Plugins\aac\free\_plugin.audio-ffmpeg64_aac-free.json
D:\Users\Anime4000\Documents\GitHub\IFME\IFME\bin\Debug\Plugins\acc\fdk\_plugin.audio-ffmpeg32_aac-fdk.json
D:\Users\Anime4000\Documents\GitHub\IFME\IFME\bin\Debug\Plugins\acc\fdk\_plugin.audio-ffmpeg64_aac-fdk.json
the path will be ..\..\ffmpeg64\ffmpeg
In my machine, since the encoders are all public, I write the absolute path of most executable files in the json configuration file. This cannot be done. Currently, I use the mklink command to create soft links.
since the encoders are all public
Do you mean your encoder is in PATH
environment ?
yes Added to the system PATH
let me try, if this can be automated
Mainly because FFmpeg MP4BOX X264 and other encoders are not small in size, and are repeatedly used by multiple applications. If do not do this, it is a waste of disk space, not conducive to APP packaging backup, not conducive to the uniform version of the encoder.
testing for encoder:
[DEBG] Command Line: "D:\Users\Anime4000\Documents\GitHub\IFME\IFME\bin\Debug\Plugins\ffmpeg64\ffmpeg" -hide_banner -v error -i "Z:\Videos\GalGame\sppl_01_op.avi" -map 0:0 -pix_fmt yuv420p -vf scale=800:448:flags=lanczos,fps=24 -strict -1 -f yuv4mpegpipe - | "SvtAv1EncApp.exe" -i stdin -n 2999 --input-depth 8 --preset 2 --profile 0 --crf 35 --progress 2 -b video0000_jpn.ivf
Svt[info]: -------------------------------------------
Svt[info]: SVT [version]: SVT-AV1 Encoder Lib v2.1.2-15-gb8d2f2b4
Svt[info]: SVT [build] : GCC 14.1.0 64 bit
Svt[info]: LIB Build date: Jul 2 2024 19:07:59
Svt[info]: -------------------------------------------
Svt[info]: Number of logical cores available: 32
Svt[info]: Number of PPCS 173
Svt[info]: [asm level on system : up to avx2]
Svt[info]: [asm level selected : up to avx2]
Svt[info]: -------------------------------------------
Svt[info]: SVT [config]: main profile tier (auto) level (auto)
Svt[info]: SVT [config]: width / height / fps numerator / fps denominator : 800 / 448 / 24 / 1
Svt[info]: SVT [config]: bit-depth / color format : 8 / YUV420
Svt[info]: SVT [config]: preset / tune / pred struct : 2 / PSNR / random access
Svt[info]: SVT [config]: gop size / mini-gop size / key-frame type : 161 / 32 / key frame
Svt[info]: SVT [config]: BRC mode / rate factor : CRF / 35
Svt[info]: SVT [config]: AQ mode / variance boost : 2 / 0
Svt[info]: -------------------------------------------
I do the same with FFmpeg next.
if FFmpeg
found in the PATH
it will use PATH
by default.
I also have done for FFmpeg, now use PATH by default.
[DEBG] Command Line: "ffmpeg" -hide_banner -v error -i "Z:\Videos\GalGame\sppl_01_op.avi" -map 0:0 -pix_fmt yuv420p -vf scale=800:448:flags=lanczos,fps=24 -strict -1 -f yuv4mpegpipe - | "SvtAv1EncApp.exe" -i stdin -n 2999 --input-depth 8 --preset 2 --profile 0 --crf 35 --progress 2 -b video0000_und.ivf
Svt[info]: -------------------------------------------
Svt[info]: SVT [version]: SVT-AV1 Encoder Lib v2.1.2-15-gb8d2f2b4
Svt[info]: SVT [build] : GCC 14.1.0 64 bit
Svt[info]: LIB Build date: Jul 2 2024 19:07:59
Svt[info]: -------------------------------------------
Svt[info]: Number of logical cores available: 32
Svt[info]: Number of PPCS 173
Svt[info]: [asm level on system : up to avx2]
Svt[info]: [asm level selected : up to avx2]
Svt[info]: -------------------------------------------
Svt[info]: SVT [config]: main profile tier (auto) level (auto)
Svt[info]: SVT [config]: width / height / fps numerator / fps denominator : 800 / 448 / 24 / 1
Svt[info]: SVT [config]: bit-depth / color format : 8 / YUV420
Svt[info]: SVT [config]: preset / tune / pred struct : 2 / PSNR / random access
Svt[info]: SVT [config]: gop size / mini-gop size / key-frame type : 161 / 32 / key frame
Svt[info]: SVT [config]: BRC mode / rate factor : CRF / 35
Svt[info]: SVT [config]: AQ mode / variance boost : 2 / 0
Svt[info]: -------------------------------------------
make sure the JSON file just encoder.exe
, no ..
All other encoders(ffmpeg mp4box x264 x265 uvg266 qaac fdkaac hmp3 ...) in the system PATH work as expected except SVT-AV1, which still reports the same error.
(Format)mkv + (encoder)svt-av1 If this combination becomes the default combination, it may go wrong Just my guess Attached is my current configuration folder, all encoders are in PATH Plugins.zip
I change the code, try again if still have issue
I change the code, try again if still have issue
this time no error thanks!!!
Nice, time to release to public
Another good news: with this fix, the "MultiChannelSupport": false option can now generate mp2 mp3 mono files normally.
nice, next I going to change JSON to support libtwolame
, the way to map channel is different most standard, so JSON is going to change:
"Channels": {
"-1": "auto",
"0": "stereo",
"1": "joint stereo",
"2": "dual_channel",
"3": "mono"
},
"ChannelArgs": "--mode",
the top array is always as auto
"0": "stereo", "1": "joint stereo", "2": "dual_channel", Most users are not sensitive to the distinction between these three
For AAC, if fhgaacenc is used, compatibility is very good, whether it is multi-channel mono or sampling rate. "MultiChannelSupport": false, "MonoSupport": false, The above two parameters are not required for fhgaacenc
fhgaacenc.zip
General encoding options
--cbr
the ChannelArgs
is use when specific for that lib is required, by default will use FFmpeg -ac
(if JSON not mention it)
I have updated the JSON, all audio plugin json must be updated,
changes, replace Channel
"Channels": {
"-1": "Auto",
"0": "Stereo",
"1": "Joint Stereo",
"2": "Dual Channel",
"3": "Mono"
},
"ChannelArgs": "-mode",
LibTwoLame
{
"GUID": "deadbeef-2002-d002-d002-d002d002d002",
"Name": "MPEG Audio Layer-2 (TwoLAME)",
"Version": null,
"X64": true,
"Format": [
"avi",
"mp2",
"mp4",
"mkv"
],
"Author": {
"Developer": "Mike Cheng",
"URL": "https://en.wikipedia.org/wiki/TooLAME"
},
"Update": {
"VersionURL": null,
"DownloadURL": null
},
"Audio": {
"Extension": "mp2",
"Encoder": "../ffmpeg64/ffmpeg",
"SampleRate": [
16000,
22050,
24000,
32000,
44100,
48000
],
"SampleRateDefault": 44100,
"Channels": {
"-1": "Auto",
"0": "Stereo",
"1": "Joint Stereo",
"2": "Dual Channel",
"3": "Mono"
},
"ChannelArgs": "-mode",
"ChannelDefault": 2,
"Args": {
"Pipe": false,
"Input": "-hide_banner -v quiet -stats -i",
"Codec": "-vn -sn -dn -c:a libtwolame",
"Output": "-y",
"Command": null
},
"Mode": [
{
"Name": "Bitrate",
"Args": "-b:a",
"MultiChannelSupport": false,
"QualityPrefix": "",
"QualityPostfix": "k",
"Quality": [
128,
160,
192,
224,
256,
320,
480,
512
],
"Default": 192
}
]
}
}
[robust audio command] ffmpeg libopus error:
In addition, the mp2 bit rate:
{
"GUID": "deadface-f00d-f00d-f00d-f00df00df00d",
"Name": "opus",
"Version": null,
"X64": true,
"Format": [
"opus",
"mkv",
"webm"
],
"Author": {
"Developer": "Xiph.Org Foundation, Marc Valin, IETF",
"URL": "http://opus-codec.org/"
},
"Update": {
"VersionURL": null,
"DownloadURL": null
},
"Audio": {
"Extension": "opus",
"Encoder": "opusenc.exe",
"SampleRate": [
0
],
"SampleRateDefault": 0,
"Channels": {
"-1": "Auto"
},
"ChannelArgs": "-mode",
"ChannelDefault": -1,
"Args": {
"Pipe": true,
"Input": "--ignorelength --quiet -",
"Output": "",
"Command": null
},
"Mode": [
{
"Name": "Bitrate",
"Args": "--bitrate",
"QualityPrefix": "",
"QualityPostfix": "",
"Quality": [
64,
128,
160,
256,
320,
512
],
"Default": 256
}
]
}
}
can choose a separate command line version of opusenc encoding
This only special for some encoder like libtwolame, so, need use typical FFmpeg, since this will use at FFmpeg side
"Channels": {
"0": "Auto"
},
"ChannelArgs": "-ac",
"ChannelDefault": 0,
example using ffmpeg libtwolame
C:\Users\Anime4000>ffmpeg -h encoder=libtwolame
Encoder libtwolame [libtwolame MP2 (MPEG audio layer 2)]:
General capabilities: dr1 delay
Threading capabilities: none
Supported sample rates: 16000 22050 24000 32000 44100 48000
Supported sample formats: flt fltp s16 s16p
Supported channel layouts: mono stereo
libtwolame encoder AVOptions:
-mode <int> E...A...... Mpeg Mode (from -1 to 3) (default auto)
auto -1 E...A......
stereo 0 E...A......
joint_stereo 1 E...A......
dual_channel 2 E...A......
mono 3 E...A......
-psymodel <int> E...A...... Psychoacoustic Model (from -1 to 4) (default 3)
-energy_levels <int> E...A...... enable energy levels (from 0 to 1) (default 0)
-error_protection <int> E...A...... enable CRC error protection (from 0 to 1) (default 0)
-copyright <int> E...A...... set MPEG Audio Copyright flag (from 0 to 1) (default 0)
-original <int> E...A...... set MPEG Audio Original flag (from 0 to 1) (default 0)
-verbosity <int> E...A...... set library optput level (0-10) (from 0 to 10) (default 0)
"ChannelArgs": "-ac", This new option caught my eye
{
"GUID": "deadbeef-0aac-0aac-0aac-0aac0aac0aac",
"Name": "fhgaacenc",
"Free": false,
"Version": null,
"X64": true,
"Format": [
"mp4",
"m4a",
"mkv",
"ts",
],
"Author": {
"Developer": "tmkk",
"URL": null
},
"Update": {
"VersionURL": null,
"DownloadURL": null
},
"Audio": {
"Extension": "m4a",
"Encoder": "fhgaacenc.exe",
"SampleRate": [
0,
8000,
12000,
16000,
22050,
24000,
32000,
44100,
48000,
88200,
96000
],
"SampleRateDefault": 0,
"Channels": {
"0": "Auto",
"1": "Mono",
"2": "Stereo",
"6": "5.1 surround sound",
"8": "7.1 surround sound"
},
"ChannelArgs": "-ac",
"ChannelDefault": 0,
"Args": {
"Pipe": true,
"Input": "-",
"Output": "",
"Command": null
},
"Mode": [
{
"Name": "VBR",
"Args": "--ignorelength --quiet --vbr",
"QualityPrefix": "",
"QualityPostfix": "",
"Quality": [
1,
2,
3,
4,
5,
6
],
"Default": 2
},
{
"Name": "CBR",
"Args": "--ignorelength --quiet --profile auto --cbr",
"QualityPrefix": "",
"QualityPostfix": "",
"Quality": [
8,
16,
32,
64,
96,
128,
192,
256,
320,
440,
576
],
"Default": 256
}
]
}
}
"ChannelArgs": "-ac", This new option caught my eye
you can ignore or remove ChannelArgs
, by default it use -ac
:
https://github.com/Anime4000/IFME/blob/master/IFME/Plugins/PluginsAudio.cs#L22
When you have some free time, maybe you should write a help txt of configuration file ^_^
When an encoding error occurs, exit the program actively, start the program again, and add the source file to the queue