I'm using a media server to stream files to my Panasonic Viera TV and I've found certain videos with wider aspect ratios that are cropped from a 16:9 source will play on the TV, but the TV will stretch the image to fill the screen.
For example, I ripped this video from Youtube, and it is stretched on my TV. (resolution is 1920x800)
http://www.youtube.com/watch?v=P99qJGrPNLs
However, I re-encoded the video using Handbrake, and the video plays fine and at the correct aspect ratio on my TV. I can't figure out what is different between the two videos after the encode.
Here's the info from the original file:
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 1 frame
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 2mn 20s
Bit rate : 2 890 Kbps
Maximum bit rate : 7 197 Kbps
Width : 1 920 pixels
Height : 800 pixels
Display aspect ratio : 2.40:1
Frame rate mode : Constant
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.075
Stream size : 48.3 MiB (94%)
Tagged date : UTC 2013-01-06 21:59:52
And this is my re-encode which plays fine:
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 2mn 20s
Bit rate mode : Variable
Bit rate : 3 491 Kbps
Width : 1 920 pixels
Height : 800 pixels
Display aspect ratio : 2.40:1
Frame rate mode : Constant
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.091
Stream size : 58.3 MiB (90%)
Writing library : x264 core 120
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=20.0 / qcomp=0.60 / qpmin=3 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Encoded date : UTC 2013-03-10 21:22:27
Tagged date : UTC 2013-03-10 21:24:52
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
At first I thought it might be that my TV can't display the correct aspect ratio for the higher h.264 profiles, but they seem to be the same for the two files. Any thoughts? I'm just wondering if there's a way to fix this without re-encoding all my cropped files.
Thanks.
+ Reply to Thread
Results 1 to 17 of 17
-
-
In what video file container? mp4,mkv? You might have to adjust the display aspect ratio in the container.
-
It's same.
Doesn't mediainfo show any more aspect ratio info for the files?
You could just try remux your file mymp4boxgui or mp4muxer and see if works better. Or yamb to set a new display aspect ratio, like 1:1 for 1920x800, see https://forum.videohelp.com/threads/354080-Using-YAMB-to-change-aspect-ratio?p=2225013&...=1#post2225013 -
It looks like your TV resizes the 1920x800 frame to 1920x1080. That's not uncommon. You'll have to add borders to restore the original 1920x1080 frame size and reencode.
-
-
Is there a program to change the aspect ratio flag in the h.264 stream after a demux?
-
you said tv plays !!
your TV has a MEDIA player built in ?
or are you using a HW media player
or software on your PC ?
play both files in VLC and look at the file specs using VLC
like was said the stream itself may have different settings than what the header data indicates -
Try h.264 Aspect Ratio Modifier (sorry, no link, search for h264arm.exe). Or maybe this:
http://forum.doom9.org/showthread.php?t=152419Last edited by jagabo; 10th Mar 2013 at 20:54.
-
-
Have you seen any newer version of h264arm 1.1? I can't host it when it has so many virustotal warnings https://www.virustotal.com/en/file/d94cc457c59ccf2978f952c1896311d7582cba67b6e1d22bebd...ecf3/analysis/
We need another h264 aspect ratio gui for those who don't like command line tools. -
Seems like you have found your solution already. Encode it in HandBrake, and it plays fine.
Maybe HandBrake is adding black bars to the 2.40:1 movie so it turns out to be a 16:9.
You can probably also adjust the picture with your tv-control so that it do not stretch so much. -
It's a lot easier to use MKVMerge and under format specific options, tick aspect ratio and type in 2.40 and save MKV. Then use ffmpeg copy command to mux in MP4 container (or copy the video and convert the audio since it's probably container specific).
I went to the site linked by jagabo and downloaded the ffmpg build and the patch. I couldn't find any info on changing the sar and dar so the best that I could come up with was...
ffmpeg -i input.mp4 -vcodec copy -an -acodec copy -vbsf h264_changesps=fps=25000:1000/sar=1:1/dar=12:5 output.mp4
or
for %%a in ("*.mp4") do ffmpeg -i %%a -vcodec copy -sn -acodec copy -vbsf h264_changesps=fps=25000:1000/sar=1:1/dar=12:5 %%~na.new.mp4
I don't know if it's correct but the output file was the same size as the mkv. Maybe someone with better knowledge of ffmpeg and sar and dar could come up with something better. Since I don't own the OP's TV, I don't know if it works or not.
It took me a couple seconds to do the MKVMerge option and all night trying to patch the copy of ffmpeg that I downloaded with the patch and trying to figure out the correct command to use. running the command takes less than a second though once I got everything working.
I ran into the same problem trying to find the Aspect Ratio Modifier. I couldn't find the program at all and every link that I saw was a virus query. -
To answer the OP's question about what's different between the h.264 streams in the Youtube download vs. his Handbrake reencoded streams, I think it's this: The Youtube videos don't contain h.264 SAR information, just the frame dimensions. The Handbrake encoded files specify a SAR of 1:1. Apparently, in the absence of h.264 SAR flags his TV stretches the 1920x800 frame to fit the 16:9 screen, ignoring AR flags in the M4V/MP4 header.
By the way, h.264 Aspect Ratio Changer can't change the aspect ratio in the Youtube videos because there is no h.264 SAR flag in them. It can't add flags to a video that doesn't have them, only change the values in videos that do.Last edited by jagabo; 11th Mar 2013 at 11:22.
-
Similar Threads
-
MKV file displaying wrong aspect ratio on Bluray player.
By djfonti in forum Video ConversionReplies: 11Last Post: 5th Sep 2011, 20:05 -
Some VOB's not displaying the correct aspect ratio
By Browncoat in forum Media Center PC / MediaCentersReplies: 26Last Post: 20th Mar 2009, 02:57 -
AVI files displaying with wrong aspect ratio
By The111 in forum Newbie / General discussionsReplies: 10Last Post: 19th Mar 2009, 16:33 -
Correct aspect ratio
By dfisher052 in forum DVB / IPTVReplies: 8Last Post: 25th Oct 2008, 23:34 -
How to correct the aspect ratio (I see it in 4:3 but it should be 16:9)?
By Anonymous74 in forum Newbie / General discussionsReplies: 4Last Post: 16th Sep 2008, 07:10