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:
mkvmege command line info:Code:"type": "Video", "StreamOrder": "2", "ID": "4", "type": "Audio", "StreamOrder": "0", "ID": "2", "type": "Text", "ID": "3",
And here's a sample of ffprobe's JSON:Code:Track ID 0: audio (AC-3) Track ID 1: subtitles (SubRip/SRT) Track ID 2: video (MPEG-4p10/AVC/H.264)
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.Code:"index": 0, "codec_name": "ac3", "index": 1, "codec_name": "subrip", "index": 2, "codec_name": "h264",
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?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 5 of 5
Thread
-
Last edited by syrist; 3rd Jun 2020 at 06:25.
-
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)
-
-
-
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.
Similar Threads
-
Get-MediaInfo - a complete PowerShell MediaInfo solution
By stax76 in forum ProgrammingReplies: 6Last Post: 31st Mar 2021, 05:41 -
Why are ffprobe and mediainfo reporting different framerates for same file?
By syrist in forum Video ConversionReplies: 10Last Post: 20th May 2020, 08:17 -
Help Needed With Python ffprobe Script
By chris319 in forum ProgrammingReplies: 11Last Post: 28th Jun 2019, 10:15 -
ffprobe: ho to the UmID from a video file?
By marcorocchini in forum Newbie / General discussionsReplies: 8Last Post: 24th May 2018, 06:21 -
FFPROBE interlaced_frame slow? why
By marcorocchini in forum Newbie / General discussionsReplies: 0Last Post: 3rd Oct 2017, 13:22