Log in

View Full Version : transparent movie from subtitle file?


jriker1
12th September 2016, 03:14
I am trying to create a transparent movie file that has subtitles on it and nothing else. Intent is to take a movie, and lay this transparent movie with subtitles on top of it, and export the project to a separate movie file so the subs will then be burnt in. Is there any tools in AVISynth that can generate this? Supposedly Lemony Subtitler can do this as an example:

https://www.youtube.com/watch?v=pelPO-xNO7U#t=52

Thanks.

JR

blaze077
12th September 2016, 04:06
I am trying to create a transparent movie file that has subtitles on it and nothing else. Intent is to take a movie, and lay this transparent movie with subtitles on top of it, and export the project to a separate movie file so the subs will then be burnt in. Is there any tools in AVISynth that can generate this? Supposedly Lemony Subtitler can do this as an example:

https://www.youtube.com/watch?v=pelPO-xNO7U#t=52

Thanks.

JR

If I understood correctly, you simply want to burn the subtitle file onto the video. For that purpose, you can use the TextSub function of VSFilter that can be found here. (http://avisynth.org.ru/docs/english/externalfilters/vsfilter.htm)

raffriff42
12th September 2016, 05:15
Assuming "transparent" means having a transparent alpha channel, this should work:#Last = <any video source>

## Subtitles over (transparent) black
## comment this line out for subtitles over (transparent) original video
BlankClip(Last)

ConvertToRGB32
ResetMask

# http://avisynth.org.ru/docs/english/externalfilters/vsfilter.htm
TextSub(<some subtitle file>)
SUB=Last

## convert the mask into grayscale for tests, below
M=SUB.ShowAlpha.Invert

## test: view mask only
#return M

## test: subtitles over color bars
#return Overlay(Colorbars, SUB, mask=M.Blur(1.0))

## output: hardsub with (invisible) transparency information
return SUBNote you must encode 'SUB' in RGBA or you lose the transparency information.
Alternately, you could save 'SUB' and 'M' as separate videos.

kuchikirukia
12th September 2016, 09:35
If you just want to hardsub, ffmpeg can do that.

jriker1
12th September 2016, 20:30
If I understood correctly, you simply want to burn the subtitle file onto the video. For that purpose, you can use the TextSub function of VSFilter that can be found here. (http://avisynth.org.ru/docs/english/externalfilters/vsfilter.htm)


Blaze, for your response aware of textsub and it works great but have had issues with ffmpegsource2 lately so need a different way to do it now. Since the main reason I use VDub for cleanup over Premiere Pro sometimes is strictly when I need to burn in subs. Since ffmpegsource2 is causing pixelation on fast switching scenes now (may be my version), looking for a way to do the full encode in Premiere.

JR

jriker1
12th September 2016, 20:35
If you just want to hardsub, ffmpeg can do that.

Reviewing raffriff42 script right now, however if i wanted to do this with ffmpeg, make sure it encodes with MagicYUV in the correct colorspace, and utilize the a_s_s subtitle file or whatever format it supports, how would that look on the command line? Will assume the formatting and location of the subtitles will be maintained thru ffmpeg?

Thanks.

JR

jriker1
12th September 2016, 21:08
Assuming "transparent" means having a transparent alpha channel, this should work:#Last = <any video source>

## Subtitles over (transparent) black
## comment this line out for subtitles over (transparent) original video
BlankClip(Last)

ConvertToRGB32
ResetMask

# http://avisynth.org.ru/docs/english/externalfilters/vsfilter.htm
TextSub(<some subtitle file>)
SUB=Last

## convert the mask into grayscale for tests, below
M=SUB.ShowAlpha.Invert

## test: view mask only
#return M

## test: subtitles over color bars
#return Overlay(Colorbars, SUB, mask=M.Blur(1.0))

## output: hardsub with (invisible) transparency information
return SUBNote you must encode 'SUB' in RGBA or you lose the transparency information.
Alternately, you could save 'SUB' and 'M' as separate videos.



Raf, based on what you sent, I did this:


Last = FFmpegSource2("vid.M2TS",atrack=-1)

## Subtitles over (transparent) black
## comment this line out for subtitles over (transparent) original video
BlankClip(Last)

ConvertToRGB32
ResetMask

# http://avisynth.org.ru/docs/english/externalfilters/vsfilter.htm
TextSub("Subtitles_31_English.ass")
SUB=Last

## convert the mask into grayscale for tests, below
M=SUB.ShowAlpha.Invert

## test: view mask only
#return M

## test: subtitles over color bars
#return Overlay(Colorbars, SUB, mask=M.Blur(1.0))

## output: hardsub with (invisible) transparency information
return SUB


Got a black video for the full duration however when I scroll in vdub to the areas where there are subtitles, still shows a black screen. My subtitles also for reference are white text, with a black border around them as I find in some screens (like a white screen scene) having that border helps make the fonts more visible and not wash out. Thoughts?

Thanks.

JR

raffriff42
12th September 2016, 23:30
when I scroll in vdub to the areas where there are subtitles, still shows a black screen... Thoughts?I don't know. Do the subtitles show with a basic script like this?FFmpegSource2("vid.M2TS",atrack=-1)
TextSub("Subtitles_31_English.ass")
return Last

Could you post the "styles" section of your subtitles file? It should look something like this:[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Arial Black,56,&H00FFFFFF,&H0300FFFF,&H00000000,&H02000000,0,0,0,0,100,100,0,0,1,2,1,2,20,20,20,1

or this:[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding
Style: Default,Tahoma,18,16777215,65535,65535,-2147483640,-1,0,1,3,0,2,30,30,30,0,0
Style: C18,Tahoma,18,16777215,65535,65535,-2147483640,-1,0,1,3,0,2,30,30,30,0,0

jriker1
13th September 2016, 01:45
Sorry my bad. First sub was an hour nineteen in. i was at 19 mins in. or i had to zoom in as the bottom may have been off frame. concerned if that black is transparent if the black borders around the words will go away. heres my sub styles



[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: JR,Arial,55,&H00FFFFFF,&H0300FFFF,&H00000000,&H02000000,-1,0,0,0,100,100,0,0,1,2,2,2,0,0,175,1



EDIT: exported the avs results with magicyuv set to RGBA. placed the original video on premiere timeline. plaed the rgba one on top of that. screen went blank.

raffriff42
13th September 2016, 03:29
placed the rgba one on top of that. screen went blank.In don't know what mask settings you used, or if the alpha channel survived the encoding intact. To verify the alpha channel is present, you can view it:Compositing, alpha channels, and adjusting clip opacity (adobe.com) (https://helpx.adobe.com/premiere-pro/using/compositing-alpha-channels-adjusting-clip.html)
If you have difficulty identifying which parts of a clip are transparent, choose Alpha from the Program view menu in the Program Monitor. Another way to see areas of transparency is to add a bright solid color matte on a track below the image you are keying.

When you view an alpha channel in the After Effects Composition panel or a Premiere Pro Monitor panel, white indicates complete opacity, black indicates complete transparency, and shades of gray indicate partial transparency.

You can choose how to interpret the alpha channel in a file in the Interpret Footage dialog box. Choose Invert Alpha Channel to swap areas of opacity with areas of transparency (you might have to do this), or choose Ignore Alpha Channel to not use the alpha channel information at all.

(looking at your Styles, all your colors are opaque, which is good)

jriker1
13th September 2016, 15:07
Here's what worked with one minor issue right now:


Last = FFmpegSource2("vid.M2TS",atrack=-1)
BlankClip(Last,pixel_type="RGB32")
TextSub("Subtitles_31_English.ass")
Mask(ShowAlpha().TextSub("Subtitles_31_English.ass"))


I exported with MagicYUV with compression set to accept colorspace RGBA, compress as is, and checked the Enable RGBA compression. These were set before so the MagicYUV settings isn't the fix, it's apparently the above code block.

So the issue. I have it working, but the black border around the subtitles is gone now as I expected with a black transparent background. Any fix for this or have to live with it? Or use some other outside coloring?

EDIT: Note I changed the BlankClip to some ugly random brown color: BlankClip(Last,pixel_type="RGB32",color=$A52A2A) so not sure if that will resolve my issue. Guessing this works like a green screen. If you are wearing green there will be a hole in that area when broadcasting so need to use a color not contained in your subtitles.

Thanks.

JR

raffriff42
13th September 2016, 16:08
Has nothing to do with green screen. Please verify alpha channel exists on the video after importing into Premiere. If you can't get the alpha channel in Premiere, you will have to make a second video containing only the alpha channel (use the script I posted but un-comment return M) and use that as your mask.

jriker1
13th September 2016, 17:30
Has nothing to do with green screen. Please verify alpha channel exists on the video after importing into Premiere. If you can't get the alpha channel in Premiere, you will have to make a second video containing only the alpha channel (use the script I posted but un-comment return M) and use that as your mask.

Testing now. Would think the alpha channel is there as I can see the original video thru the second layer video (one we are creating here with subs) and see the subtitles, just the outer black border is gone. Looking at the alpha channel info looks like the outer border is being included when I put the return M in there as the letters are fatter than normal. I'm rendering it now so will see what happens.

Thanks.

JR

jriker1
13th September 2016, 19:48
OK so I have a video with a fat white subtitle area that I guess now encompasses the white text and the black border. How do I add that to the process now?

And so I understand this right, in theory what is the script doing?

Is BlankClip(Last) creating a bottom layer that shows black but is really 100% transparent?
Is TextSub(<some subtitle file>) then laying the subtitle information over that transparent layer? Thinking like layers in photoshop the transparent background and the text on top of it.

If that's the case, how does the "mask" come into play? TextSub just lays the sub information on the page, not a full page image so curious how this all works and why the white text is showing but the black border isn't. Or for that matter, how the "mask" is created in the first place with the script. Hoping to get a good understanding of how this works as the info on the net is minimal for this feature.


Thanks.

JR

Edit: As a side thing, below is what I normally get when I use textsub in VDub directly

http://i68.tinypic.com/9arg5v.jpg

When I did the mask you suggested then used it again in another AVS file (wasn't sure in yours where it belongs, kind of works but have these weird green halo artifacts.

http://i68.tinypic.com/106nc44.png

poisondeathray
13th September 2016, 21:20
If you have a separate black/white mask, you would apply the track matte effect in premiere pro . This is essentially the same thing as an embedded alpha, the difference is the alpha channel is split out (you have RGB + separate A , instead of RGBA in 1 video). For what you are doing, 1 video is usually preferred (easier/faster)

But I would just use masksub() which comes with vsfilter. People have been using this for years with premiere, vegas, NLE's. ASS/SSA/SRT are supported (anything that vsfilter supports). It works perfectly as you see in a media player or vdub. eg if you have variable transparency like a drop shadow the alpha channel will correspondingly be partial greys to show . UT video in RGBA mode definitely works, as does lagarith in RGBA mode. There might be some alpha interpretation issue with other codecs, or issues such as straight vs. premultiplied alphas that can lead to edge artifacts.

http://forum.videohelp.com/threads/364265-Importing-SRT-subtitles-into-Premiere-Pro-CC?p=2319000#post2319000

shekh
13th September 2016, 21:23
You dont see black border because you render same image both to rgb and to alpha. This is pointless. When rendering to alpha you must force all colors to white.

jriker1
14th September 2016, 13:36
If you have a separate black/white mask, you would apply the track matte effect in premiere pro . This is essentially the same thing as an embedded alpha, the difference is the alpha channel is split out (you have RGB + separate A , instead of RGBA in 1 video). For what you are doing, 1 video is usually preferred (easier/faster)

But I would just use masksub() which comes with vsfilter. People have been using this for years with premiere, vegas, NLE's. ASS/SSA/SRT are supported (anything that vsfilter supports). It works perfectly as you see in a media player or vdub. eg if you have variable transparency like a drop shadow the alpha channel will correspondingly be partial greys to show . UT video in RGBA mode definitely works, as does lagarith in RGBA mode. There might be some alpha interpretation issue with other codecs, or issues such as straight vs. premultiplied alphas that can lead to edge artifacts.

http://forum.videohelp.com/threads/364265-Importing-SRT-subtitles-into-Premiere-Pro-CC?p=2319000#post2319000

Thanks poisondeathray. When you say "used with Premiere" are you referring to physically in Premiere or creating the content separately and then adding the resulting content into Premiere? The link you sent works great, only issue I'm having now for some reason is I have a 1 hour and 45 minute snippet that I am using NeatVideo to clean-up. Would normally be about 15 hours to encode. I added the additional layer on top of the video on the second track and all good. Problem, or assuming this is a problem, the video is now taking over 50 hours to encode. Tried Lagarith, MagicYUV, UT_Video. Tried RGBA and YUY2 but no real improvement. Is this normal?!?!?!?!

Thanks.

JR

poisondeathray
14th September 2016, 14:41
Thanks poisondeathray. When you say "used with Premiere" are you referring to physically in Premiere or creating the content separately and then adding the resulting content into Premiere? The link you sent works great, only issue I'm having now for some reason is I have a 1 hour and 45 minute snippet that I am using NeatVideo to clean-up. Would normally be about 15 hours to encode. I added the additional layer on top of the video on the second track and all good. Problem, or assuming this is a problem, the video is now taking over 50 hours to encode. Tried Lagarith, MagicYUV, UT_Video. Tried RGBA and YUY2 but no real improvement. Is this normal?!?!?!?!

Thanks.

JR


I mean physically adding an transparent (with subs) overlay layer. It's actually not required to physically encode it, but it's more stable (there are other options like AVFS)

Not sure, but more layers usually means slower. Because premiere has to composite, and apply neat video on the composite.

Also, quality wise you'd probably get better results from denoising the base layer first, then applying the overlay (ie. you'd apply neat video to the video layer, not an adjustment layer or in a nested sequence)

What are you doing in PP that requires PP? Are you only using it for Neat video ?

jriker1
14th September 2016, 15:31
I have NV for both Premiere and VDub so no. See this thread for my currently problem with VDub and what drove me to this way of doing things:

http://forum.doom9.org/showthread.php?t=173859

So theoretically what I found in that thread is I could encode video in Premiere with or without NV into an AVI and then it will work fine in VDub, but I no longer trust ffmpegsource2 with my original source content, or the version I'm configured to use.

Also I only applied NV directly to the source video layer so don't think it's processing the second "transparent" layer as well. Plugins should only effect the layers you applied them to. Not getting into the system aspects, but funny that I'm only using 11% of my multiple CPU's, 2.3GB of RAM with 10 more GB free, and hard drive is hardly working.

Thanks.

JR

poisondeathray
14th September 2016, 16:21
What is your original source content? AVC in transport stream ?

ffms2 is unreliable, especially for AVC in transport streams. Using threads=1, and seekmode=0 will increase reliability at the expense of speed. Better to use l-smash instead as suggested in that thread, or even better DGSource (not free) if you have an Nvidia card

But I am just wondering if you can skip the PP step altogether (unless you're doing some editing/ other operations). You can also frameserve out of PP using advanced frameserver or debugmode, but frameserving adds extra overhead and can be buggy in newer PP versions

Newer NV versions are much faster with GPU support, but 11% suggests an overlay bottleneck

jriker1
14th September 2016, 19:27
If DGSource is not free, where do I get it? Seems like it's very obscure when you search the net for references to it. Perhaps it was discontinued.

Also reviewing L-Smash now. Just checked the encoding of the M2TS file to AVI and it still says 45 hours, not dropping actually increasing after half a day.

EDIT: Does L-Smash work with 2.5.8 at all or just 2.6? Think that's why I didn't try it. I installed against my better judgement the 2013 and 2015 x86 libraries but won't load the DLL.

EDIT: OK moved to 2.6 and trying it now. Hanging VDub so guessing it's indexing...

EDIT: Still trying, L-Smash is a pain. First time indexed and when I clicked anywhere on the timeline got an access violation of some sort. Second time I added cache=True and now getting something about return value was not a video and am not setting any variables. Reindexing again. Wow this thing is really bad sure this is a good plugin? Getting "error reading source from ####: Avisynth read error: Avisynth: access violation at 0x0013C24 in d:\Program Files(x86)\AviSynth\plugins\LSMASHSource.dll, attempting to read from 0x0000000C.

EDIT: Reinstalled AVISynth 2.6 to see if that would help and get this. L-SMASH won't work anymore. Tried everything I could to resolve the dependencies and no joy.

Thanks.

JR

poisondeathray
15th September 2016, 00:48
If PP /NV is 45 hours and not budging, it's probably hanging for some reason. Doesn't make any sense to me if you could encode with NV without the overlay

For DGNVTools (DGSource) it used to be neuron2.net, now the forum is
http://rationalqm.us/board/index.php

Yes the concensus is l-smash is much better than ffms2 (and for AVC transport streams it definitely is), but you might have to find a "good" version. Try the msvc 32bit version, people seem to have problems with the version that links to libraries dynamically. You might be able to salvage ffms2 results by using threads=1, seekmode=0, but it will be very slow. Try threads=1 at least first.

Last resort would be to use directshowsource, but I wouldn't use it with any filtering like NV . Only to decode linearly the source video into an intermediate.

Other options :
You could frameserve out of PP (with NV applied or not in PP), then into vdub (with NV applied or not). Since you have both NV versions. Older PP versions were definitely more stable with frameserving, but YMMV. Or export out an intermediate from PP to apply the subs and/or NV.

jriker1
15th September 2016, 01:09
Thanks for the help. With AVISynth 2.6 and the latest ffmpegsource2 version 2.2 it is still causing those funky grey screens.

Premiere is still running and is at 41 hours yeah. So moved a bit.

I'm going to try and find a static version and see if it's any better of l-smash.

I've tried frame serving to premiere even before the CC version and wasn't super stable. Stay tuned.

EDIT: CRAP I really want this to work but I just don't get it. Totally clean Win7 system until I started this journey, removed AVISynth 2.5 installed 2.6. Copied over LSMASHSource.dll the latest msvc 32bit version. Had to install C++ 2015 redistributable. Loaded, indexed, and when I clicked on the timeline got the error again but a bit different this time: "Error reading source frame #####: Avisynth read error: CAVIStreamSynth: Stream exception - Access Violation at 0x69401dc4, reading from 0xc. According to the below it's a memory leak with the plugin but since I've never used 2.6 will assume it's not physically AVISynth.

http://avisynth.nl/index.php/FAQ_common_errors#When_frameserving_I_got_the_following_message:_.22CAVIStreamSynth:_System_exception_-_Access_Violation_at_0x0.2C_reading_from_0x0.22.3F


Thinking I'm going to have to have premiere losslessly convert it to AVI and then burn in the subs with ffmpegsource2 in VDub even though I technically no longer trust it. Still hope to figure this out.

JR

poisondeathray
15th September 2016, 01:55
Thinking I'm going to have to have premiere losslessly convert it to AVI and then burn in the subs with ffmpegsource2 in VDub even though I technically no longer trust it. Still hope to figure this out.



If you end up doing that, use AVISource() instead - you won't have to index it and you should be able to "trust" it more



I've tried frame serving to premiere even before the CC version and wasn't super stable.


Did you mean "TO" or "FROM" ?

Frameserving from PP (ie. exporting from PP), you would use advanced frameserver or debugmode frameserver

Frameserving into PP (ie. importing an avs script, instead of using a large lossless intermediate), you would typically use avisynth virtual frame server (AVFS)




If you were able to use NV in PP on a single layer; adding a simple transparent overlay with subs shouldn't cause it to take much longer so something seems very wrong there

poisondeathray
15th September 2016, 02:00
What is the source video? I'm assuming AVC in transport stream, because you never corrected me, but is it progressive or interlaced ? If progressive then another thing you can try is remux into a MKV container using mkvmerge/mkvtoolnix then use ffms2. AVC in .m2ts , .mts, or .ts is like green kryptonite for ffms2, especially "interlaced" AVC (either PAFF or MBAFF)

jriker1
15th September 2016, 02:12
What is the source video? I'm assuming AVC in transport stream, because you never corrected me, but is it progressive or interlaced ? If progressive then another thing you can try is remux into a MKV container using mkvmerge/mkvtoolnix then use ffms2. AVC in .m2ts , .mts, or .ts is like green kryptonite for ffms2, especially "interlaced" AVC (either PAFF or MBAFF)

Yes and it's progressive. Right now a bit frustrated. Had a problem a while back and after rebuilding the system it went away where in Premiere Pro I would see high memory usage and encode really fast. Ever since I've been installing and removing these C++ libraries for l-smash it came back. For me what high memory usage in premiere pro means is fast encoding times and NO NeatVideo cleanup. It just doesn't do anything. 1 hour 45 minute video is encoding in about an hour now with the mask layer removed and know that's not right with NV cleanup there.

jriker1
15th September 2016, 02:26
If you were able to use NV in PP on a single layer; adding a simple transparent overlay with subs shouldn't cause it to take much longer so something seems very wrong there

That was my thoughts but just removed that layer and it's now a little over 11 hours which is what I'm used to. I'll try adding the layer in again when done but who knows what's happening unless encoding to RGBA is the issue but have tried YUY2 which I'm using right now and didn't change it. Maybe the PP encoder has an issue with clips with an alpha channel.

poisondeathray
15th September 2016, 02:51
Well its definitely going to be slower with an overlay, but you left it overnight and it barely budged so something is wrong. It definitely shouldn't take 3-4x longer with a single additional layer. PP handles RGBA overlays without problems, people use them all the time as assets. UT RGBA is very stable, I'm assuming that is what you used. There were some reports of crashing with Magic YUV in PP, at least with earlier versions. Historically for commercial overlays, Quicktime animation codec was used most frequently; but recently QT supposedly has some security issues and was pulled from Windows. Adobe (and all commercial windows programs) are in sort of a transition period with Apple / MOV formats

Converting to /from RGB (and back to YUV assuming that's your final format goal) takes time too, also you incur quality loss, but NV works in RGB so incurring that additional loss is sort of a "sunk cost" if you use NV . Overlays and subs in avisynth can work in YUV, so you don't have that unnecessary loss, and it's faster , fewer conversions

jriker1
15th September 2016, 13:36
Right now I'm using Lagarith for the encoding which I guess has to change due to it not being supported in Windows 10 however it has it's own RGBA mode. I did try MagicYUV, and UT_Video but all had the same extensive times right out of the gate. This encode has a bit over an hour to go without the overlay so when it's done I will just add it back into the project and see what happens. I am encoding with YUY2 colorspace right now.


JR

jriker1
15th September 2016, 17:23
OK so after 11 and a half hours video finished. That was good. I re-generated the mask avi as I removed both MagicYUV and UT_Video and recreated it with Lagarith. Dropped the mask into the timeline under V2 (Video 2) and all looks good. Exported with the same YUY2 settings as I did the last run. Started with 16 hours. Was like OK that's not great but OK. Then went to 30 hours, 20 minutes later was at 32 hours so guessing this will continue. What up with that?!?!?

Oh, by the way if I click on the little picture of the eye for the overlay video which essentially is don't show it, time goes back to like the 11 hours. Fun part, if I hide the primary video and just leave the overlay layer, memory usage by VDub skyrockets and it shows it will render in about an hour. So neatvideo isn't applied to the overlay layer, but that is the only real difference in the picture unless Premiere is just having issues applying the overlay to the video below it. Am I supposed to set anything with the overlay video like transparent areas or anything that would make it work better? Didn't seem like it was necessary when I viewed it in Premiere visually. Hmmmm...

JR

poisondeathray
15th September 2016, 19:10
A quick 1920x1080 test on my end with Adobe CC PP/AME - with the video only if we say that was 1.0x speed, with a RGBA UT overlay it took about 1.3-1.4x longer for a typical h264 mainconcept encode. So something is up with your configuration or setup

I'm assuming you're using CPU encoding ? UT does steal CPU cycles for decoding, that also contributes to the slowdown along with the overlay operation and colorspace changes. So if you used uncompressed video overlay (but on a SSD, so you don't have I/O bottlenecks), that would encode faster because fewer CPU cycles used for decompressing the video, and more can be used for encoding


Am I supposed to set anything with the overlay video like transparent areas or anything that would make it work better?


No. When you have embedded alpha with RGBA, you don't need to use a separate mask channel or use track matte effect. More layers is even slower, because more CPU cycles are used decoding all those videos. So if you had main video, overlay layer, mask layer plus an added effect - that would be slower than just 2 layers


And another thing you could do to speed it up if your "subs" were only on the bottom half or quarter of the screen, is crop the top half or 3/4 in the script, then position it on the overlay track. Since the overlay layer would be something like 1920x540 or something, it should decode faster, consume fewer cycles, and be smaller in filesize as an intermediate. But I still think something is misconfigured or buggy on your setup if you're slowing that much with a simple overlay only

jriker1
15th September 2016, 21:04
Yep CPU. This is more of a server system so more system horsepower and less GPU power. I tried uncompressed but here's the interesting part. I created a 1 minute uncompressed version of the file. Put it at the front of the timeline on the second track. Currently showing 31 hours and climbing to render the track. Hard for me to think it's my system that's causing this as it works fine otherwise.

Also I disabled NeatVideo so has the primary video, no editing, and the alpha channel video on V2. With NeatVideo this takes 11 to 12 hours to convert. Without it's already at 21 hours and there is no NeatVideo anymore. I can say that without the second layer the memory shoots thru the roof (9+ GB) and Premiere encodes like mad. With the second layer in there memory is only 1.8GB used by Premiere right now.

NOW. If I put the same video on top of each other so the source video on V1 and also V2 it renders in like an hour or so or would if I finished it. I assume it has no clue that the video is duplicated and totally covering the other one so ignore the V1 version. So is it something to do with RGBA content? Is it whatever is being created because of AVISynth? Would think not on the second part because VDub controls the output.

If relevant the original source video is encoded yuv420p 1920x1080 and h264 High.

poisondeathray
15th September 2016, 22:03
Yep CPU. This is more of a server system so more system horsepower and less GPU power. I tried uncompressed but here's the interesting part. I created a 1 minute uncompressed version of the file. Put it at the front of the timeline on the second track. Currently showing 31 hours and climbing to render the track. Hard for me to think it's my system that's causing this as it works fine otherwise.


Uncompressed 8bit RGBA would only work faster if you have no other bottlenecks like transfer I/O . A single mechanical HDD would be a bottleneck for 1920x1080 uncompressed 8bit RGBA

I'm not saying hardware issue, I'm saying configuration issue. PP (or any NLE) shouldn't have that much problems with a simple overlay. It might be an incompatibility issue with UT Video and your setup, but I doubt it. UT is very stable, and the recommended DI on the adobe forums. But you could try quicktime animation, or even an image sequence but those will for sure decode slower on a properly working system. On a properly working system, UT and magicyuv should be the fastest.


Also I disabled NeatVideo so has the primary video, no editing, and the alpha channel video on V2. With NeatVideo this takes 11 to 12 hours to convert. Without it's already at 21 hours and there is no NeatVideo anymore. I can say that without the second layer the memory shoots thru the roof (9+ GB) and Premiere encodes like mad. With the second layer in there memory is only 1.8GB used by Premiere right now.

NOW. If I put the same video on top of each other so the source video on V1 and also V2 it renders in like an hour or so or would if I finished it. I assume it has no clue that the video is duplicated and totally covering the other one so ignore the V1 version. So is it something to do with RGBA content? Is it whatever is being created because of AVISynth? Would think not on the second part because VDub controls the output.


Yes it completely covers it. It's essentially 1 video - so the "1.0x" speed scenario in my example above.

I gave you some expected numbers for UT RGBA and PP. It is slower, but not the slowdown that you're getting. Something is definitely wrong. Low cpu usage suggests a bottleneck and that shouldn't be happening with UT on 1920x1080 on a server let alone a typical desktop. You said the "baseline" video alone of 1h 45min video takes about 1hour. So it's not that fast really, not even 2x realtime speed. UT video can easily feed at 200-400 fps for 1920x1080 even on an average desktop so it shouldn't be the bottleneck (sure it will consume CPU cycles for decoding, reducing the output encoding speed, but you shouldn't be in the order of 30+ hours or 10-20x slower like you're reporting)

If in the preview, the subs look correct, it has nothing to do with avisynth or vdub at this point - they did their job correctly. With NV disabled, it has nothing to do with NV either. It's likely a PP, or codec issue, or system configuration issue at this point

What version of PP are you using ?

jriker1
15th September 2016, 23:55
I'll try UT again but have been using Lagarith. Didn't see much difference before between the three codec's I tried which included UT. May upgrade my Premiere to 2015 and see. Been holding off on the upgrade more from laziness than anything.

poisondeathray
16th September 2016, 00:17
I'll try UT again but have been using Lagarith. Didn't see much difference before between the three codec's I tried which included UT. May upgrade my Premiere to 2015 and see. Been holding off on the upgrade more from laziness than anything.

On something like typical subs with blank frames interspersed without dialog, there should be a large size discrepancy. Lagarith compresses them better, but UT video is faster. But not 10x slower. But the differences between those lossless codecs cannot account for what you are reporting. It has to be some compatibility or configuration issue. A simple overlay should not slow you down as much as you are reporting

jriker1
16th September 2016, 21:59
OK here's what I got.

1. I removed NeatVideo fully.
2. I removed Premiere Pro 2014 fully.
3. I installed Premiere Pro 2015 latest.
4. Opened the project and encoded.

Same deal?

I can say a couple things:

1. I NEVER see my CPU usage go high with premiere. Usually it's just the memory. The more memory I see it use the faster it encodes. (keep in mind always use AVI)
2. if I encode with like H264 at a high bitrate, it is like 44% CPU and 5GB of ram and will take a bit over 2 hours 50 minutes.
3. if I encode into an AVI it takes right now about 22 hours and using like 4% CPU and 2.6GB RAM. Not sure if that 22 hours will stick or rise, seemed like it stabilized but a bit more than my last pre Premiere 2015 test without NeatVideo.

Poisondeathray, did you ever try with AVI or just H.264?

That said, the output I'm creating is an intermediate format. What alternatives to a lossless codec with AVI do I have that is also lossless but may work faster based on my results?

Thanks.

JR

jriker1
16th September 2016, 22:23
More data with the AVI:

Don't render with max depth or quality and leave 24bit not 32: Still no CPU but 3.9GB RAM and at 2 1/2 hours.
Check Render at Maximum Depth: basically the same
Check also Render Max Quality: 2.7GB Ram and at 30+ hours.

Won't even bother with 32bit depth with this.

Uncheck Render Max Quality and select 32bit depth: 4.3GB Ram and about 2 hours 15 moving a bit still.

AHHH, so even though I've always used it looks like Render Max Quality is killing it. Why is this and with a lossless codec what should I be setting anyway?

Hoping this is a eureka moment.

Thanks.

JR

poisondeathray
17th September 2016, 00:58
I'll summarize it for you, but you can read up on it on the Adobe help or various forums

MRQ is located in 2 places now, the sequence settings, and render settings. And it funcitons slightly differently if you have MPE enabled or disabled.

When enabled it uses 32bit processing and better scaling algorithms. It can be much slower depending on what types of operations you are doing or project specifics. The benefit might be significant or nothing. For a straight overlay the benefit is basically nothing. You can encode a short test to check . (Actually the quality is worse than doing it in simple 8bit avisynth in YUV, I've posted proof in other threads before. The overlay operation and RGB conversion even in 32bit float, introduces more banding)

However, NV does support 32bit (at least the newer versions do in AE, not sure about PP version) , on some types of material and projects there is a large benefit to processing in 32bit linear. The difference is probably negligible for what you are doing here with NV and overlay.

Your "lossless" codecs are only 8bit (there are some 10bit variants for magicyuv and ut), but the intermediate calculations are done in 32bit. There are a lot more decimal places and precision that's why it's so slow