I am encoding my DVDs to MP4 with different bitrates for adaptive streaming.
I have to cover different screen sizes and below are my stream configurations:
400x224 with 150k
400x224 with 300k
400x224 with 500k
400x224 with 800k
768x432 with 1200k
768x432 with 1800k
I am using the below AVISynth script to place my watermark on the videos:
a1=LanczosResize(768,432) # Lanczos (Sharp)
a2=ImageReader("D:\Watermarks\watermark1_80x80.png ")
a3=ImageReader("D:\Watermarks\watermark1_80x80.png ",pixel_type="RGB32").ShowAlpha(pixel_type="RGB32" )
Overlay(a1,a2,mask=a3, x=650, y=10)
I am using 2 different watermark sizes to for the above 2 different sizes. If I use only one watermark size, the watermark looks either small or big depending on the screen size.
For mobiles, I am using first 4 streams and for the TVs, I am using last 3 streams.
As 400x224 is small for the TV, the watermark appears big when it is resized to HDTV resolution. If I decrease the watermark size, it will effect on mobile devices.
Also, when the next resolution is picked up by adaptive streaming, I see little displacement of the watermark as the watermark used on 768x432 is of different size.
For HD source, we also have 1280x720 streams with different watermark size. When we club all these 3 different resolutions in adaptive streaming, we see lot of displacement in the watermark when different resolutions are picked up.
Could you please let me know your suggestions to maintain the constant size/placement for the watermark on different resolutions?
+ Reply to Thread
Results 1 to 18 of 18
-
-
I'm not exactly sure what you're asking - is this an automated script ? How is this implemented ?
Assuming it's for all the same AR (16:9) , one approach might be to start with the largest version then scale those down . This way you would only need 1 script for the overlay , and when you downscale it will be in proportion and with correct placement . -
Thank you for your very quick suggestion poisondeathray.
Currently, I am encoding the DVDs using MeGUI. So, I am loading the input and applying the AVISynth script to resize and then apply watermark. The same is repeated for different screen resolutions/bit rates. The iterations are performed manually by editing the script.
The source is same for all the renditions and also the AR (16:9). So, do you suggest to start the encoding with large bit rate (1800k in my case) and then take this output as input for other bit rates?
If so, will there be any effect on quality as we are encoding it twice?
Thank you for your time! -
If so, will there be any effect on quality as we are encoding it twice?
I'm suggesting to do this all in the script, but starting with the largest size - this way any downsizing keeps the logo placement and proportion
Just add the resize to smaller dimensions at the end at the end of the largest script, for those smaller versions
e.g for the 400x224 version
Code:a1=LanczosResize(768,432) # Lanczos (Sharp) a2=ImageReader("D:\Watermarks\watermark1_80x80.png ") a3=ImageReader("D:\Watermarks\watermark1_80x80.png ",pixel_type="RGB32").ShowAlpha(pixel_type="RGB32" ) Overlay(a1,a2,mask=a3, x=650, y=10) LanczosResize(400,224)
-
For HD source, we also have 1280x720 streams with different watermark size. When we club all these 3 different resolutions in adaptive streaming, we see lot of displacement in the watermark when different resolutions are picked up.
If you set your overlay and watermark on the largest version, then subsequent downscaling will keep everything in place . So if you had an HD version, set your overlay for the largest HD version, then add the resize in the script at the end for the lower res versions -
Thank you so much! Got it and the problem solved.
I am using .PNG file for the watermark and there is small text in the watermark. The text is not visible in small resolutions. Do you have any suggestions to improve the watermark quality?
Thank you once again for your great suggestion and time! -
Without seeing an example, I'm guessing it's likely a resolution issue , not a low bitrate / compression issue .
If you preview the .avs script in vdub or avspmod for the small resolution version , that's uncompressed. If it's not even legible there, then it's not the fault of compression , bitrate or encoding settings . This means the only way to make it more legible is to redo the watermark - either make it larger for all versions or at least proportionately larger for the smaller resolution versions -
It depends what your goal is. There are different scaling kernals for different goals . They all have tradeoffs - e.g. sharper but more ringing, vs. blurry etc... For low bitrates you generally usually want softer resizing. The more sharpened , the more bitrate required . So also it's important to know in what type of encoding context, bitrate range and type of content
Here is a vizualization page of some resizing kernals
http://svn.int64.org/viewvc/int64/resamplehq/doc/kernels.html -
Thank you for providing lot of information. I will go through them and see whether its my PNG issue as it already got some light colors.
-
Sorry! I have one more question!
While encoding from DVD to MP4 using AVISynth, I see only 15% of CPU usage. I have 8 cores and I see only one core is fully utilized and currently, the encoding speed is around 45fps.
Is it possible to increase the CPU usage and increase encoding fps?
Thank you -
Probably, yes, and by quite a bit by using a multi-threaded version of AviSynth:
http://avisynth.org/mediawiki/MT_support_page
http://avisynth.org/mediawiki/MT
And you'll probably want to use SEt's latest version:
http://forum.doom9.org/showthread.php?t=148782 -
There can be other bottlenecks. e.g. mpeg2source isn't well multithreaded, certain filters, certain encoding settings are poorly multithreaded
Post more information on your full script and encoding settings . Just adjusting encoding settings alone can make it 10x slower or a few times faster
There is only so much you can do - usually the the "best" way in terms of efficiency is to parallelize - simultaneous jobs. This makes sense since you are doing multiple versions anyway -
Hello poisondeathray and manono,
Thank you for all your suggestions! I have tried your suggestions over the weekend and I have solved many of my issues.
As mentioned by poisondeathray, I placed the watermark on largest resolution and then down scaled. It works perfect on all the devices/resolutions.
For more CPU utilization, I tried AVISynth MT, but it seems that MT is not reliable, at least on my system. So, I increased number of workers on MeGUI to two and I see 85% of CPU utilization now.
Thank you! -
Hello posisondeathray and manono,
I have posted some av sync issue https://forum.videohelp.com/threads/350301-DVD-to-MP4-A-V-Sync-issues?p=2196485 with my encoding and when you get few minutes, could you please let me know your suggestions?
Also, please let me know your suggestions to improve the encoding quality. I have also attached my X264 profile info, used on MeGUI.
As always, thank you for your time! -
It's probably not your system at fault. It's more likely you're using filters that aren't 'MT friendly', as pdr mentioned. When it works and it gets the CPU utilization much higher, the encoding speed takes a big jump. When it doesn't work your encoder may crash or freeze. You just have to play around with it and see what works for what combination of filters.
If SetMTMode(2,8) doesn't work, try SetMTMode(3,8) before giving up and going to SetMTMode(5,8) (which may provide a slight boost). And if SetMTMode(2,8) works well, sometimes SetMTMode(2,12) works even better. You just have to experiment. -
Thank you for the details Manono. I will try and see which one works for me.
Any ideas on the av sync issues?
Similar Threads
-
Help with subtitle placement
By Mystic DUDE in forum Newbie / General discussionsReplies: 2Last Post: 31st Oct 2011, 08:39 -
equipment placement and grounding
By smartel in forum Newbie / General discussionsReplies: 1Last Post: 5th Jun 2011, 16:37 -
Rack-mount TBC's (question about placement)
By VDubMike in forum RestorationReplies: 2Last Post: 29th Mar 2010, 00:29 -
Thermal Probe Placement
By AuroEdge in forum ComputerReplies: 2Last Post: 10th Feb 2010, 07:19 -
Monitor - User Distance? Placement of Screen.
By therock003 in forum Newbie / General discussionsReplies: 10Last Post: 15th Dec 2008, 14:55