So I have a video file with following info:
Now I want to convert it either to 16:9 or 16:10Code:Resolution: 720x576 Bitrate: 4200 Fps: 25
My take on this is that 16:10 is better, this is why:
720/576=5/4
16/9-5/4=0.527777
16/10-5/4=0.35
Now 0.35<0.523 thus I assume that skew while changing towards a 16:10 is lower as opposed to 16:9 & thus I opted for a resolution of 640x400 with following x264cli
Also the original video is a bit grainy can you modify my cli to add any required filter?Code:x264 --crf 22 --level 3.1 --vf resize:640,400 --tune film --preset veryslow --deblock -2:-1 --acodec aac --abitrate 70 -o "d:\Trainers\_out.mp4" "d:\Trainers\out\in.wmv"
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 23 of 23
Thread
-
Last edited by ioncube; 27th Oct 2012 at 08:05.
-
720x576 is a common resolution for widescreen (16:9) video on DVD and also used for DV video. Imho, that gives a movie with this resolution a likely correct display aspect ratio of 16:9, with the available information on the source.
-
I agree it's likely to be 16:9.
I'm not sure I understand the logic behind your math. The formula is simply: Storage aspect ratio x Pixel Aspect ratio = Display Aspect Ratio. There's no fixed values for any of them. Well except......
If your video is standard 16/9 PAL DVD/mpeg2 video it'll use a standard PAL DVD/mpeg2 display aspect ratio. There's two of them. The official (ITU) way to resize the video isn't actually 1.77 (16/9). It's around 1.82. The "unofficial" method, which seems to be used pretty much all the time, is 16/9.
Generally when you resize video, especially when resizing to mod16 dimensions, it's unlikely you'll resize without some aspect ratio distortion. In order to minimise or eliminate it, you need to crop some of the video before resizing. In your case, cropping 2 pixels from one side of the video, then resizing to 624x352 will give you virtually no aspect ratio distortion. Assuming your original video is 16/9, you'd need to crop 36 pixels from each side before resizing to 640x400 if you don't want to distort the picture.
Have a play with this: http://www.mediafire.com/?09v9bldu9a6hm00 It calculates aspect ratio distortion for you while you adjust cropping and resizing. The "Use ITU-R Bt.601" checkbox lets you specify ITU or non-ITU resizing. If in doubt, uncheck it.
The bottom line though, is if you play the original video in one instance of a software player, then open the encoded version using another instance, the objects within each video should ideally look exactly the same. I suspect after resizing to 640x400 they won't. For the record, all software players I know of use 16/9 non-ITU resizing when displaying DVD video.
I'm quite partial to FluxSmooth for noise removal. The default FluxSmoothST(7,7) seems to work quite well. Obviously it's an AVISynth plugin. A Google for "avisynth plugin" will find you a whole variety of them. Keep in mind any noise removal tends to be a compromise between removing noise and retaining detail. Personally if it's just a "bit grainy" I'd leave it alone, but grain doesn't bother me as much as it seems to bother some people. Each to their own.....
x264's noise filter. I've never used it myself. http://mewiki.project357.com/wiki/X264_Settings#nrLast edited by hello_hello; 27th Oct 2012 at 06:31.
-
If you want help to improve a very poor result, you might need to put a little effort into defining what very poor means.
PS If it helps to explain why your math is flawed, NTSC and PAL DVD video both have a 16:9 aspect ratio, however the former uses a 720x480 storage aspect ratio, while for PAL it's 720x576. They both display as 16/9 however, as they use different pixel aspect ratios.
If memory serves me correctly, an NTSC 16:9 DVD resized to square pixel dimensions is around 854x480. For PAL it's 1024x576.Last edited by hello_hello; 27th Oct 2012 at 04:42.
-
My source video:
Code:Video ID : 1 Format : VC-1 Format profile : MP Codec ID : WMV3 Codec ID/Info : Windows Media Video 9 Codec ID/Hint : WMV3 Duration : 9mn 29s Bit rate mode : Variable Bit rate : 4 121 Kbps Width : 720 pixels Height : 576 pixels Display aspect ratio : 5:4 Frame rate : 25.000 fps Standard : PAL Bit depth : 8 bits Scan type : Progressive Compression mode : Lossy Bits/(Pixel*Frame) : 0.397 Stream size : 280 MiB (96%) Language : English (GB) Audio ID : 2 Format : WMA Format version : Version 2 Codec ID : 161 Codec ID/Info : Windows Media Audio Duration : 9mn 29s Bit rate mode : Constant Bit rate : 128 Kbps Channel(s) : 2 channels Sampling rate : 44.1 KHz Bit depth : 16 bits Stream size : 8.69 MiB (3%) Language : English (GB)
Code:Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L3.1 Format settings, CABAC : Yes Format settings, ReFrames : 16 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 9mn 29s Bit rate : 1 213 Kbps Maximum bit rate : 2 806 Kbps Width : 640 pixels Height : 400 pixels Display aspect ratio : 5:4 Frame rate mode : Variable Frame rate : 25.000 fps Minimum frame rate : 14.085 fps Maximum frame rate : 90.909 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.190 Stream size : 82.4 MiB (94%) Writing library : x264 core 125 r2200+677M 3a754e7 Encoding settings : cabac=1 / ref=16 / deblock=1:-2:-1 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / fade_compensate=0.00 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / fgo=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=22.0000 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00 Encoded date : UTC 2012-10-27 11:04:04 Tagged date : UTC 2012-10-27 11:04:04 Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : LC Codec ID : 40 Duration : 9mn 29s Bit rate mode : Variable Bit rate : 70.0 Kbps Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 44.1 KHz Compression mode : Lossy Stream size : 4.75 MiB (5%) Encoded date : UTC 2012-10-27 11:04:04 Tagged date : UTC 2012-10-27 11:04:04 Material_Duration : 569121 Material_StreamSize : 4980060
What I want is to resize the video such that I won't get black bars at either side with minimum distortion
It looks satisfactory if one gets black at top & bottom but not left/right....
My set resolution of 640x400 apparently is another way of writing 16:10 but why even at this resolution the DAR is set to the original 5:4?
To be short I want a DAR of 16:10 which suffice minimum skew/distortion what will be x264cli -
Your calculations are meaningless. Since you're video has been reencoded and the original display aspect ratio information non longer exists there is no way to know what the proper DAR should be -- except by looking at the video. Showing a green box doesn't help. You need to find something with a known aspect ratio in the video and adjust accordingly.
-
But this is where I am embezzled the original DAR still is retained in the video output though its output dimensions 640/400 coincides with 16/10!
You can see in the output video detail that aspect ratio is still 5/4 even though its dimensions are changed from 720x576 » 640x400
With all due respect I sincerely don't have the liberty to show video contents here or I could loose my job
I think I try --no-container-sar in x264cli -
It's extremely unlikely your video is 5:4 or 16:10 DAR. There are no devices that use aspect ratio. It's most likely your source is 16:9 or 4:3 DAR, common to most standard definition formats. But since you can't show the video nobody will ever know.
-
That's telling you there's no aspect ratio information in the source file so MediaInfo is assuming square pixels -- ie, it's assuming the display aspect ratio is the same as the frame size aspect ratio, 5:4. But that is almost certainly not the correct DAR since there are no common 5:4 DAR sources.
-
Thnx for the info...
Can you now shed some light how we can specify a DAR with x264 syntax, thing like a force DAR of 16:9 or 16:10. In this instance e.g u want to 16:10 res
Code:720/576 x a/b = 16/10 » a/b = 2/1 --sar 2:1
-
16/9 = 720/576 x 64/45
--sar 64:45 = 1.28
Code:720/576 x a/b = 16/9 » a/b = 64/45 = 1.422
-
What do you mean by "better" ? "Better" would be what the original aspect ratio was . Otherwise things look distorted. Circles look like ovals. People look too fat or too skinny
--sar x:y is the sample aspect ratio in mpeg4 terminology . It used to be called "pixel aspect ratio" but they changed the naming terms
You can think of it as the w:h of the pixels
It's a linear equation, you just solve for the variable -
@poisondeathray
I really don't know the DAR of my input file, though details of it are already given above
The desire is to convert it somehow to 16:10 or 16:9 (with min. distortion) such that it don't display the way it displays now in my 16:10 lcd (screenshot above)
using
Code:720/576 x a/b = 16/10 » a/b = 1024/625 = 1.28 720/576 x a/b = 16/9 » a/b = 64/45 = 1.422
-
There is no way to tell unless you measure a known object shot straight on, like a car tire
A green picture is meaningless, because there are no objects shown . You cannot assume the wmv had the correct AR in the first place, and Wmv definitely isn't the acquistion format or original distribution format - there might have been other errors introduced at multiple stages
If I were to guess - 16:10 probably produces worse distortion, but fills the screen display better. You're stretching it wider than it should be. It's most likely 16:9 content
It's pillarboxed (black bars on the left and right) because you're watching 16:9 content on a 16:10 display. IMO, distorting it is the wrong thing to do, but of course it's up to you . If you're going to do it that way, I think it's better to force the display to 16:10 in the player settings , or remux and force it in the container. When you use --sar x:y it's encoded into the bitstream level, not container level -
They are if your assumption the video is supposed to have a 16/10 aspect ratio are correct, but that's very unlikely.
How does the original video look? Do objects/people in it appear to be stretched vertically?
The reason I ask is because if the video is supposed to be 16:9 but it's displaying as 5:4 then it should be fairly obvious something is wrong. However if the video is really supposed to be 4:3 and the 16/9 or 16/10 aspect ratio was just your incorrect assumption..... well it may not be so obvious it's not displaying correctly if it's actually supposed to be 4:3. I'm starting to think maybe that's the case.... it's supposed to be 4:3.
Given the 720x576 resolution I think it's fairly safe to assume it should be either 4:3 or 16:9 to display correctly. I've seen lots of 720x576 (or NTSC 720x480) encodes which don't contain the correct aspect ratio information, so your video wouldn't be the first. If it is supposed to display as 4:3 try resizing it to 640x480, but you really need to use your eyes rather than make aspect ratio assumptions. If possible, try to find a straight-on shot of an object in the video which you know should be round. A car wheel or a clock face, that sort of thing. Which aspect ratio makes it look round?
Assuming the video is supposed to display as 4:3 and you want it to fill a 16:9 screen without distorting it, then according to the calculator you'll need to crop 72 pixels from both the top and bottom of the video to make it 16:9. Then depending on how close the resize dimensions you choose are to 16:9, you may need to crop a little more. It's a fair bit of picture to remove. I'm not sure why black bars top and bottom are satisfactory for you but down the sides they're not. The former is how wide screen video is displayed on a 16:9 screen while the latter is how 4:3 video is displayed on a 16:9 screen.
Of course it is possible the 720x576 resolution is just co-incidence and it's not actually supposed to be an encode of a PAL video and it's supposed to display as 5:4 but it's really fairly unlikely. Try 4:3 if 16:9 doesn't look right. -
The proper SAR for a 720x576 video with a 16:9 DAR is 64:45 if you go by MPEG/DVD rules. If you go by ITU rules (the 16:9 picture is in the inner 702x576 pixels, the rest is padding) the SAR is 16:11.
16/9 = 720/576 * 64/45
1.777 = 1.25 * 1.422
1.777 = 1.777
16/9 = 702/576 * 16/11
1.777 = 1.219 * 1.455
1.777 = 1.777 -
I think you can pretty much assume the WMV doesn't have the correct aspect ratio. We can also assume this is the price you pay for downloading garbage from the internet made by clueless idiots. WMV is not the source format. Apparently ioncube has no understanding of DARs so this might help:
http://www.doom9.org/aspectratios.htm
I'd play it in a player that can change the aspect ratio so you can check which looks more 'normal'. MPC-HC is one such player. Open the video, right-click on the video and Video Frame->Override Aspect Ratio, and change back-and-forth between 16:9 and 4:3. It should be easy to tell the correct one. -
Thanks guys,
remux and force it in the container. When you use --sar x:y it's encoded into the bitstream level, not container level
@manono
Yes I am beginner is this aspect & your link upon DARs stuff is a good read. Everyone who made me try to understand thanks to him. I will do reading & acquaint before I start asking questions. Thanks again -
Similar Threads
-
Change VOB Resolution
By Simmons in forum Video ConversionReplies: 4Last Post: 30th Aug 2011, 07:37 -
Change video resolution
By Browneyd in forum EditingReplies: 5Last Post: 11th Jan 2011, 10:34 -
Change resolution from 235:1 to 16:9
By ThaiJan in forum Newbie / General discussionsReplies: 4Last Post: 9th Apr 2010, 14:16 -
How to change RMVB video resolution?
By williegreg in forum Video ConversionReplies: 2Last Post: 30th Dec 2009, 14:27 -
How do I change video Resolution
By mmkk in forum Video ConversionReplies: 7Last Post: 31st Aug 2009, 17:33