VideoHelp Forum




+ Reply to Thread
Results 1 to 17 of 17
  1. 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.
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    In what video file container? mp4,mkv? You might have to adjust the display aspect ratio in the container.
    Quote Quote  
  3. The original is an mp4 and the re-encode is an m4v.
    Quote Quote  
  4. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    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
    Quote Quote  
  5. Tried remuxing with mp4muxer and manually put in the resolution at 1920x800 and there was no change. This continues to drive me nuts.
    Quote Quote  
  6. 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.
    Quote Quote  
  7. Originally Posted by jagabo View Post
    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.
    But it displays the reencoded 1920x800 video fine even though I haven't uncropped the video.
    Quote Quote  
  8. Originally Posted by JBacon View Post
    Originally Posted by jagabo View Post
    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.
    But it displays the reencoded 1920x800 video fine even though I haven't uncropped the video.
    Sorry, I misread the first post.
    Quote Quote  
  9. Is there a program to change the aspect ratio flag in the h.264 stream after a demux?
    Quote Quote  
  10. Member
    Join Date
    Jan 2007
    Location
    United States
    Search Comp PM
    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
    Quote Quote  
  11. Try h.264 Aspect Ratio Modifier (sorry, no link, search for h264arm.exe). Or maybe this:
    http://forum.doom9.org/showthread.php?t=152419
    Last edited by jagabo; 10th Mar 2013 at 20:54.
    Quote Quote  
  12. Originally Posted by theewizard View Post
    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
    Yes, the TV has a built in player and dlna support.
    Quote Quote  
  13. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Originally Posted by jagabo View Post
    Try h.264 Aspect Ratio Modifier (sorry, no link, search for h264arm.exe). Or maybe this:
    http://forum.doom9.org/showthread.php?t=152419
    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.
    Quote Quote  
  14. Member
    Join Date
    Feb 2013
    Location
    Norway
    Search Comp PM
    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.
    Quote Quote  
  15. Member
    Join Date
    Nov 2002
    Location
    United States
    Search Comp PM
    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.
    Quote Quote  
  16. 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.
    Quote Quote  
  17. Originally Posted by Baldrick View Post
    Originally Posted by jagabo View Post
    Try h.264 Aspect Ratio Modifier (sorry, no link, search for h264arm.exe). Or maybe this:
    http://forum.doom9.org/showthread.php?t=152419
    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.
    I have that same version, 0.1.1.0 I think those are false positives but I don't think you should host it here. Just to be safe.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!