VideoHelp Forum
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. Hello, I have 7 seasons of a rare old TV show that can't be found anywhere else. I want to avoid a generation loss by converting the file. The uploader probably thought that it would be a good idea to do 700 episodes in 16x9 even though it was originally shot in 4x3. I wrote this script with the help of chat GPT and no matter what I do batch is complaining about a track#4, which I don't understand where that comes from. My script and the video files don't even have any mention of track #4.

    Error

    A track with the ID 4 was requested but not found in the file. The corresponding option will be ignored.
    Here's my script

    Code:
    @echo off
    if [%1]==[] goto:eof
    
    set "sourceFolder=%~dp1"
    set "outputFolder=%sourceFolder%\remuxed"
    
    if not exist "%outputFolder%" (
      mkdir "%outputFolder%"
    )
    
    :loop
    
    "C:\Program Files\MKVToolNix\mkvmerge.exe" -o "%outputFolder%\%~nx1" --aspect-ratio 4:3 --track-order 0:0,0:0 "%~1"
    
    shift
    
    if not [%1]==[] goto:loop
    
    :eof
    pause
    exit
    I tried many things like --video-tracks all but it doesn't work. I'm at loss and would like to preserve those file.

    Thanks to anyone who can help with this!
    Quote Quote  
  2. I'm dumb, it's always when you post it that you see you had it in big caps in your face that whole time.

    0:4/3

    Fixed it all!
    Quote Quote  
  3. fyi, this changes the container aspect ratio but the video stream aspect ratio might be wrong (which one is used depends on the player). Check it with ffmpeg -i or Mediainfo.
    Quote Quote  
  4. Originally Posted by Luke M View Post
    fyi, this changes the container aspect ratio but the video stream aspect ratio might be wrong (which one is used depends on the player). Check it with ffmpeg -i or Mediainfo.
    Here's the remuxed MediaInfo of the file.

    Code:
    General
    Format                                   : Matroska
    Format version                           : Version 4
    File size                                : 244 MiB
    Duration                                 : 24 min 38 s
    Overall bit rate                         : 1 387 kb/s
    Encoded date                             : UTC 2023-05-27 01:19:18
    Writing application                      : mkvmerge v71.1.0 ('Fortitude') 64-bit
    Writing library                          : libebml v1.4.4 + libmatroska v1.7.1
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4.1
    Format settings                          : CABAC / 16 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, Reference frames        : 16 frames
    Codec ID                                 : V_MPEG4/ISO/AVC
    Duration                                 : 24 min 38 s
    Bit rate                                 : 1 001 kb/s
    Width                                    : 624 pixels
    Height                                   : 352 pixels
    Display aspect ratio                     : 4:3
    Original display aspect ratio            : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 29.970 (30000/1001) FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.152
    Stream size                              : 176 MiB (72%)
    Writing library                          : x264 core 148 r2638 7599210
    Encoding settings                        : cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=300 / keyint_min=29 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=62500 / vbv_bufsize=78125 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
    Default                                  : Yes
    Forced                                   : No
    It is showing the following

    Display aspect ratio : 4:3
    Original display aspect ratio : 16:9
    The flag is being picked up correctly in VLC but Plex is ignoring it. Do you know any better way that would be compatible with Plex without engendering a generation loss and convert?
    Quote Quote  
  5. ffmpeg can set the h.264 sar flags with a remux. See sample_aspect_ratio:

    https://ffmpeg.org/ffmpeg-bitstream-filters.html#h264_005fmetadata

    Code:
    ffmpeg -i input.mp4 -c copy -bsf:v "h264_metadata=sample_aspect_ratio=3/4" output.mp4
    Quote Quote  
  6. Originally Posted by jagabo View Post
    ffmpeg can set the h.264 sar flags with a remux. See sample_aspect_ratio:

    https://ffmpeg.org/ffmpeg-bitstream-filters.html#h264_005fmetadata

    Code:
    ffmpeg -i input.mp4 -c copy -bsf:v "h264_metadata=sample_aspect_ratio=3/4" output.mp4
    To be honest I think I deleted the original files since there was 700 episodes and it was eating up hard drive space.

    Would setting this flag work with the "Display aspect ratio : 4:3" flag?

    Thanks for helping!
    Quote Quote  
  7. Originally Posted by G22 View Post
    Originally Posted by jagabo View Post
    ffmpeg can set the h.264 sar flags with a remux. See sample_aspect_ratio:

    https://ffmpeg.org/ffmpeg-bitstream-filters.html#h264_005fmetadata

    Code:
    ffmpeg -i input.mp4 -c copy -bsf:v "h264_metadata=sample_aspect_ratio=3/4" output.mp4
    To be honest I think I deleted the original files since there was 700 episodes and it was eating up hard drive space.

    Would setting this flag work with the "Display aspect ratio : 4:3" flag?

    Thanks for helping!
    You would probably want to do both. Some players will obey the codec's flag, some the container's flag, and some will ignore both of them.

    Note that the sar flag I used in the example assumes the source is square pixel (SAR 1:1) with a 16:9 frame size. So the pixels need to squeezed horizontally to force a 4:3 display size.
    Quote Quote  



Similar Threads

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