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
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 9 of 9
Thread
-
-
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
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
-
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 -
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
-
thank you so much. it's generating media info of current folder. but it's not reading the subfolder
https://forum.videohelp.com/images/imgfiles/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 iKron; 22nd Jul 2021 at 16:56.
-
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
-
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 -
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
Similar Threads
-
Matroska text file attachment
By Bigo2 in forum Software PlayingReplies: 10Last Post: 12th Jul 2022, 08:30 -
Renaming chapters in an mp4 from a text file
By RandmTask in forum Video ConversionReplies: 5Last Post: 24th Sep 2020, 04:06 -
How to split a .TS video file based on time (not file size!) ?
By Michael REMY in forum EditingReplies: 4Last Post: 19th Sep 2020, 18:32 -
Editing a 100MB video file turns into 1.5GB file!! How to control size?
By GoodEnough in forum Newbie / General discussionsReplies: 3Last Post: 2nd Apr 2020, 22:27 -
How to get and list in a .txt file all CLSID contained in a .dll?
By marcorocchini in forum Newbie / General discussionsReplies: 1Last Post: 14th Feb 2019, 03:55