VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. I created a batch file that I use to encode video files (mkv, mp4, etc.). A portion of the batch file relies on json data generated by mediainfo to determine tracks and their IDs. This data is then passed on to the mkvmerge to mux at the end.

    The problem I'm having is that mediainfo's track ID don't correspond with mkvmerge's track IDs on certain files. Here's an example of a file with a video, audio, and subtitle track.

    Section of MediaInfo JSON:
    Code:
    "type": "Video",
    "StreamOrder": "2",
    "ID": "4",
    
    "type": "Audio",
    "StreamOrder": "0",
    "ID": "2",
    
    "type": "Text",
    "ID": "3",
    mkvmege command line info:
    Code:
    Track ID 0: audio (AC-3)
    Track ID 1: subtitles (SubRip/SRT)
    Track ID 2: video (MPEG-4p10/AVC/H.264)
    And here's a sample of ffprobe's JSON:
    Code:
    "index": 0,
    "codec_name": "ac3",
    
    "index": 1,
    "codec_name": "subrip",
    
    "index": 2,
    "codec_name": "h264",
    So I can use StreamOrder for both audio and video which matches up with mkvmerge. But the subtitle track has no StreamOrder so I have no way to pass it to mkvmerge.

    Unfortunately I can't use ffprobe because it has problems identifying accrate framerates on variable framerate files. I also can't use file info generated by mkvmerge because it doesn't work if input is an MP4 file.

    Any ideas or suggestions?
    Last edited by syrist; 3rd Jun 2020 at 06:25.
    Quote Quote  
  2. With only one subtitle track you can give it the missing number of 0,1,2 (e.g. video=streamOrder2, audio=StreamOrder0, so subtitle=StreamOrder1)
    Quote Quote  
  3. Originally Posted by ProWo View Post
    With only one subtitle track you can give it the missing number of 0,1,2 (e.g. video=streamOrder2, audio=StreamOrder0, so subtitle=StreamOrder1)
    True... but lots of times there's going to be multiple subtitle tracks and I'll need to know all their IDs and decide which ones to pass to the muxer.
    Quote Quote  
  4. Originally Posted by syrist View Post
    Unfortunately I can't use ffprobe because it has problems identifying accrate framerates on variable framerate files
    Have you tryed ffprobe avg_frame_rate (for framerate)?
    Quote Quote  
  5. Originally Posted by ProWo View Post
    Originally Posted by syrist View Post
    Unfortunately I can't use ffprobe because it has problems identifying accrate framerates on variable framerate files
    Have you tryed ffprobe avg_frame_rate (for framerate)?
    Yes, even avg_frame_rate wouldn't give me the correct results on certain variable framerate files. I've had discussions about it on this focum a few weeks ago so, unfortunately, I can't use ffprobe.
    Last edited by syrist; 4th Jun 2020 at 11:57.
    Quote Quote  



Similar Threads

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