Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
tangy yet delightful
Sep 13, 2005



I do some video work and currently have a client that will be bringing their video stuff in-house and they are now interested in obtaining the raw mp4 files from our years of work. However the video files contain non-relevant audio that I wouldn't want the client having access to for a variety of reasons.

Rough math, I probably have over 3000 mp4 files that would need to be stripped of their audio. These files are also organized in folders by project/month/year.

Currently I do all of my editing stuff in Adobe Premiere Pro (have a creative cloud sub if another of their products would be helpful to this). Is there a good way to batch strip audio from mp4s? If I would need to get another program or perhaps some sort of custom script written to assist with this - those are options I'm up for considering as well.

The final option is of course just saying no and not doing it but I'm hoping for an option that's reasonable in the time it would take to complete it.

Adbot
ADBOT LOVES YOU

thebigcow
Jan 3, 2001

Bully!
Would something like this take care of your problem?

https://superuser.com/a/1550848

tangy yet delightful
Sep 13, 2005



thebigcow posted:

Would something like this take care of your problem?

https://superuser.com/a/1550848
That looks awesome! I am quite an idiot however and haven't done any coding for like 15+ years so please bear with my stupid questions to follow.

I downloaded a gyan dev windows version of ffmpeg, then attempted to read the documentation on how to make it work but that was a lot of words so I watched this youtube video -
https://www.youtube.com/watch?v=Q7GW6v5DnFI

I was able to -i a single video file as a test and got that to work. So now I'm left with figuring out how to use the code you linked
code:
FILES=/{videos_dir}/*
output_dir=/{no_audio_dir}
for input_file in $FILES
do
  file_name=$(basename $input_file)
  output_file="$output_dir/$file_name"
  ffmpeg -i $input_file -c copy -an $output_file
done
I tried typing "ffmpeg" in command prompt when in the test directory I've setup and then pasting the entire code and that didn't work. I'm sure some of these variables are things I should be changing before pasting.

Do I leave the curly brackets but replace "videos_dir" with "E:\Audio Strip Test" and then that's it? If I have any non-mp4s (for example a .prproj file) in the same folder will that cause any errors or problems?

Klyith
Aug 3, 2007

GBS Pledge Week
That code sample is for linux bash script. I'm assuming you're on windows?

Copy ffmpeg.exe into the directory with your video files. Make a new text file there, and paste this:
code:
mkdir output
FOR %%F IN (*.mp4) DO ffmpeg -i "%%F" -c copy -an ".\output\%%F"
pause
then rename the text file from .txt to .bat, and run the bat
(if you can't see the .txt, you need to turn off "Hide extensions for known files" in folder options)


edit:

quote:

These files are also organized in folders by project/month/year.
If you wouldn't mind telling me a bit more detail about that, I can give you a batch to do the whole shebang at once. Change the names to fake for privacy is fine.

So like if the client that wants this stuff is Hanes underwear, is your structure:
C:\Video Projects\Hanes\2020\Jan\Socks Commercial\
or
C:\Video Projects\2020\Jan\Hanes\Socks Commercial\

Klyith fucked around with this message at 17:37 on Jun 25, 2021

tangy yet delightful
Sep 13, 2005



Klyith posted:

That code sample is for linux bash script. I'm assuming you're on windows?
Correct on windows.

quote:

Copy ffmpeg.exe into the directory with your video files. Make a new text file there, and paste this:
code:
mkdir output
FOR %%F IN (*.mp4) DO ffmpeg -i "%%F" -c copy -an ".\output\%%F"
pause
then rename the text file from .txt to .bat, and run the bat
(if you can't see the .txt, you need to turn off "Hide extensions for known files" in folder options)
Thanks for this, I assume I would put it in the top-most directory and it would do everything within that?

quote:

edit:

If you wouldn't mind telling me a bit more detail about that, I can give you a batch to do the whole shebang at once. Change the names to fake for privacy is fine.

So like if the client that wants this stuff is Hanes underwear, is your structure:
C:\Video Projects\Hanes\2020\Jan\Socks Commercial\
or
C:\Video Projects\2020\Jan\Hanes\Socks Commercial\
So don't laugh at what is probably not the most efficient file structure, currently the footage is spread across multiple drive letters and I'll likely buy a drive to consolidate it all which will be passed to the client, so the top letter (C/D/E) might change but the structure is(will be):

C:\Client Footage\20XX Videos\Month 20XX\Client\Project Name\

Each month has probably 4-8 different project folders if that matters. And if needed I'm not opposed to creating a different folder structure via some manual renaming if that'll make things work better/at all :)

Klyith
Aug 3, 2007

GBS Pledge Week

tangy yet delightful posted:

Thanks for this, I assume I would put it in the top-most directory and it would do everything within that?
No, that batch only hits the files in the directory it runs in, I hadn't read your OP closely at first.

So you could just keep moving the .bat & ffdshow to each folder you need processed. If that's a relatively easy task because there's only 10 target folders with 300 videos each, do that. But if you have 300 folders with 10 videos each it'd be a pain and you want something better.

quote:

So don't laugh at what is probably not the most efficient file structure, currently the footage is spread across multiple drive letters and I'll likely buy a drive to consolidate it all which will be passed to the client, so the top letter (C/D/E) might change but the structure is(will be):

C:\Client Footage\20XX Videos\Month 20XX\Client\Project Name\

Each month has probably 4-8 different project folders if that matters. And if needed I'm not opposed to creating a different folder structure via some manual renaming if that'll make things work better/at all :)

So that folder that I've bolded Client is the consistent target? A Year/Month folder might contain multiple Client folders, but the Client you're looking at is unique and always the same?

Example, if Hanes was the client:
C:\Client Footage\2020 Videos\January 2020\Hanes\Socks Commercial\
C:\Client Footage\2020 Videos\January 2020\Art Museum\Van Gogh Exhibit\
D:\Client Footage\2018 Videos\August 2016\Hanes\Tshirts Ad\
D:\Client Footage\2018 Videos\August 2016\Starbucks\Training Video\


(My objective is to do it as recursively as possible, and also make it so that your source videos stay on your drive. Doing the audio strip and copy to the external in the same step is better.)

tangy yet delightful
Sep 13, 2005



Klyith posted:

No, that batch only hits the files in the directory it runs in, I hadn't read your OP closely at first.

So you could just keep moving the .bat & ffdshow to each folder you need processed. If that's a relatively easy task because there's only 10 target folders with 300 videos each, do that. But if you have 300 folders with 10 videos each it'd be a pain and you want something better.
One Client folder per month, one each month of the year, and call it about 4 years and then the 4-8 project folders each month so 384 project folders as a rough max.

quote:

So that folder that I've bolded Client is the consistent target? A Year/Month folder might contain multiple Client folders, but the Client you're looking at is unique and always the same?

Example, if Hanes was the client:
C:\Client Footage\2020 Videos\January 2020\Hanes\Socks Commercial\
C:\Client Footage\2020 Videos\January 2020\Art Museum\Van Gogh Exhibit\
D:\Client Footage\2018 Videos\August 2016\Hanes\Tshirts Ad\
D:\Client Footage\2018 Videos\August 2016\Starbucks\Training Video\


(My objective is to do it as recursively as possible, and also make it so that your source videos stay on your drive. Doing the audio strip and copy to the external in the same step is better.)
That's correct.

Klyith
Aug 3, 2007

GBS Pledge Week
The TEST RUN:
code:
SET "_client=Hanes"
@echo OFF
FOR /R  %%G IN (*.mp4) DO CALL :process "%%G"
pause
exit
:process
SET _path=%~p1
CALL SET _test=%%_path:%_client%=%%
if /I NOT "%_path%"=="%_test%" (
	echo %1 >> fileslist.txt
	)
exit /B
Edit the Hanes on the first line into whatever your Client folder name is, save as .bat file in the base directory for your Client Footage.

All this does is make a text file with the list of videos it found. Sanity check to make sure we're on the same page.

Klyith
Aug 3, 2007

GBS Pledge Week
The REAL THING:
code:
SET "_client=Hanes"
SET _outdrive=X:
@echo OFF
if NOT exist %_outdrive% (
	echo ***   %_outdrive% not present   ***
	pause
	exit
	)
FOR /R  %%G IN (*.mp4) DO CALL :process "%%G"
pause
exit
:process
SET _path=%~p1
CALL SET _test=%%_path:%_client%=%%
if /I NOT "%_path%"=="%_test%" (
	if NOT exist "%_outdrive%%_path%" (mkdir "%_outdrive%%_path%")
	ffmpeg -i %1 -c copy -an "%_outdrive%%_path%%~n1.mp4"
	)
exit /B
Again replace Hanes with your client folder name and X with the drive letter of the output drive that you're dumping video to (ie the external you're going to deliver to the client).

Save as a .bat file, put the .bat and ffmpeg into the base directory & run it. Then repeat for other drives that have more Client Footage.

Adbot
ADBOT LOVES YOU

tangy yet delightful
Sep 13, 2005



Both the test run and the REAL THING worked flawlessly. Thanks so much Klyith!

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply