And, what are all the video extensions supported by mkvmerge?
I scan several folders searching videos and when I find one I have two options:
-Read only the extension and ignore it if it's not supported by mkvmerge.
-Request mkvmerge to read the file and inform me if it is supported or not.
Although these are two options I want to know both techniques.
For example in the first case the result would be like this:
extSupport = ["mkv", "mp4", "mov"]
But I don't know what ALL the extensions are and I'd like to know.Code:if (extFile in extSupport){ ...instructions }
In the second case I just want to give a video to mkvmerge and have it return 'true' if it supports it or 'false' if it doesn't.
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 19 of 19
Thread
-
-
I may be missing something here, but since mkv, mp4, mov, avi are containers and can contain multiple different types of videos, just checking if the extension is supported or not is pointless.
Edit: I did a test with an mp4 and changed the extension to mkv, mov, avi and wmv. MKVToolNix opened them with no problem as, as I suspected it probably ignores the extension.Last edited by lingyi; 18th May 2020 at 22:09. Reason: Additional info
-
-
I know it doesn't really like .AVI containing h264 and doesn't like .WMV.
-
I still fail to understand what checking file compatibility by extension will do, but you may have success asking in this Reddit
Seems to me that what you really need is to determine what video/audio parameters MKVMerge supports, regardless of the extension. There's a couple of recent threads about using Mediainfo in batch mode to provide a list of video/audio parameters. -
-
-
With the command:
mkvmerge.exe -l
I got a list and I was able to conclude that these are all the supported extensions... I think.
listExt =
"av1,avi,caf,drc,evo,evob,flv,ivf,m1v,m2v,m2ts,m4v ,mkv,mk3d,mov,mp2,mp4,mpe,mpeg,mpg,mpls,mpv,mts,ob u,ogg,ogm,ogv,rm,rmvb,rv,ts,vc1,vob,webm,webmv"
There are some that don't even look like extensions but that's the conclusion I came to. -
Most are containers, some are codecs. https://en.wikipedia.org/wiki/Comparison_of_video_container_formats
-
-
I recognize most of the names and with the exceptions of .opu and .rv (which I suspect is Real Video), a quick search for <name> extension brought up a description.
RealMedia (rm,rmvb) video files are really hit and miss as later versions had some major changes that made it incompatible with some earlier software and hardware players as Real wanted to force users to use only their licensed software and hardware. Here's what may be in Real video containers: https://en.wikipedia.org/wiki/RealMedia. There's also .ra (Real Audio) and .ram (Real Audio, streaming only) which again in later versions may be incompatible with early players. https://en.wikipedia.org/wiki/RealAudio
Apple did the same thing with QuickTime, particularly with QuickTime Pro which at least for a while could only be played back with the updated (pay) QuickTime Pro software.
.mpe is .mpeg. I remember getting files created on Macs with the four letter extension and they would be truncated by Windows. Back then (Win 3.1 - Win 98), Windows software still relied heavily on file extensions to recognize files and I would have to rename them to .mpg to play properly. -
The way this should be treated and built is on catching errors, something as sneaker offered. Using any programming language. If windows batch script, just setup your command line and then:
if %errorlevel%==0 ( ok code here)
you can filter your files by extensions before as you do, it might be a good idea but you should catch errors as well -
Yes I intend to detect errors, extensions are a separate issue so I don't have to iterate too much, imagine if in 10.000 files I am checking each one for errors when most of them are probably not videos. It's a waste of resources.
The command:
mkvmerge -i videopath
It doesn't return 0 or 1 or true or false, it returns a message and based on that message I can know if the video is supported or not, do you know any alternative to just getting true or false?
@lingyi
In the end I decided to gather all the video extensions that MPC and PotPlayer shows me and use them in my script:
listExt =
"3g2,3ga,3gp,3gp2,3gpp,amr,amv,asf,avi,bdmv,bik,di vx,dpg,dsa,dsm,dss,dsv,dvr-ms,evo,f4v,flc,fli,flic,flv,hdmov,hevc,ifo,ivf,k3g ,m1v,m2p,m2t,m2ts,m2v,m4b,m4p,m4v,mjpeg,mk3d,mkv,m ov,mp2v,mp4,mp4v,mpe,mpeg,mpg,mpls,mpv2,mpv4,mts,m xf,nsr,nsv,ogm,ogv,pva,qt,ram,rec,rm,rmm,rmvb,rp,r pm,rt,skm,smi,smil,smk,ssif,swf,tp,tpr,trp,ts,vob, webm,wm,wmp,wmv,wtv"
If the extension of a file matches the list then I use mkvmerge and check whether the video is supported or not. Obviously .wmv and some others (which ones?) shouldn't be on the list but I've put it in case anyone is interested in having the all video extensions listed, well I don't know if they are "all" but they are most.Last edited by curiosport; 23rd May 2020 at 04:06.
-
Okay, you've explained what and why you're trying to do what you asked in the OP, but my curiosity is still peaked with, "What is your end goal?" Since you're using MKVMerge, it seems apparent that you're planning to put the supported files into an .mkv container. But just doing that doesn't necessarily meant that it will work in a media player that doesn't support the file, and the file will suddenly work just because it's in an .mkv container.
I highly suspect that at some point you're going to have to confirm which codecs/file parameters in an .mkv container work correctly, making the task of determining which extensions are supported a moot point.
As for searching extensions, I would just use Everything which can index files by any search term across multiple drives and folders. To limit it to a single drive, use <drive letter>: and the term you're looking for. I've used it to find thousands of files, example mkv across 16+ HDDs at once.Last edited by lingyi; 23rd May 2020 at 03:49.
-
-
Interesting. Let us know if you have success with that.
A more practical approach for others may be the following:
*Thanks to jagabo for the original command line.
You need the CLI version of Mediainfo: https://mediaarea.net/en/MediaInfo/Download/Windows
Add the following in a batch file:
For /R %%F IN (*.*) do ("<Replace with the location of>:\MediaInfo.exe" "%%F" >"%%~dpnF.txt") Remove the /R if you don't need to search subdirectories
This will create a .txt file with the original file name for each file
Use Note++ https://notepad-plus-plus.org/downloads/ and use "codec" in Find In Files to list the video/audio properties listed by MediaInfo. This allows you to use/ignore formats you choose, while ignoring extensions.
Example:
a:\cross\vol.1.txt (7 hits)
Line 15: Codec ID : WMV3
Line 16: Codec ID/Info : Windows Media Video 9
Line 17: Codec ID/Hint : WMV3
Line 18: Description of the codec : Windows Media Video 9 - Professional
Line 40: Codec ID : 161
Line 41: Codec ID/Info : Windows Media Audio
Line 42: Description of the codec : Windows Media Audio 9.2 - 192 kbps, 48 kHz, stereo 1-pass CBR
a:\cross\VOL.10.txt(4 hits)
Line 21: Codec ID : XVID
Line 22: Codec ID/Hint : XviD
Line 46: Codec ID : 55
Line 47: Codec ID/Hint : MP3
Edit: Text files for for files without video/audio will be created, but ignored by Note++ because there's no codec text.Last edited by lingyi; 23rd May 2020 at 08:39.
-
I see, you may try to redirect that output text and check for errors in it, it might work, something like there: https://stackoverflow.com/questions/1164049/batch-files-error-handling
Code:c:\mypath\myexe.exe | find "ERROR" >nul2>nul if ERRORLEVEL 1 ( code solving error here )
Last edited by _Al_; 23rd May 2020 at 10:25.
-
Also to run mediainfo and check formats and all other properties you can use that "run_mediainfo" subroutine:
https://forum.videohelp.com/threads/377677-Video-batch-files#post2468981
or something from post below that if just checking one value
Similar Threads
-
MKVMerge not rendering entire file name...
By Lathe in forum Newbie / General discussionsReplies: 12Last Post: 6th Apr 2020, 17:03 -
MKVmerge Batch File - Remove Language
By cine24h in forum Newbie / General discussionsReplies: 11Last Post: 24th Jul 2019, 13:18 -
MKVMerge batch muxing only attachments from other file
By kuodo20 in forum Newbie / General discussionsReplies: 2Last Post: 8th Jan 2018, 01:17 -
MKVMerge: how to get chapter titles from file names
By wallywalters in forum Video ConversionReplies: 2Last Post: 5th Jul 2016, 09:38 -
Different file size and bitrate after muxing in MKVmerge
By gtx780 in forum EditingReplies: 1Last Post: 8th Jul 2015, 09:20