VideoHelp Forum

+ Reply to Thread
Results 1 to 3 of 3
Thread
  1. Hello,

    I wish to remove the "original display aspect ratio" metadata from a web-dl MP4 file.

    General
    Complete name : 1.mp4
    Format : MPEG-4
    Format profile : Base Media
    Codec ID : isom (isom/iso2/avc1/mp41)
    File size : 1.61 GiB
    Duration : 44 min 45 s
    Overall bit rate : 5 140 kb/s
    Writing application : Lavf56.15.102

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4
    Format settings : CABAC / 4 Ref Frames
    Format settings, CABAC : Yes
    Format settings, ReFrames : 4 frames
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 44 min 45 s
    Bit rate : 5 000 kb/s
    Width : 1 920 pixels
    Height : 1 072 pixels
    Display aspect ratio : 16:9
    Original display aspect ratio : 16:9
    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.097
    Stream size : 1.56 GiB (97%)

    Audio
    ID : 2
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format profile : LC
    Codec ID : mp4a-40-2
    Duration : 44 min 45 s
    Bit rate mode : Constant
    Bit rate : 128 kb/s
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 44.1 kHz
    Frame rate : 43.066 FPS (1024 SPF)
    Compression mode : Lossy
    Stream size : 41.0 MiB (2%)
    Default : Yes
    Alternate group : 1
    Metadata:
    major_brand : isom
    minor_version : 512
    compatible_brands: isomiso2avc1mp41
    encoder : Lavf56.15.102
    Duration: 00:44:45.12, start: 0.000000, bitrate: 5139 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1072 [SAR 134:135 DAR 16:9], 5000 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
    handler_name : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
    handler_name : SoundHandler
    I tried the following commands,

    Code:
    ffmpeg -i input.mp4 -map_metadata -1 -c copy output.mp4
    Code:
    ffmpeg -i input.mp4 -metadata:s:v:0 original_display_aspect_ratio=0 -c copy output.mp4
    Code:
    ffmpeg -i input.mp4 -metadata:s:v:0 original_display_aspect_ratio="" -c copy output.mp4
    Code:
    ffmpeg -i input.mp4 -bsf:v "filter_units=remove_types=6" -c copy output.mp4
    but none of them worked.

    I don't think ffmpeg bitstrem filters supports original display aspect ratio, so
    "h264_metadata=original_display_aspect_ratio" doesn't work either.

    Is it possible to remove the "original display aspect ratio" entry? If so, could anyone please advise me on how to achieve it?

    Thank you.
    Last edited by aveceux; 26th Feb 2019 at 02:11.
    Quote Quote  
  2. Try:
    Code:
    ffmpeg -i "input.mp4" -map 0 -c copy -bsf:v "h264_metadata=sample_aspect_ratio=1" -aspect 1920:1072 "output.mp4"
    That said, without the file it's difficult to say why exactly ffmpeg is showing this. It doesn't necessarily mean it is an explicit metadata value stored. For example MediaInfo also shows a "File size" line but that doesn't mean it's some kind of explicitly stored metadata. My code doesn't actually remove any metadata, it just sets everything to the most simple sar of 1:1.
    Last edited by sneaker; 26th Feb 2019 at 04:50.
    Quote Quote  
  3. Originally Posted by sneaker View Post
    Try:
    Code:
    ffmpeg -i "input.mp4" -map 0 -c copy -bsf:v "h264_metadata=sample_aspect_ratio=1" -aspect 1920:1072 "output.mp4"
    That said, without the file it's difficult to say why exactly ffmpeg is showing this. It doesn't necessarily mean it is an explicit metadata value stored. For example MediaInfo also shows a "File size" line but that doesn't mean it's some kind of explicitly stored metadata. My code doesn't actually remove any metadata, it just sets everything to the most simple sar of 1:1.

    Thank you very much for your help, sneaker. Your code worked like a charm!
    I've tried the aspect command before, but this only kept my player (MPC) from changing its height and width while playing this particular video. The original dar remained intact. Setting the sar to 1 did the job perfectly.
    Thanks again!
    Last edited by aveceux; 26th Feb 2019 at 10:02.
    Quote Quote  



Similar Threads