Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#1961 | Link |
|
Registered User
Join Date: Mar 2018
Location: Germany
Posts: 295
|
Using external encoder
I was about to use an external encoder (for the first time) of ffmpeg.
What I need is to encode the video, leave the audio as-is and put it into an mkv container. But doing File/Export/UsingExternalEncoder I always get: Invalid command line template: "-i - -c:v libsvtav1 -preset 5 -crf 22 -pix_fmt yuv420p10le -c:a copy "%file%"" What I did before: Options/ExternalEncoders... Have to define at the Encoders tab first. My entries: Video Encoder C:\<FullPathToFFMPEG>\ffmpeg.exe -i - -c:v libsvtav1 -preset 5 -crf 22 -pix_fmt yuv420p10le -c:a copy "%file%" %(outputname).video I do not define an audio encoder in the other tab. Next go to Encoder Sets and define a set with only the former video encoder entered. That's it. What did I do wrong? |
|
|
|
|
|
#1962 | Link | |
|
Registered User
Join Date: Dec 2008
Posts: 2,406
|
Quote:
__________________
MPC-BE 1.8.9 and Nightly builds | VideoRenderer | ImageSource | ScriptSource | BassAudioSource |
|
|
|
|
|
|
#1963 | Link | |
|
Registered User
Join Date: Mar 2018
Location: Germany
Posts: 295
|
Quote:
Then additionally defined an audio encoder: Command as of video encoder, options as: -i - -c:a copy "%file%" Input format: Raw audio data (or WAV file, doesn't matter). Compression: Bypass... Next added the defined audio encoder to the encoder set. (Still no multiplexer defined). Then do the Export/ ExternalEncoder. Message: Invalid command line template: -i - -c:a copy "%file%" What might be obviously wrong now? Last edited by nji; 28th February 2026 at 16:31. |
|
|
|
|
|
|
#1964 | Link |
|
Registered User
Join Date: Mar 2018
Location: Germany
Posts: 295
|
Very strange... there seems to be no knowledge in the forum how to use external encoders
![]() However I just discovered that your app can't read vdscript files (saved by itself), whereas orig VD2 has no problem with. |
|
|
|
|
|
#1965 | Link | |
|
Registered User
Join Date: Dec 2008
Posts: 2,406
|
Quote:
__________________
MPC-BE 1.8.9 and Nightly builds | VideoRenderer | ImageSource | ScriptSource | BassAudioSource |
|
|
|
|
|
|
#1966 | Link | |
|
Registered User
Join Date: Mar 2018
Location: Germany
Posts: 295
|
I already saw that source, but as it is as old (for VD1.10!), I wouldn't have expected that these entries do still work for VD2.x.
OK, with them I tried a simplified example: source: h264+aac movie. wanted destination: x265 lossless + audio copy. ffmpeg CLI: ffmpeg -i SourceAVC1.mp4 -c:v libx265 -crf 0 -c:a copy s.mkv does fine. Now define as external encoder in VD2.5: Video encoder arguments: -f rawvideo -c:v libx265 -crf 0 -i - "%(tempvideofile)" Audio encoder arguments: -i - -c:a copy "%(tempaudiofile)". Other tab: WAV file and bypass compression. Addition simple muxing by ffmpeg of both defined. Start stops at once. Log: Quote:
|
|
|
|
|
|
|
#1967 | Link |
|
Registered User
Join Date: Dec 2008
Posts: 2,406
|
I think you forgot to pass the RAW Video parameters.
If the task is to encode only video, then a simple example is as follows: Code:
Video encoder ffmpeg.exe -f rawvideo -s %(width)x%(height) -r %(fps) -i - -c:v libx264 -y %(outputname) %(outputname) This could be found in the link I wrote above. Sample1, Sample2.
__________________
MPC-BE 1.8.9 and Nightly builds | VideoRenderer | ImageSource | ScriptSource | BassAudioSource |
|
|
|
|
|
#1968 | Link |
|
Registered User
Join Date: Mar 2018
Location: Germany
Posts: 295
|
Thank you for your assistance
![]() Acutually parameters width and height seem to be mandatory. I didn't expect that. I thought that VD2 just "calls" the encoder (same as in CLI). Audio encoder, bypass compression: It seems I misunderstood that. I thought when defining an external encoder, it would be possible to somehow leave the audio as-is (like the CLI ffmpeg command: -c:a copy). But if I'm right, then that isn't possible at all? By defining an external decoder, VD2 forwards the (de-compressed, if compr. bypassed) raw audio to audio encoder, so you have to compress with the audio encoder again. Right? Or do I miss something? Is it possible to pass-through the compressed audio stream from source untouched to the muxer?
Last edited by nji; 1st March 2026 at 22:53. |
|
|
|
|
|
#1969 | Link | |
|
Registered User
Join Date: Dec 2008
Posts: 2,406
|
Quote:
Some other input drivers may output the audio track as is. But I don't know if this works with external encoders.
__________________
MPC-BE 1.8.9 and Nightly builds | VideoRenderer | ImageSource | ScriptSource | BassAudioSource |
|
|
|
|
|
|
#1970 | Link |
|
Registered User
Join Date: Mar 2018
Location: Germany
Posts: 295
|
Actually I use a Quicktime driver for Audio (per "Audio from other file..."),
if I don't change video timeline, and so audio can remain, and doesn't have to be decompressed and recompressed again. Works perfect within VD2. But I haven't been successful in passing that compressed stream to an external encoder. And I haven't found any example/ explanation on that. I wonder, as it seems a usual case. Did anybody manage that? Last edited by nji; 2nd March 2026 at 09:23. |
|
|
|
|
|
#1971 | Link | ||
|
Registered User
Join Date: Mar 2018
Location: Germany
Posts: 295
|
In my example:
Say I have an aac audio file (e.g. the as-is extracted audio track (aac) from my video file; take AviDemux for extraction). In VD2's external decoder thing: how do I get that to "%(tempaudiofile)"? Using ffmpeg CLI the command is: ffmpeg -i SourceAVC1.aac -c:a copy bitcopy.aac So the definition for VD2 Audio Encoder should be like: ffmpeg -i - -c:a copy "%(tempaudiofile)" Right? When starting the external decoder set, it interupts after few seconds. Log: Quote:
Quote:
Last edited by nji; 2nd March 2026 at 10:02. |
||
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|