BURN IN SUBS

Questions and answers on how to get the most out of FFAStrans
backlight
Posts: 44
Joined: Wed Dec 12, 2018 8:33 am

BURN IN SUBS

Post by backlight »

Good morning guys,
i'm crreating a batch for subtitles burn in...
but it gives me always an error...

i have done a custom ffmpeg with the classic ass string inside....

i have tested with both SRT and ASS syntax... but nothing!

Can you help me?
Attachments
Screenshot
Screenshot
ass.jpg (72.53 KiB) Viewed 12228 times
ThomasM
Site Admin
Posts: 231
Joined: Wed Feb 22, 2017 6:36 am

Re: BURN IN SUBS

Post by ThomasM »

Hi,

are the quotes set correctly? Shouldn´t it be -vf ass="{path}" ?

cheers,

tom
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: BURN IN SUBS

Post by emcodem »

Hey there,

you always need to be aware about how the strings you build from variables looks like when it is executed.
E.g. you provide this:

Code: Select all

-vf "ass=%s_original_path%\%s_original_name%.ass"
When this is executed for an input path like this: \\server\share\folder with spaces\file.ext, it looks like this:

Code: Select all

-vf "ass=\\server\share\folder with spaces\file.ass"
Now, if you try this on commandline without ffastrans, you will most likely recognize that ffmpeg is not able to find the ass file, or even throw an error message About a filter named "with" and "spaces…" not found. You might need to escape your path properly, e.g. ":" needs to render as "\:", "\" as "\\" etc...

A workfing example might most likely look more like this (not 100% sure About that):

Code: Select all

-vf "ass='\\\\Server\\share\\folder with spaces\\file.ass'"
or even this:

Code: Select all

-vf "ass='\\\\\\\\Server\\\\share\\\\folder with spaces\\\\file.ass'"
You can read about escaping in filters here: https://ffmpeg.org/ffmpeg-filters.html# ... h-escaping

To get further help, please try it on commandline and post a working example with the actual full path to your .ass file there and we can try to get out how you can dynamically properly escape your path using ffastrans automation.

cheers,
emcodem
emcodem, wrapping since 2009 you got the rhyme?
backlight
Posts: 44
Joined: Wed Dec 12, 2018 8:33 am

Re: BURN IN SUBS

Post by backlight »

Ok Guys, i solved the probblem with the escaping... the functioning script is this

-vf "subtitles='s\:\\subs\\%s_original_name%.srt':force_style='fontsize=30, outlinecolour=&h80000000'"

inside a custom ffmpeg node.

I put an SRT file, with the same name of the file to burn in, in a folder called "subs" on the S drive... it works perfectly

but if i apply other nodes, or i insert the same code under the x264 node it doesn't works.

For me could be important to position subtitles over the image and not on the letterboxing black bars and it could be useful to crop the image.

the only way to encode is to put an intermediate encoding node before the one with the subtitle burn in code... in this way it works but it takes twice time... a sort of two-pass.

What i'm doing wrong?!

thank you so much

L
Attachments
working workflow
working workflow
burnin.jpg (30.13 KiB) Viewed 12163 times
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: BURN IN SUBS

Post by emcodem »

Good monday :-)
unfortunately there is no known to me way to apply a ffmpeg filter (like subtitles) to any other node than the commandline or custom ffmpeg node. E.g. the "H.264" processor provides an option for custom "x264" encoder options but no way to provide "-vf" filtering options.
Again my recommendation is to go with the custom ffmpeg processor or commandline.

cheers!
emcodem
emcodem, wrapping since 2009 you got the rhyme?
backlight
Posts: 44
Joined: Wed Dec 12, 2018 8:33 am

Re: BURN IN SUBS

Post by backlight »

could be a solution... the possibility to resize the position of subs in order to burn it inside the image area...
but i cannot do this using -VF
admin
Site Admin
Posts: 1680
Joined: Sat Feb 08, 2014 10:39 pm

Re: BURN IN SUBS

Post by admin »

Currently FFAStrans has no way of forwarding custom ffmpeg filter options to the inbuilt predefined encoders but I'm looking at a way to implement it. The problem is that the filter part in ffmpeg is used extensively to do color, framerate, interlacing, aspect and geometric conversions. So adding a custom -vf must fit into the existing filter chain while perserving the existing conversion logic.

-steinar
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: BURN IN SUBS

Post by emcodem »

backlight wrote: Mon Mar 04, 2019 5:11 pm but i cannot do this using -VF
Not sure what you are after?
To summarize your current requirements:
-) load srt from subfolder
-) custom font,color and position for burn in subtitles
-) the workflow picture you sent shows that you also do crop on the image

anything i missed? ...what does not work for you currently using the custom ffmpeg processor?

cheers!
emcodem
emcodem, wrapping since 2009 you got the rhyme?
backlight
Posts: 44
Joined: Wed Dec 12, 2018 8:33 am

Re: BURN IN SUBS

Post by backlight »

Hi emcodem,
the crop is a "workaround" to burn subs in the correct position when the source is letterboxed. This is the way i use handbrake.
But using ffmpeg (and also handbrake) i cannot add a sort of vposition of the subs, and inside ffastrans, if i add avisynth nodes before the one with custom ffmpeg it gives me an error. Using the script i have showed it works but ovviously it performs a sort of double pass encoding and i loose all the advantages!

I cannot find any command... to subtitles filter or ass filter to resize the subs before burning in!

mmmm

L
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: BURN IN SUBS

Post by emcodem »

Hey L :-)

From your last description, i see that all you want to do is to override the styling Options that should be stored in the .ass file.
Basically the Styling e.g. font, Position etc... should already be correct in the ass file. If it is not for some reason, looking at the ffmpeg documentation, it seems that you can override any style commands using the "force_style" Option which is a suboption of the subtitles filter. Did you try this one?
https://www.ffmpeg.org/ffmpeg-filters.html (seach for force_style)

cheers,
emcodem
emcodem, wrapping since 2009 you got the rhyme?
Post Reply