VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. 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?
    Quote Quote  
  2. Originally Posted by agni451 View Post
    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?
    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?
    I think it does it through avisynth with framecount clip properties
    http://avisynth.org/mediawiki/Clip_properties
    Quote Quote  
  3. Originally Posted by poisondeathray View Post
    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
    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.

    Originally Posted by poisondeathray View Post
    I think it does it through avisynth with framecount clip properties
    http://avisynth.org/mediawiki/Clip_properties
    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).
    Quote Quote  
  4. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    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%"
    (ii) using the avisynth file you intend to process
    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%"
    These work for me under Win7.
    Quote Quote  
  5. Originally Posted by hydra3333 View Post
    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%"
    Wow. This is perfect! Thanks to both of you for your help!
    Quote Quote  



Similar Threads

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