[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

ffmpeg/MKV scripts

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 10
Thread images: 2

File: my_file_mkv.png (31KB, 256x256px) Image search: [Google]
my_file_mkv.png
31KB, 256x256px
>Have a folder with about 800 bluray rips
>Have muxed in commentaries to several of them
>Others came with more than one language audio track, etc
>Over time forgotten which files have more than one audio track and which don't

Can /g/ help out with a script (Windows based preferable but I'm willing to do the work to make linux style scripts work in Windows) to identify MKV files that have more than one audio track?
>>
File: mediainfo.png (65KB, 806x600px) Image search: [Google]
mediainfo.png
65KB, 806x600px
>mediainfo
>drag
>???
>>
>>58180121
Whats it matter if they have more than one audio track?

also you should host an ftp server anon :3
>>
>>58180121
I'll help out bit.

Might not be correct syntax, so do bit of correction on this.

for %%a in ("*.mkv") do (
ffmpeg -i "%%a" 2>&1 | findstr -i "audio" > test.txt

for /f %%i in ('FINDSTR /R /N "^.*" test.txt | FIND /C ":"') do set VAR=%%i

echo %VAR% > files.txt
echo. > files.txt
)




If all works, put this test.bat file inside where the mkv files are and it should give you files.txt with your result.

I didn't test the script cause im lazy
>>
>>58180121
python or similar to catch stdout from mediainfo command line to output the properties of a file, then you parse that apply your own logic of demux / remux with ffmpeg commands, save all mediainfo info, and all to-run ffpmeg commands for quick review before batching 800 remux jobs
>>
>>58180779
oh wait, I forgot the if statements
IF %VAR% GTR 1 (
echo %VAR% > files.txt
echo. > files.txt
)


something like this
>>
>>58180779
>>58180852
This is a good starting point, thanks man. I'm on the fence about using ffmpeg vs ffprobe but yeah I was mostly after a loose loop structure without reinventing the wheel myself, as it's been a long time since I've programmed.

>>58180569
I'm in the mood to listen to a commentary track and am curious if I have any I've never listened to before
>>
Ffprobe....
>>
>>58181501
>commentary track
fair enough.

Wish I could give some simple advice, actually mpv has an icon for tracks and captions and it gives a number.. so you could open the whole directory and just keep hitting next until you see one you havnt seen before.

The way I would id it is how I handled sorting images.
enumerate the directory
open the images and get their properties
if (size is < acceptable){ send to trash();}

Do the same thing with the videos except
if ( number of audio tracks > 1) {move to different folder();}


I still think you should let us download some stuff if they are good movies.
>>
>>58181501
for %%a in ("*.mkv") do (
ffmpeg -i "%%a" 2>&1 | findstr -i "audio" > audio.txt
findstr /r /n "^.*" audio.txt | find /C ":" > num.txt
set /p a=<num.txt
if %a% == 1 (echo "skipped") else (echo "%%a" >> files.txt)
)



Re thought the code a little bit, however I can't run it in windows for some god damn reason. I'm pretty sure its syntactically correct.

>get file.mkv from dir
>print all audio streams into audio txt file
>load number of lines from audio txt and into num txt
>load num txt to variable a
>if var a is 1, skip, otherwise add file.mkv to file txt

This should technically give you a list of files that has more than 1 audio file. However I can't get it to run. I havent done batch files in longest time
Thread posts: 10
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.