Hi. I am looking for guidance or suggestions on how to go about this.
I have a tool that reads in the x264 and x265 parameters from the encoded files. However, as I just realized, it is only successful at reading raw files, thus, video.hm10 or video.h264, video.h265, etc., but it will not read the info correctly when inside an mkv container.
What is the method used to do this correctly? or is it a parser or something that I need to update in my "raw" routine. Thanks for any ideas.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 9 of 9
Thread
-
Last edited by vhelp; 24th Dec 2016 at 10:22.
-
Out of curiosity: What do you use to read the h.265 parameters?
About the problem, seems like there are only two ways:
a. extract (a part of) the file and extract the infos from that part
or
b. add the functionality to recognize mkv and extract the video stream from mkv files to your tool
If your tool accepts a stream as input you could even extract the stream with mkvextract and pipe the output to your tool.users currently on my ignore list: deadrats, Stears555 -
Out of curiosity: What do you use to read the h.265 parameters?
So, is the video file in some compressed form in an mkv file ? I thought it might be "pushed" down in the container and that all I have to do is search for the special code sequence and read the info from that point on. I have not looked at the mkv container yet. I am assuming that some important info about the actual video is being compressed somehow. But I guess the only way to know for sure is to trial and error the routine that reads the info and re-aline starting point, assuming that the videos are always in the same place, otherwise, I probably will not be able to read the info from the mkv file. -
I just may be in luck. After examining a few mkv files through a hex program (I used virtualdub's), only the start position has moved, I think. I will have to reset my routine to first test/determine the file type for Raw or MKV container (via file extension: should be enough) and update the code to make the starting position adjustments). Hopefully, the position will not vary too deeply.
EDIT: reading encoder parameters will only be applicable to x264 and x265 encoders. QSV and other hardware encoders do not write their parameters in the archive file, so it will not work for those files, only x264/x265.Last edited by vhelp; 18th Dec 2016 at 11:59.
-
Update, and success!! I got it working. As long as the encoded videos are made through x264 or x265 the utility will extract the SEI encoding parameters from the Raw and MKV video file.
-
It would be easier and less error prone to just use MediaInfo CLI:
MediaInfo.exe --Inform="Video;%Encoded_Library% %Encoded_Library_Settings%" "input.mkv" -
Is there a preferred method to determining what file you have in order to proceed with it ?
There are various containers, such as mkv, mpeg, ts, mp4, mov. And each have their own specific way of prepping their video into the container. What I am thinking of, is that I need to organize my routine and do some preliminary steps first and then proceed to obtain the info I am after. So I'm thinking that there must be some standard way (that everyone follows?) to obtain such certain pieces of information from any raw or container source. And if possible, I would like to follow that same standard approach and build it into my app.
You see, I had initially got it working for mkv files but then ran into some encoded videos that my (decoder to reach sei params) routine did not work, though in post # 5, above, it appeared to work until I ran into some files where it did not work. So, something is changing in the way the video are being processed for some files.
I would like to assume that people are encoding with either x264.exe or x265.exe cli's. But its possible that at some point they may require to transcode or mux them, using other tools like ffmpeg or mb4box, for instance. And as a result, these apps may change the position for where I can locate the info I'm after. So I need to be able to adapt to the same containers no matter what tool fudges with the sei parameters.
Does anyone here have any advise as to how to go about it for these containers ? -
There is a standard for each container and format, there is not one standard for them all. (which is why reading just the latest specification isn't often enough)
A lot of container formats are similar, mpeg-based video formats and containers are all similar,....
Regarding containers: Read the specification. If there are multiple versions of the specification be aware that you can encounter all of them.
-> Yes, writing a parser for lots of containers and their content is a lot of work, which is why people like to use libraries like libav&co.users currently on my ignore list: deadrats, Stears555
Similar Threads
-
Cutting MKV Files - Subtitle Files Inside of MKV
By devilcoelhodog in forum EditingReplies: 2Last Post: 11th Sep 2016, 21:29 -
MKV/DTS files to MKV/AC3 & AAC
By ktklein72 in forum AudioReplies: 0Last Post: 15th Feb 2013, 11:43 -
Hard-subbing .ass Subtitle Files to .mkv Files to be Playable on HDTV
By Sansui in forum SubtitleReplies: 4Last Post: 18th Nov 2012, 12:21 -
MKV guide, Play MKV, MKV to AVI, MKV to DVD, MKV to MP4, MKV to Blu-ray
By Baldrick in forum Newbie / General discussionsReplies: 55Last Post: 29th Jun 2012, 11:19 -
how to join mkv.a and mkv.b files
By sumeshkri in forum EditingReplies: 1Last Post: 5th Apr 2012, 19:56