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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th December 2018, 13:42   #1  |  Link
varekai
Registered User
 
varekai's Avatar
 
Join Date: Jul 2006
Posts: 530
add black bars on top and bottom

wrong forum

Last edited by varekai; 30th December 2018 at 13:54. Reason: wrong forum
varekai is offline   Reply With Quote
Old 30th December 2018, 12:34   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Wrong forum.
Maybe move to New and alternative a/v containers, or some other forum.

EDIT: To below. I just wanted for you to get the best answer, you may not have gotten any answers in this forum.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 30th December 2018 at 14:11.
StainlessS is offline   Reply With Quote
Old 30th December 2018, 13:51   #3  |  Link
varekai
Registered User
 
varekai's Avatar
 
Join Date: Jul 2006
Posts: 530
Quote:
Originally Posted by StainlessS View Post
Wrong forum.
Maybe move to New and alternative a/v containers, or some other forum.
OK! Posted same question here before, you gave me instructions some time ago so I thought I'd ask for help here.
varekai is offline   Reply With Quote
Old 30th December 2018, 15:34   #4  |  Link
Qaenos
Registered User
 
Join Date: Oct 2018
Posts: 35
Is this what you are trying to do:

YourVideo = ColorBars(640,480) # This should be the video you are adding black bars to. I'm using ColorBars as a test.
BarH = 100 # Your desired height of each black bar
BarW = YourVideo.Width # Width of black bar has to be the same as your video
BlackBar = BlankClip(YourVideo, Width = BarW, Height = BarH) # Create a black bar using your video as a template (so that the pixel type, fps, etc. match)
FinalVideo = StackVertical(BlackBar, YourVideo, BlackBar) # Place a black bar on top and below your video
Return FinalVideo
Qaenos is offline   Reply With Quote
Old 30th December 2018, 15:54   #5  |  Link
varekai
Registered User
 
varekai's Avatar
 
Join Date: Jul 2006
Posts: 530
Quote:
Originally Posted by Qaenos View Post
Is this what you are trying to do:
See this post: https://forum.doom9.org/showthread.p...25#post1861425
varekai is offline   Reply With Quote
Old 30th December 2018, 16:20   #6  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Qaenos View Post
YourVideo = ColorBars(640,480) # This should be the video you are adding black bars to. I'm using ColorBars as a test.
BarH = 100 # Your desired height of each black bar
BarW = YourVideo.Width # Width of black bar has to be the same as your video
BlackBar = BlankClip(YourVideo, Width = BarW, Height = BarH) # Create a black bar using your video as a template (so that the pixel type, fps, etc. match)
FinalVideo = StackVertical(BlackBar, YourVideo, BlackBar) # Place a black bar on top and below your video
Return FinalVideo
Yes, all roads lead to Rome. I prefer the shorter route.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 30th December 2018, 19:03   #7  |  Link
varekai
Registered User
 
varekai's Avatar
 
Join Date: Jul 2006
Posts: 530
Quote:
Originally Posted by Groucho2004 View Post
Yes, all roads lead to Rome. I prefer the shorter route.
swoosh...that's way over my head...
varekai is offline   Reply With Quote
Old 30th December 2018, 19:23   #8  |  Link
Qaenos
Registered User
 
Join Date: Oct 2018
Posts: 35
Quote:
Originally Posted by Groucho2004 View Post
Yes, all roads lead to Rome. I prefer the shorter route.
Excellent! I didn't know that existed.
Qaenos is offline   Reply With Quote
Old 30th December 2018, 20:15   #9  |  Link
varekai
Registered User
 
varekai's Avatar
 
Join Date: Jul 2006
Posts: 530
Quote:
Originally Posted by Qaenos View Post
Excellent! I didn't know that existed.
Oh... how I wish I could understand how this could help me...
varekai is offline   Reply With Quote
Old 30th December 2018, 22:27   #10  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by varekai View Post
Oh... how I wish I could understand how this could help me...
Not sure that it can, I assumed that you do not want to re-encode the clip because of the ffmpeg requirement.

But In Avisynth eg,
Code:
BTOP=100 # or whatever, best be a multiple  of two
BBOT=100 # Ditto

AviSource("...")
AddBorders(0,BTOP,0,BBOT,Color=$000000) # Black
Return Last
There is also LetterBox which is sort of Crop and Addborders combined(result frame size does not change):- http://avisynth.nl/index.php/Letterbox

I do note that the old Letterbox docs were wrong,
Letterbox(clip,int top,int bottom,int "left",int "right",int "color")
Left and Right were never args to letterbox, should have been x1 and x2.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 31st December 2018, 12:48   #11  |  Link
varekai
Registered User
 
varekai's Avatar
 
Join Date: Jul 2006
Posts: 530
@StainlessS

Thanks for trying to help.
I really don't understand how avisynth works.
It would be ideal if encoding could be avoided because it's very timeconsuming.
I don't ask you to micromanage me but I need more guidance with values and how to "load" these values into avisynth, like using a batfile if possible?
Basically its about to pad an mkv, 3840x1598 to 3840x2160 keeping correct color values.

Kind regards

Code:
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0050 cd/m2, max: 4000 cd/m2
Maximum Content Light Level              : 1125 cd/m2
Maximum Frame-Average Light Level        : 248 cd/m2
varekai is offline   Reply With Quote
Old 31st December 2018, 13:12   #12  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by varekai View Post
It would be ideal if encoding could be avoided because it's very timeconsuming.
It can't be avoided if you want to add black bars.
So, since you already have a batch file that adds them with ffmpeg and you learned in the other thread how to adjust the colour metadata you're good to go. You don't need Avisynth in this case.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 31st December 2018, 13:31   #13  |  Link
varekai
Registered User
 
varekai's Avatar
 
Join Date: Jul 2006
Posts: 530
Quote:
Originally Posted by Groucho2004 View Post
It can't be avoided if you want to add black bars.
So, since you already have a batch file that adds them with ffmpeg and you learned in the other thread how to adjust the colour metadata you're good to go. You don't need Avisynth in this case.
Thanks for clarifying! I'm a happy camper!

Regards
varekai is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.