If I try real hard, I can duplicate the problem with the "tor_clip.demuxed.m2v" sample from post number 9.
Take a 2.40:1 video and open it with the following script:
DirectShowSource("E:\video.mkv")
Spline36Resize(720,432)
AddBorders(0,72,0,72)
AssumeFPS(25)
You get a 720x576 frame which requires a 16:9 aspect ratio to display correctly. But..... use ffdshow for decoding, enable the resize filter, set it to resize to a 16:9 aspect ratio, and make sure "keep aspect ratio" is checked, and the result when opening the script in MPC-HC would be video with extra black bars and an aspect ratio that's stretched a bit vertically, all in a 720x576 frame. It had 130 pixels of back top and bottom when I checked, which matches what manono worked out at the time.
If I then forced MPC-HC to display the script using a 4:3 aspect ratio (remembering it's currently 5:4 - 720x576) it squished the picture back down by just enough to return the aspect ratio to pretty much the same as the original. What would the odds be that's what happened???? But if I do all the above, and encode the script while setting a 16:9 aspect ratio, the result is attached.
Open the m2v file using MPC-HC, force a display aspect ratio of 4:3 and the picture aspect ratio is correct again.
Personally I think the "hasl2.demuxed.m2v" sample from post #29 looks pretty right. If it's not perfect, it's a lot closer to being right than if it's changed to 4:3.
+ Reply to Thread
Results 31 to 57 of 57
-
Last edited by hello_hello; 3rd Mar 2014 at 20:46.
-
-
Last edited by davexnet; 5th Mar 2014 at 00:26.
-
Here are the AvsToDVD log file and the screenshot of the source file opened in Avidemux:
PROJECT SETTINGS
DVD Video Standard: NTSC
DVD Titles number: 1
DVD Size: 8099/8100 MB (100%)
DVD Output Setup: DVD Folder
DVD Label: DVD
DVD Menu: No Menu
Output Folder: D:\DVD\AVS2DVD
Delete Temp Assets Files: No
Delete Temp Working Files: No
Edit Command Parameters: No
Post Process Task: Show Progress Status window
PREFERENCES
MultiThread: 1
AVS Video Source Filter: A2DSource
AVS Audio Source Filter: A2DSource
AVS UpSize/DownSize Filter: Lanczos4Resize/Spline16Resize
Frame Adjust Strategy: 1
PAL SpeedUp: 0
Video Resolution: 0
Video BitRate Min: 2500
Video BitRate Level 1: 6500
Video Profile Level 2: 4500
Video BitRate Max: 8500
Keep DVD Compliant Video: 1
AC3 Audio Encoder: 0
Force FFmpeg for Long Audio: 1
DVD Audio Format: 0
DVD Audio BitRate: 448
Keep DVD Compliant Audio: 1
Normalize Audio: 0
Auto Delay Audio: 1
DVD Audio Language (Primary): EN - English
DVD Audio Language (Secondary): EN - English
DVD Subs Language (Primary): HR - Croatian
DVD Subs Language (Secondary): EN - English
DVD Subs Font: Tahoma 20pt Bold (255,255,255)
Chapters Interval: 5
Use Source Chapters: 1
DVD Burning Drive: E: HL-DT-ST DVDRAM GH22NS70 EX01
DVD Burning Speed: 16x
Auto Erase DVD RW: 0
Unload ActiveMovie library: 0
Adjust ffdshow at runtime: 1
Save General Settings: 0
<>
<4.3.2014. 21:07:00>
TITLE 1 SOURCE FILES
Video: D:\DVD\720p.bluray.x264.mkv
Info: AVC - 4152 kbps - 1280x536 - DAR 2,388 - 23,976 fps (CFR) - Progressive - 2:18:04 hours - 198622 frames
Audio 1: D:\DVD\720p.bluray.x264.mkv
Info: DTS - 1509 kbps - CBR - 6 ch - 48000 Hz - 24 bit - 2:18:04 hours (0 ms delay) - EN
Subs 1: D:\DVD\720p.bluray.x264.kopija.srt
Info: SubRip (SRT) - D:\DVD\720p.bluray.x264.kopija.srt
[MediaInfoLib - v0.7.61]
<>
<4.3.2014. 21:07:00>
AVISYNTH SCRIPT
Import("C:\Program Files\AVStoDVD\Lib\A2DSource.avsi")
Video = A2DVideoSource("D:\DVD\american.hustle.2013.720p.b luray.x264-sparks.mkv", CacheFolder="D:\DVD\AVS2DVD", FrameRate=23.976, VFR=false)
# Audio is frameserved by AviSynth just for Preview and Edit purposes.
Audio = A2DAudioSource("D:\DVD\american.hustle.2013.720p.b luray.x264-sparks.mkv", CacheFolder="D:\DVD\AVS2DVD")
Video = Video.ConvertToYV12()
Video = Video.AddBorders(0,90,0,92)
Video = Video.Spline16Resize(720,480)
#Using DGPulldown/HCenc to upsize FPS
AudioDub(Video, Audio)
<>
<4.3.2014. 21:07:00>
START VIDEO ENCODING OPERATIONS
Encoding Profile: FFmpeg CBR 1-pass
Target Video FileSize: 7415,4 MB
Encoding Parameters: -i "D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.bl uray.x264-sparks_1.avs" -threads 2 -aspect 16:9 -c:v mpeg2video -b:v 7509k -minrate 7509k -maxrate 7509k -bufsize 2000k -dc 10 -y "D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.bl uray.x264-sparks.m2v"
<>
<4.3.2014. 22:21:19>
END VIDEO ENCODING OPERATIONS
Video Source Filter: A2DSource (DirectShowSource)
Created File: D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.blu ray.x264-sparks.m2v (7415,5 MB)
OUTPUT VIDEO INFO: MPEG-2 Video - 7509 kbps - 720x480 - DAR 1,778 - 23,976 fps (CFR) - Progressive - 2:17:56 hours - 198425 frames
<>
<4.3.2014. 22:21:19>
START PULLDOWN OPERATIONS
DGPulldown Parameters: "D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.bl uray.x264-sparks.m2v" -srcfps 23.976 -destfps 29.97 -inplace -tff
<>
<4.3.2014. 22:33:08>
END PULLDOWN OPERATIONS
DGPulldown executed on File: D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.blu ray.x264-sparks.m2v (7415,5 MB)
OUTPUT VIDEO INFO: MPEG-2 Video - 7509 kbps - 720x480 - DAR 1,778 - 23,976 fps (CFR) - Progressive (2:3 Pulldown) - 2:18:04 hours - 198625 frames
<>
<4.3.2014. 22:33:08>
START AUDIO ENCODING OPERATIONS (Track 1)
FFmpeg Parameters: -i "D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.bl uray.x264-sparks_1.avs" -threads 2 -y -vn -acodec ac3 -ab 448k "D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.bl uray.x264-sparks_1.ac3"
<>
<4.3.2014. 22:43:24>
END AUDIO ENCODING OPERATIONS (Track 1)
Audio Source Filter: A2DSource (DirectShowSource)
Created File: D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.blu ray.x264-sparks_1.ac3 (442,4 MB)
OUTPUT AUDIO INFO: AC3 - 448 kbps - CBR - 6 ch - 48000 Hz - 16 bit - 2:18:04 hours (0 ms delay)
<>
<4.3.2014. 22:43:26>
START SUBS ENCODING OPERATIONS (Track 1)
SRT fixing routine applied (0 lines fixed).
SubtitleCreator Parameters: "D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.bl uray.x264-sparks.srt" -p4 -i"C:\Program Files\AVStoDVD\SubtitleCreator\Examples\VTS_01_1.I FO"
<>
<4.3.2014. 22:43:53>
END SUBS ENCODING OPERATIONS (Track 1)
Created File: D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.blu ray.x264-sparks_1.sup (4,08 MB)
<>
<4.3.2014. 22:43:53>
START DVD AUTHORING OPERATIONS
BatchMux Parameters: -arglist "D:\DVD\AVS2DVD\DVD_1_BatchMux.ini"
BatchMux ini file:
-d "D:\DVD\AVS2DVD\DVD_1\VIDEO_TS"
-mxp "D:\DVD\AVS2DVD\DVD_1_MuxMan.mxp"
-l "D:\DVD\AVS2DVD\DVD_1_MuxMan.log"
-muxman "C:\Program Files\AVStoDVD\MuxMan"
-prio LOW
-palette "D:\DVD\AVS2DVD\DVD_1_Palette.txt"
-v "D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.bl uray.x264-sparks.m2v"
-vidmode LB
-a1 "D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.bl uray.x264-sparks_1.ac3"
-a1lang en
-s1 "D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.bl uray.x264-sparks_1.sup"
-s1lang hr
-s1ext 1
-cellfr "D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.bl uray.x264-sparks_Chapters.txt"
-progfr "D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.bl uray.x264-sparks_Chapters.txt"
-chapfr "D:\DVD\AVS2DVD\DVD_1_american.hustle.2013.720p.bl uray.x264-sparks_Chapters.txt"
<>
<4.3.2014. 22:55:02>
END DVD AUTHORING OPERATIONS
Created Folder: D:\DVD\AVS2DVD\DVD_1 (7987,8 MB)
CHECK DVD SIZE
DVD Folder (actual) Size: 7987,8 MB
vs Estimated Size: 8099 MB -> 1,4% undersize
vs Assets Size: 7862 MB -> Warning!
<>
<4.3.2014. 22:55:02>
Log file created by AVStoDVD Release 2.7.3
<>
-
This is interesting from your post:
Video = Video.AddBorders(0,90,0,92)
When I set up a video with the same aspect ratio as your movie, also specifying 16/9 DVD, I get this:
Video = Video.AddBorders(0,50,0,52)
This affects the aspect ratio of the visible picture in the finished DVD. Why we get different results,
I'm not sure at the moment.
Can you post 10 seconds of the source? -
davexnet,
I think AVStoDVD might writing something odd to the log file. When you add the 23.976fps sample video from the previous post, the logfile looks like this regardless of whether the output is PAL or NTSC (well the resizing is different, but the AddBorders bit stays the same):
Video = Video.ConvertToYV12()
Video = Video.AddBorders(0,90,0,92)
Video = Video.Spline16Resize(720,480)
#Using DGPulldown/HCenc to upsize FPS
For NTSC the output seems correct and the frame rate ends up as 29.970, but the borders added to the video are 60 and 62, not 90 and 92 as the log file says.
Arbok,
Could I make a suggestion or two (not aspect ratio related)? HD video and SD video use slightly different colors so when re-encoding HD video as SD, ideally you should convert them, otherwise they can look a little "off". Not doing so is one of my pet hates. I had a play around with AVStoDVD as I've never used it before. It seems like a pretty good program. Well it works as advertised. Here's how to correct the colours when converting HD video:
Right click on a title and select Edit. Switch to the Avisynth tab. Uncheck "Auto Avisynth", click on the Colors box, and check "colormatrix". AVStoDVD will pop up with a window asking about the source and output video. You want zero for the source (Rec.709) and two for the destination (Rec.601). It'll default to those values anyway. Then when you're re-encoding HD video, the colors will be correct. Also, from your log file:
Video = Video.ConvertToYV12()
Video = Video.AddBorders(0,90,0,92)
Video = Video.Spline16Resize(720,576)
#Using DGPulldown/HCenc to upsize FPS
The last line indicates the frame rate is converted to 25fps using pulldown. If it was me, I'd prefer to simply speed the video up to 25fps. Do you need to output PAL? Pretty much all PAL DVD players will play NTSC DVDs. Unless you need PAL for a reason, I'd keep it as NTSC. Otherwise, there's a setting under the Options/Preferences/Avisynth Tab to use PAL speedup instead if you want to.
If you add the color conversion for HD and use PAL speedup, your log file should end up something like this:
Video = Video.ConvertToYV12()
Video = Video.ColorMatrix(source=0,dest=2)
Video = Video.AddBorders(0,90,0,92)
Video = Video.Spline16Resize(720,576)
#Using AssumeFPS() to upsize FPSLast edited by hello_hello; 5th Mar 2014 at 11:36.
-
Thanks hello_hello, arbok
My mistake - the number A2D uses in the addborders statement depends on the absolute source dimensions,
and not just the aspect ratio of the source. So everything should be OK. The log reflects the 16x9 encode.
Here's my test. -
I don't get it... When I run the sample file through A2D, the resulting file is fine, but when I run the whole source file, the result is like we discussed!
I will try to run the whole file again and see what happens... -
-
-
-
-
-
-
Yes, the addborders is the same, but I don't understand how is that possible, due to the fact that NTSC has height value of 480 and PAL has 576???
-
I just noticed something very interesting: I already mentioned that when I run the sample file through A2D, the resulting file is fine, right? When I open the sample file in MeGUI, with Suggest resolution option ticked, I get the values shown on the ss:
But when it comes to the full source file (from which the sample file has been cut out) the values are 1280:544? WTF? -
-
Yeah, it's the discrepancy I was curious about.
The end result would no doubt be the same, but I've always used this formula for resizing as it includes the original aspect ratio in the equation.
(original height / original width) x new width = new height.
(720/1280)x1024=576
To resize to an anamorphic aspect ratio the new pixel aspect ratio needs to be added to the formula. Take you pick as to which pixel aspect ratio to use, but assuming 64/45 for a 16:9 PAL DVD (as I guess that's what AVStoDVD does).
(original height / original width) x (new pixel aspect ratio) x new width = new height.
(720/1280)x(64/45)x720=576
And if the source video is also anamorphic (ie NTSC DVD to PAL resizing):
(original height / original width) x (old pixel aspect ratio reversed) x (new pixel aspect ratio) x new width = new height.
(480/720)x(27/32)x(64/45)x720=576
There's got to be a better way to express that last one. For Arbok, you can find a list of DVD aspect ratios here:
http://forum.doom9.org/showthread.php?p=1058927#post1058927 -
I think what you may have there is an anamorphic source video. Just like DVDs, it's not using square pixels. When you select resize, MeGUI resizes it to square pixels.
See where MeGUI is displaying 160:67 as the input aspect ratio? If you know the resolution is 1280x544 you can use the width or height to work out how to resize it to square pixels. ie:
1280/160x67=536, or stating with the width instead, 544/67x160=1299.
If the original file and the sample show two different aspect ratios when opened in MeGUI, then you've somehow changed (or removed) the aspect ratio when creating the sample.
Open the source video with MPC-HC and use the File Properties menu. If the resolution and the aspect ratio are the same, you'll see something like this. Only the resolution will be displayed:
If the resolution and aspect ratio aren't exactly the same, it'll display both.
That second one is only marginally off using square pixels. Why it was encoded that way I don't know (I didn't do it). I've seen a lot of itunes stuff with a 1280x718 resolution and a 16:9 aspect ratio. Anyway, the above has a resolution of 1280x536 and a display aspect ratio of 1286x536. Open it with MeGUI and it might appear to resize it "oddly", but it's actually doing what it should do.Last edited by hello_hello; 5th Mar 2014 at 20:33.
-
Here's how to get MeGUI to resize your source video "less oddly". I've had a few discussions with Zathor (who maintains MeGUI) about it's default resizing recently..... but until he sees it my way....
By default, MeGUI won't let you increase the width or height when resizing. Instead of increasing one, it'll force you to reduce the other. If you've not done so already, open the script creator, click on the Config button next to the Avisynth profile/scratchpad dropdown box, and when the window opens, switch to the Extra setup tab. See the box labelled "upsizing allowed"? Check it if you haven't already. Now you can close the script creator and open a video in the usual way.
If you couldn't do it before, now MeGUI will let you resize the width back to 1280. Change the mod16 setting to something else if you like, ie mod2, which will allow MeGUI to resize the height as accurately as possible. It'll be 1280xsomething, but not 1280x544. You can adjust the cropping if need be until the aspect ratio error is quite low if you want to (I try to keep it under 0.1% myself). Whatever the new resolution, you've now resized your slightly anamorphic source video to square pixels.Last edited by hello_hello; 5th Mar 2014 at 20:28.
-
Thanks for the formula. Using the first one you mentioned, and arboks file as an example,
(536/1280) * 1024 = 428
576-428 = 148
148/2 = addborder 74.
directshowsource("F:\Documents and Settings\Dave Xnet\My Documents\Downloads\720p.bluray.x264_Trimmed.mkv")
#lanczosresize(720,428) # these two
#addborders(0,74,0,74)
addborders(0,92,0,92) # or these two
lanczosresize(720,576)
the addborder of 74 was derived from your formula, while 92 came out of the calculation I did above.
Both give the same amount of black border when checked in Virtualdub. As was mentioned earlier, A2D's calculation was
very slightly different. It's such a small amount, you'd probably never see it and wouldn't be an issue.
The only time (perhaps once) I've seen A2D pick the wrong size, the file was screwed up and mediainfo returned bad info. -
92+92 is correct. Currently A2D is giving 90+92 due to variable type wrong assignment (DAR is declared as single type instead of double type). Will fix in the next release.
A2D at first corrects the DAR (display aspect ratio) assuming PAR (pixel aspect ratio) = 1. But then, with the following WhateverResize(720,480) or WhateverResize(720,576) and with the mpeg2 encoder DAR flag to 4:3 or 16:9, the final PAR is properly adjusted.
Bye -
MrC, thanks for your reply, it's highly appreciated! Since the sample file (cut of the source file) went through A2D and MeGUI just fine, I got this crazy idea I wanted to test out. I have cut 1 second of the source file (at the end) using SolveigMM, saved the rest of the file and ran it through A2D. And the result is just like it's supposed to be!
I don't know why is that so, but it worked! Now, to be honest, I'm not satisfied with such a "solution" so if anyone has any resolving ideas, please share them with me...
Similar Threads
-
conversion problem
By arjenvdm in forum Newbie / General discussionsReplies: 13Last Post: 3rd Feb 2014, 10:03 -
Conversion Problem
By Myrdivar in forum Video ConversionReplies: 3Last Post: 2nd Jun 2011, 04:44 -
Problem with conversion to DV
By SteveDM in forum ffmpegX general discussionReplies: 3Last Post: 25th Aug 2010, 08:54 -
conversion problem
By thomeski in forum Authoring (DVD)Replies: 2Last Post: 25th Apr 2010, 20:45 -
.ts to mkv conversion problem
By txl in forum Blu-ray RippingReplies: 1Last Post: 15th Sep 2009, 05:19