Hi, I have multiple files in a folder.
If i play the video , i could just click the codec menu to view the codec
But , if i want to know that all files in the folder are having the same codec, both audio and video. if not it may list out those that are not having the same codec.
Is there any specific command in ffprobe or ffmpeg to do this.
i want a single line formula for this .
please help.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 30 of 33
Thread
-
-
One solution https://stackoverflow.com/questions/2869281/how-to-determine-video-codec-of-a-file-wit...fmpeg/29610897
Since you wish to check ALL files at once, you will it would be better to call a batch file with a single command using MEDIAINFO that repeats and outputs to a text file.
Code:setlocal enabledelayedexpansion @echo off > FPS.txt for %%a in ("*.mp4","*.mpg","*.flv") Do ( cd %%~dpa ver > nul echo %%a >> codecs.txt MediaInfo.exe --Output="Audio;%%Codec%% %%CodecID%%" "%%a" MediaInfo.exe --Output="Video;%%Codec%% %%CodecID%%\r\n" "%%a" )
0_1_xInstagram.mp4
AAC LC mp4a-40-2
AVC avc1
merged_T0_0_xInstagram.mp4
AAC LC mp4a-40-2
AVC avc1
new.mp4
AAC LC mp4a-40-2
AVC avc1
T0_0_xInstagram.mp4
AAC LC mp4a-40-2
AVC avc1
xInstagram.mp4
AAC LC mp4a-40-2
AVC avc1 -
Hi, budman,
media info contain some more files other than the exe.
can i just copy the media info exe in the folder i want to use
i once ran the cmd with echo on , as the screen went off in the echo off
I willl try by copying mediainfo exe in to the directory and report
thanks for the code.
i tried but without success
expecting replly from youLast edited by jraju; 8th Feb 2021 at 23:48.
-
please find enclosed the result
Am I making some mistake
what i really want is to show only the files that are not matching with the first file.
I do not have any other extension other than mp4 and these may contain different video and audio outputs.
what i need is , check video and audio codec, that will be listed as first file, the formula may check the match of codecs with this file , and if found difference in codec, list the file that differs.
The result file codec txt contain the file name, of all files in the folder and it also opens the media info gui screen. -
My mistake. I wrote the code to list all the files and their codecs so you could look for any that were different in the list.
If I understand now, you wish to use 1 video as a reference and check all other videos, listing only those that are different. Correct? Did you need to check all the audio streams in a video, if it has more than 1? -
Maybe have a look at my project MediaInfo.NET, it has a folder grid view feature with sortable columns where you can sort by audio and video codec or filter by keywords like avc or hevc.
https://github.com/stax76/MediaInfo.NET
Or my command line solution Get-MediaInfo, that's used by StaxRip and MediaInfo.NET for showing the folder grid view. It's 2021, so this is powershell, it is powerful.
https://github.com/stax76/Get-MediaInfo -
Hi, budman, that is correct, I want to compare the rest of the video and audio codec with that first video codec and audio codec and lilst the difference.
I want a bat file so that i need not check each one of the file that is there.
Moreover, i presume, that if the first listed video is as per the explorer content, then I will note down, if the first video has the correct code.
Or the program bat will take its own list, then it may not give correct details.
Hi, stax76, I think your ideas are for advanced users . -
The original bat I gave you should have created a list of all files and their codecs. I thought you wanted to just list all and note the differences. You want only those that are different so that can probably be done with batch or gui. I will work on a program to just note the videos that are different than the reference video. CMD OR GUI?
-
cmd bat file . I will just execute and find it
is my presumption of the program, will take , the first file as listed in the explorer windows of that folder
please say, otherwise, if it takes on a kind of alphabetic order, then the result would be not as expected.
your solution on ffprobe , i
can you change the formula you linked to include -.mp4
would that be possible -
Bat/cmd files use their own unique way if selecting which file they choose as first. It would probably be easier to drag/drop your reference file on the cmd and then let it loop thru each of the others for differences.
I will work on a cmd file that does just that and produces a list of the videos that are different along with their different codecs, similar to my original cmd but listing only the difference videos -
budman, thank you so much.
please tell me how to drag or drop my first file, referece to the cmd prompt. Is there a way to a kind of select from dir command
i really do not know , how to drag fle to cmd pl
just imagine how it will help most people , who do not find a way
their different dieices may support a particular video and audio format.
if the list contains hundreds of video, the bat would list the different that need to be converted to that reference file format.
this kind of innovation really helps many. waiting for your reply -
Oops wrong batch wrong images. Will post correct
Last edited by Budman1; 10th Feb 2021 at 22:23.
-
hi, will try budman. You mean cmd file, as bat file . ok
Shall i select more than one file to this bat file
or only one fileyour quote
Then just drag a video and drop it on the CMD icon.
where is video codec and audio codec. are they shown as points
please i am a newbie in programming -
Oops wrong post
Last edited by Budman1; 10th Feb 2021 at 21:59.
-
Budman, it seems that you edited your reply to have onlly one time at a time.
I think you have given that to drag the reference file in to the bat and all files will be scanned
Time consuming, how much time it will take to complete one file.
If you remove all other variables except, video codec and audio codec, will it take much time
i do not think so, because of number of variables , the time is lengthy, i f i may say so.
could you tell me which lines are to be removed to get the video and audio codec alone -
Hi, i executed your bat, but it is rounding with not responding in the task manager.
I think , so much parameters cause the delay. -
Oops wrong post
Last edited by Budman1; 10th Feb 2021 at 21:58.
-
Oops wrong post
Last edited by Budman1; 10th Feb 2021 at 21:57.
-
You wish to know all videos that have different codecs than reference. You drag reference to bat/cmd file and it will create fole called codecs txt. This will list your reference file, its codecs and all files with different codecs as ne list these as my example image shows. I sent wrong file batch. I will send correct one when I am on pc. Sorry, I had 2 requests swapped.
-
Okay, I must apologize profusely for the mix up. I was andwering your request from my cell and did not send correct information. To quote now to be sure:
But , if i want to know that all files in the folder are having the same codec, both audio and video. if not it may list out those that are not having the same codec.Code:setlocal enabledelayedexpansion @echo off > "Vcodec.txt" @echo off > "Acodec.txt" @echo off > "Codecs.txt" for %%a in ("%~nx1") Do ( MediaInfo.exe --Output="Audio;%%Codec%%" "%~nx1" > Acodec.txt MediaInfo.exe --Output="Video;%%Codec%%" "%~nx1" > Vcodec.txt set /p Video=<"Vcodec.txt" set /p Audio=<"Acodec.txt" echo Reference %%a >> "Codecs.txt" echo Video=!Video! Audio=!Audio! >> "Codecs.txt" @echo. >> "Codecs.txt" ) set /a count=0 for %%b in ("*.mp4","*.mpg","*.mkv") Do ( cd %%~dpb MediaInfo.exe --Output="Audio;%%Codec%%" "%%b" > Acodec.txt MediaInfo.exe --Output="Video;%%Codec%%" "%%b" > Vcodec.txt set /p NewV=<"Vcodec.txt" set /p NewA=<"Acodec.txt" if NOT !NewV! == !Video! ( echo %%b >> codecs.txt Video echo !NewV! >> codecs.txt @echo. >> "Codecs.txt" ) if Not !NewA!==!Audio! ( echo %%b >> "codecs.txt" Audio echo !NewA! >> "codecs.txt" @echo. >> "Codecs.txt" ) set /a count+=1 set /a ekko=count%%10 if !ekko! EQU 0 echo Frame !count! processed )
If you want to you can change it CAREFULLY to "for %%b in ("*.mp4") Do (" but it really doesn't matter since you have only MP4's in the folder it will not find any MKV or MPG files. I only added so I could show the files with different codecs. -
Hi, thanks for the revised codec. I had not received email alert of this update.
today only i am seeing the post, will try budman.
The process is same is it not.
just open the bat file and drag the reference file and the rest is saved in files to see ok.
will try and report back to you. -
Hi, Budman , but i am getting , not responding bat and the cursor is swirling round.
will it take time to get this result
please tell me if i am not following correct instructions.
just drag the reference file to the bat file, by right clicking the bat file and select edit to open and then drag the reference file
I just ran the script with one reference file and one mkv file, and waited for it to finish without closing anything.
The script ran for few minutes and then open the reference file as mp4.
there was no creation of codecs.txt , in the folder, but the mp4 opened with machine characters.
Am I missing anything.
valuable bat file, and may well be useful for so many users .Last edited by jraju; 13th Feb 2021 at 20:52.
-
There is no reason to open and click edit. It is designed to drag the reference file over the bat ICON. Dropping it on the BAT ICON will activate the bat and test all videos in the reference folder. Open video folder in windows explorer. You should see all your video icons , or some people call them thumbnails, as well as those for mediainfo icon. Drag a video thumbnail and drop it on the bat thumbnail. That's all there is to it. There may be a slight pause with cmd , bat windows but shouldn't be long.
-
Budman, this is news to me . I tried , it did open a command prompt and side by side opened the reference file in the media info gui.
just it shows the details of the reference video in the gui.
it created a codec.txt, which is as follows and it stops,
the codec txt contains
Reference "kbs017.mp4"
Video= Audio=
Is there anything missing on my part , shall I leave the gui as it is
to proceed -
It looks like you are using mediainfo.net? I do not know anything about the command results for it. I just use normal mediainfo not .net.
I'll attempt to send a zip with all the files I use. Not sure if videohelp allows uploading zip files. If not I will post it to my site and send link. -
OK I uploaded RAR to Dropbox and shared it. https://www.dropbox.com/s/79wno0dapqy9kv9/New%20folder.rar?dl=0 will open dropbox UnRarred files. To download the whole folder click the 3 dots on the right side and select download.
Now unrar it and it will create a folder called New Folder. Everything is inside to test. Drag "Sample 1.mp4" to "Check codecs.cmd" and drop it on the icon. There should now be a" Codecs.txt" that is similar to the sample Codecs.txt, listing all the files amnd the difference in their codecs. The will be 2 lines if audio and video are both different.. -
Hi, thanks so much for the effort on your codeing. i raised similar query, in other forum, to which i shared the link.
thanks for the great effort.
i just subtituted my files in your downloaded folder, with one more dll, i686 dll to get the result. the present mediainfo exe verison , did not work, it pops up the gui interface stopping further process.
the link I shared is here
https://www.sevenforums.com/general-discussion/425080-ffmpeg-command-check-if-all-file...ame-codec.html -
Yes I thought it might be the .net version. I will experiment and may e mans ut work with that too.
Just glad it worked for you.
Thanks -
Hi, Budman,
what is that message
10 frames processed
20 frames processed
30 frames processed
shown while processing the files.
the total filles including the reference files were 36Last edited by jraju; 14th Feb 2021 at 08:05.
Similar Threads
-
How do I pass values from FFProbe to FFmpeg?
By Bassquake in forum ProgrammingReplies: 12Last Post: 10th Feb 2021, 09:39 -
HELP: FFMPEG Scale and Chromakey syntax?
By DotMatrix in forum Newbie / General discussionsReplies: 0Last Post: 20th May 2020, 11:54 -
ffmpeg vs ffprobe frame count speed
By Anime4000 in forum Newbie / General discussionsReplies: 6Last Post: 12th May 2019, 05:05 -
Help with Syntax for FFmpeg (sorry... newbie)
By dstewart275 in forum Newbie / General discussionsReplies: 2Last Post: 6th Dec 2017, 16:32 -
Q: ffmpeg syntax for VC1 to H.264?
By DanielCoffey in forum Video ConversionReplies: 2Last Post: 27th Apr 2016, 15:56