I need to be able to retrieve the framecount of a video via commandline. It's more complicated than it sounds; I know I can use Mediainfo CLI to get the framecount of a ts file, but I need to be able to obtain the framecount from a d2v file. How would I do that? How does MeGUI do it when you load an .avs file and it previews it and shows the framecount at the top of the preview window?
+ Reply to Thread
Results 1 to 5 of 5
-
-
It's listed in the log file as "coded number" so maybe you can write a parsing application . Parse d2v from dgindex also gives it , you can ask the author (neuron2) for more information
How does MeGUI do it when you load an .avs file and it previews it and shows the framecount at the top of the preview window?
http://avisynth.org/mediawiki/Clip_properties -
I wrote my own little d2v parser to count the frames, but I consistently get 1 or 2 more frames in my count than MeGUI. Basically it just counts all the 2-digit hex numbers listed, except "ff", where any 2-digit hex number ending in 0, 1, or 2 counts as 1 frame, and any ending in 3 counts as 2 frames. Still can't figure out why I get 1 or 2 more frames than MeGUI, and I need it to be precise.
I've seen that the "parse d2v" option in DGIndex does give both the framecount and duration, but is there a commandline switch for DGIndex where you can input the d2v and tell it to parse? As far as I could tell from the documentation, there isn't.
How would you go about getting that info via commandline? It's great to have that number when working inside the avs script, but I need a way to get that number read into a C# program (ie, either directly from commandline or saved to a text file). -
If you are using avisynth to process the video, the framecount may be inaccurate from mediainfo, say if you TRIM etc ... hence at least two ways are possible
(i) with mediainfo (if you are not toying with frames in avisynth)
Code:set PARF1fc=file-framecount.txt "C:\software\mediainfo\mediainfo.exe" --Inform=Video;%%FrameCount%% "input-file.mpg" > "%PARF1fc%" FOR /F "usebackq tokens=1" %%G IN ( "%PARF1fc%" ) DO SET FRAMES=%%G DEL "%PARF1fc%" REM --frames "%FRAMES%"
Code:set PARF1fc=file-framecount.txt "C:\software\avs2yuv\avs2yuv.exe" -frames 1 "avs-file.avs" NUL 2> "%PARF1fc%" FOR /F "usebackq tokens=3 delims=:" %%A IN ( "%PARF1fc%" ) DO SET Ftmp=%%A FOR /F "tokens=4" %%B IN ( "%Ftmp%" ) DO SET FRAMES="%%B" DEL "%PARF1fc%" REM --frames "%FRAMES%"
-
Similar Threads
-
get framecount for video
By agni451 in forum EditingReplies: 0Last Post: 6th Jul 2012, 05:05 -
I want to know if it would be possible to retrieve the video from the DVD-r
By robinei in forum Newbie / General discussionsReplies: 5Last Post: 16th Sep 2009, 23:11 -
what ffmpeg commandline should I use ?
By halsboss in forum Video ConversionReplies: 2Last Post: 3rd Apr 2008, 04:49 -
Cannot retrieve vital video frames for court case! Equipment buying spree?
By koopak in forum RestorationReplies: 17Last Post: 1st Mar 2008, 13:01 -
Commandline tool for background
By linkeboda in forum Authoring (DVD)Replies: 5Last Post: 12th Oct 2007, 08:09