Hello,
Thank you for this soft that seems to be an oasis in the desert.
I'm a student in audiovisual infrastructure ans we have to project to create a channel in a week.
I'm trying to generate CMAF with ffastrans but for now i didn't manage to make it work.
The workflow is pretty simple as:
watchfolder -> ffmpeg transcoding -> delivery
This is the command i use in a "ffmpeg custom" block.
-i "%s_source%" \
-map 0:v -map 0:a \
-c:v:0 libx264 -b:v:0 3000k -s:0 1920x1080 -profile:v:0 main \
-c:v:1 libx264 -b:v:1 1500k -s:1 1280x720 -profile:v:1 main \
-c:v:2 libx264 -b:v:2 800k -s:2 854x480 -profile:v:2 main \
-f dash -seg_duration 4 -use_template 1 -use_timeline 1 \
-init_seg_name "%o%/%s_name%_init.mp4" \
-media_seg_name "%o%/%s_name%_media_$Number$.m4s" \
"%o%/%s_name%_manifest.mpd"
As a return i get this error message
"Encoding: Unable to choose an output format for '\\-map'; use a standard extension for the filename or specify the format manually."
i don't understand what the mistake is. I understood that "%s_source%" would complete the file name with the file that the watchfolder is treating.
Thanks for your help
CMAF
Re: CMAF
I think i advanced a little but it's still not working.
After diging the forum i understood that the block i'm using is not the good one.
I transfered my command line into a "command executor" block
Now my error is
"[...] Unable to choose an output format for '\\'; use a standard extension for the filename or specify the format manually.\r\n[out#0 @ 01e67f40] Error initializing the muxer for \\: Invalid argument\r\nError opening output file \\.\r\nError opening output files: Invalid argument\r\n)"
After diging the forum i understood that the block i'm using is not the good one.
I transfered my command line into a "command executor" block
Now my error is
"[...] Unable to choose an output format for '\\'; use a standard extension for the filename or specify the format manually.\r\n[out#0 @ 01e67f40] Error initializing the muxer for \\: Invalid argument\r\nError opening output file \\.\r\nError opening output files: Invalid argument\r\n)"
Re: CMAF
Hi there,
welcome to the forum!
I'm actually glad that you're using FFAStrans, the more people use it, the better.
Anyway, the error you're getting is related to the way the Custom FFMpeg node works.
In a custom FFMpeg node the input from the last node is automatically used, which means that you don't have to specify -i "something" given that s_source is already gonna be used automatically. The output of that lives in the cache folder (i.e the FFAStrans temporary storage) and is then used as the new %s_source% by the subsequent nodes so that it can be delivered if you connect it to, let's say, a delivery node.
Now, your use case is a bit peculiar 'cause you're not trying to produce a single file but rather a series of files referenced by an mpd manifest in what will be a DASH stream. This is very common for distribution encoders, but not quite a common scenario for the Custom FFMpeg Node which means that it wouldn't be quite clear to FFAStrans what you're trying to deliver out of all the files you would be creating in the cache folder, so I highly encourage you to use a Command Line Executor node instead. There, you can use FFMpeg the way you want to and you can even make it write directly to the destination folder.
I created a very simple workflow with exactly that in which I first populate the variables that you wanna use in the command line (I re-used your variables, however I discourage the use of something as simple as "o"):
Then we go to the command line executor node which runs the following command:
I had to adjust a few things from your original command:
1) You have to map the input 3 times to then use it three times
2) You can't use to set the resolution but rather
3) If you map the audio but then you don't specify anything then FFMpeg will guess so it's always better to actually specify it
Now, keep in mind that you're leaving a lot to the odds here in the sense that you're not specifying the reference frames, the keyint, you're not inserting aud etc which means that x264 will use the default values which might not be compliant. On top of that, you're not adding any kind of conversion before that, which means that any invalid input will make it break (for instance, if you're getting yv16, namely 4:2:2 planar instead of 4:2:0 planar). I actually suggest adding an A/V Decoder (i.e an indexer) and then a bunch of conditional followed by filters that perform the appropriate conversions before feeding the encoding node (i.e deinterlacing, frame rate conversion, color sampling conversion, bit depth conversion etc). Last but not least, please note that -s will use bicubic which is far from ideal as resizing kernel and should NOT be used. There are far better resizing kernel nowadays like SinPowerResize to perform downscaling but as far as FFMpeg is concerned even a simple Lanczos (which is a Sinc based resize with a limited window) will be enough and better.
Anyway those things aside, the workflow now works and is producing the output: There you go: If you need more info about how to create a compliant DASH stream with x264 and AAC in it, let me know and I'll point you to the right direction, but I definitely suggest taking a look at the topics on Doom9 in which we discussed this already.
welcome to the forum!

I'm actually glad that you're using FFAStrans, the more people use it, the better.
Anyway, the error you're getting is related to the way the Custom FFMpeg node works.
In a custom FFMpeg node the input from the last node is automatically used, which means that you don't have to specify -i "something" given that s_source is already gonna be used automatically. The output of that lives in the cache folder (i.e the FFAStrans temporary storage) and is then used as the new %s_source% by the subsequent nodes so that it can be delivered if you connect it to, let's say, a delivery node.
Now, your use case is a bit peculiar 'cause you're not trying to produce a single file but rather a series of files referenced by an mpd manifest in what will be a DASH stream. This is very common for distribution encoders, but not quite a common scenario for the Custom FFMpeg Node which means that it wouldn't be quite clear to FFAStrans what you're trying to deliver out of all the files you would be creating in the cache folder, so I highly encourage you to use a Command Line Executor node instead. There, you can use FFMpeg the way you want to and you can even make it write directly to the destination folder.
I created a very simple workflow with exactly that in which I first populate the variables that you wanna use in the command line (I re-used your variables, however I discourage the use of something as simple as "o"):
Then we go to the command line executor node which runs the following command:
Code: Select all
%comspec% /C ""%s_ffmpegx64%" -i "%s_source%" -map 0:v -map 0:v -map 0:v -map 0:a -map 0:a -map 0:a -c:v:0 libx264 -b:v:0 3000k -s:v:0 1920x1080 -profile:v:0 main -c:v:1 libx264 -b:v:1 1500k -s:v:1 1280x720 -profile:v:1 main -c:v:2 libx264 -b:v:2 800k -s:v:2 854x480 -profile:v:2 main -c:a:0 aac -b:a:0 128k -c:a:1 aac -b:a:1 128k -c:a:2 aac -b:a:2 128k -f dash -seg_duration 4 -use_template 1 -use_timeline 1 -init_seg_name "%s_o%\%s_name%_init.mp4" -media_seg_name "%s_o%\%s_name%_media_$Number$.m4s" "%s_o%\%s_name%_manifest.mpd""
1) You have to map the input 3 times to then use it three times
2) You can't use
Code: Select all
-s:0 -s:1 -s:2
Code: Select all
-s:v:0 -s:v:1 -s:v:2
Now, keep in mind that you're leaving a lot to the odds here in the sense that you're not specifying the reference frames, the keyint, you're not inserting aud etc which means that x264 will use the default values which might not be compliant. On top of that, you're not adding any kind of conversion before that, which means that any invalid input will make it break (for instance, if you're getting yv16, namely 4:2:2 planar instead of 4:2:0 planar). I actually suggest adding an A/V Decoder (i.e an indexer) and then a bunch of conditional followed by filters that perform the appropriate conversions before feeding the encoding node (i.e deinterlacing, frame rate conversion, color sampling conversion, bit depth conversion etc). Last but not least, please note that -s will use bicubic which is far from ideal as resizing kernel and should NOT be used. There are far better resizing kernel nowadays like SinPowerResize to perform downscaling but as far as FFMpeg is concerned even a simple Lanczos (which is a Sinc based resize with a limited window) will be enough and better.
Anyway those things aside, the workflow now works and is producing the output: There you go: If you need more info about how to create a compliant DASH stream with x264 and AAC in it, let me know and I'll point you to the right direction, but I definitely suggest taking a look at the topics on Doom9 in which we discussed this already.

- Attachments
-
- Screenshot from 2025-03-22 18-18-47.png (7.14 KiB) Viewed 1258 times
Re: CMAF
Arggg, the devil! Jokes aside, I generally avoid all the "AS" (Artificial Stupidity), be it GPT, Copilot, Gemini etc (got the joke? XD).
Unfortunately (or should I say "fortunately"), for niche things, they're not really good and encoding is one of those niche things.
For instance, if you ask Copilot something like "between the Discrete Fourier Transform and the Discrete Cosine Transform which one has more discontinuity points and why", it will get the answer confidently wrong. The problem is in the way it formulates the answer: it has no idea that it's wrong and it will word it in a confident way so that the human reading it will also think that it's true. This is a problem 'cause I've seen people rely on Copilot, GPT, Gemini etc and consider everything they say as the truth.
By the way, if you're curious, the answer to the aforementioned question is that the Discrete Fourier Transform has more discontinuity points as it's continuous in pi while the Discrete Cosine Transform is continuous in 2pi.
Still, the point I'm trying to make is that you can use those things but take everything they say with a pinch of salt or even better assume they lie all the time. I'd say that searching on Google is better but unfortunately nowadays not even that is safe 'cause the web is now polluted with all those fakely generated answers.

Luckily places like this forum and a few other remain safe heavens free from those things, where humans can interact with each other. Anyway, I'll get back with a slightly better workflow which includes a bunch of Avisynth conditionals for you, but you can use the one I gave you as a starting point.

Re: CMAF
Just a sidenote, you probably want to use hardware encoding instead of libx264, e.g. replace all occurences of libx264 by h264_nvenc or h264_qsv... but this can be done at any time, first concentrate on get it working somehow, then refine
emcodem, wrapping since 2009 you got the rhyme?