VideoHelp Forum


Try StreamFab All-in-One and rip streaming video! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. i have bunch of files (media file) in a folder. i want to save those file list with file size info in a text file using batch script (windows). i am not sure how can i achieve that. using cmd i can get file size in bytes. so i was wondering may be media info app can do that? any idea please?

    Code:
    https://mediaarea.net/en/MediaInfo
    Quote Quote  
  2. If you don't mind having the creation date and time too you can use the DIR command at the command line:

    Code:
    dir *.mkv >list.txt
    will create a file called list.txt that looks like:

    Code:
    04/03/2020  10:39 AM       224,906,172 aticap.avs.mkv
    02/06/2020  02:13 PM         6,598,387 Before.avi.avs.qsvenc64.mkv
    01/16/2020  09:27 AM         2,090,552 Before.mp4.avs.qsvenc64.mkv
    09/02/2017  04:53 AM       591,329,217 Bonnie and Clyde clip.mkv
    01/13/2020  06:02 PM       148,484,915 EdiusOUT.mp4.avs.qsvenc64.mkv
    11/05/2019  06:16 PM       189,534,868 FFWD.mkv
    12/13/2019  10:44 AM       192,508,483 hevc10bit.mkv
    11/15/2019  08:00 PM     1,315,443,282 sintel_4k.mov.24p.mkv
    11/15/2019  08:12 PM     1,315,443,187 sintel_4k.mov.60p.mkv
    It will have a little other stuff that you can edit away with Notepad.
    Quote Quote  
  3. showing bytes in size is not good for human eyes. is there anyway we can generate multiple media file mediainfo in one single text file using media info app?

    like

    abc\abc.mp4
    abc\xy.mp4
    abc\cs.mp4
    abc\asd.mp4

    media info will create all file media info and save in

    abc\media.info
    Quote Quote  
  4. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    Hi.
    Change the path to MediaInfo.exe to suit.

    Code:
    @echo off
    for %%a in ("*.mp4") do call :process "%%a"
    goto :end
    
    :process
    set video=%~1
    MediaInfo.exe  --Language=raw --Full "--Inform=General;%%FileSize/String4%%" "%video%" >> ~tmpfile.txt
    set /p FileSize= < ~tmpfile.txt
    del ~tmpfile.txt
    echo "%video%" >> ~mediainfo.txt && echo %FileSize% >> ~mediainfo.txt
    goto :eof
    
    :end
    Cheers.
    Quote Quote  
  5. Originally Posted by pcspeak View Post
    Hi.
    Change the path to MediaInfo.exe to suit.

    Code:
    @echo off
    for %%a in ("*.mp4") do call :process "%%a"
    goto :end
    
    :process
    set video=%~1
    MediaInfo.exe  --Language=raw --Full "--Inform=General;%%FileSize/String4%%" "%video%" >> ~tmpfile.txt
    set /p FileSize= < ~tmpfile.txt
    del ~tmpfile.txt
    echo "%video%" >> ~mediainfo.txt && echo %FileSize% >> ~mediainfo.txt
    goto :eof
    
    :end
    Cheers.
    thank you so much. it's generating media info of current folder. but it's not reading the subfolder
    https://i.imgur.com/1KzvK40.png

    can you please help me a bit more? i want to set a Parent/root folder which will have subfolder like: "New folder" "secondfolder". inside subfolder there is multiple media file. i want to generate mediafile info based on subfolder and save text inside the subfolder.


    sorry i am noob


    i tried something like this... not working

    Code:
    CD "C:\TV\test\mediainfo"
    for /d %%f in (*) do (
      pushd %%f
      
      (
    for %%a in ("*.mp4") do call :process "%%a"
    goto :end
    
     set video=%~1
    C:\TV\test\mediainfo\MediaInfo.exe  --Language=raw --Full "--Inform=General;%%FileSize/String4%%" "%video%" >> ~tmpfile.txt
    set /p FileSize= < ~tmpfile.txt
    del ~tmpfile.txt
    echo "%video%" >> ~mediainfo.txt && echo %FileSize% >>  ~mediainfo.txt
      popd
      
      )
    )
    pause
    Last edited by firekid; 22nd Jul 2021 at 16:56.
    Quote Quote  
  6. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    Hi.
    /r = recurse into sub folders
    "%%~nxa" = pass on only the 'file name.extension' to process

    Code:
    @echo off
    for /r %%a in ("*.mp4") do call :process "%%~nxa"
    goto :end
    
    :process
    set video=%~1
    MediaInfo.exe  --Language=raw --Full "--Inform=General;%%FileSize/String4%%" "%video%" >> ~tmpfile.txt
    set /p FileSize= < ~tmpfile.txt
    del ~tmpfile.txt
    echo "%video%" >> ~mediainfo.txt && echo %FileSize% >> ~mediainfo.txt
    goto :eof
    
    :end
    Cheers.
    Quote Quote  
  7. thank you so much for the replay. but don't want to combine all file list only in one single text file.

    i want to save

    New folder file list to "New folder\~mediainfo.txt"=>this text file will contain only "New folder" file list
    Secondfolder file list to "Secondfolder\~mediainfo.txt"=>this text file will contain only "Secondfolder" file list

    any help please? sorry for my bad english and my batch script knowledge
    Quote Quote  
  8. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    Hello again.
    We need to pass the path and the file name to process.
    Then echo the results back to the same path. Easy.

    Code:
    @echo off
    for /r %%a in ("*.mp4") do call :process "%%~dpa" "%%~nxa"
    goto :end
    
    :process
    set videopath=%~1
    set video=%~2
    MediaInfo.exe  --Language=raw --Full "--Inform=General;%%FileSize/String4%%" "%videopath%%video%" >> ~tmpfile.txt
    set /p FileSize= < ~tmpfile.txt
    del ~tmpfile.txt
    echo "%video%" >> %videopath%~mediainfo.txt && echo %FileSize% >> %videopath%~mediainfo.txt
    goto :eof
    
    :end
    Cheers.
    Quote Quote  
  9. thank you so much! work perfectly.
    Quote Quote  



Similar Threads