Jump to content

Recommended Posts

Posted (edited)

Primary school. We have a mapped drive that staff use to share lesson resources and it's been growing steady for some time, so I've been looking at what has been saved and I'm surprised to say there are 2k .mov files adding up to 53GB and we have only had the iPads for less than 2 years.

 

I've used Handbreak on the odd file and they convert to .mp4 nicely at a fraction of the size but of course I don't fancy going through all the files.

 

Has anyone found a way to automate the conversion process and delete the original .mov after conversion?

Edited by Jobos
Posted

I thought that you could 'throw' a lot of files at Handbrake and it would batch convert them...

 

For a one off set of conversions, i'd use WinFF You can set up your options for what 'flavour' of MP4 you want, add a load of files, specifiy an output directory (or the same directory) and then delete the source files afterwards. WinFF is a GUI for FFMPEG, which is what Handbrake uses under its skin.

 

For ongoing conversion needs, I use drop folders and a bat file to convert files using FFMPEG. A folder on a 'share' is monitored (by Directory Monitor) and when it detects a new file, it calls the script and uses FFMPEG to convert it and put it in a new folder.

 

I set up a folder called 'convert_to_MP4' and another called 'convert_to_MP3'. the 'output' folder is called 'Converted_Files_are_Here'. The script could be modified in order to delete the source file after the conversion.

 

my 2p

  • Thanks 1
Posted
I think the file server resource manger can help with this.. you can create a file screen for the file type, this can make an event log, that can trigger a scheduled task. ;) aaand as above.
  • Thanks 1
Posted
Thanks everyone. I looked at WinFF but I couldn't see a way to delete the original file after conversion so think I'm going to write a script to work with Handbreak as there's a command line version of Handbreak called HandbreakCLI that looks promising.
Posted

Definitely a job for handbrake.

You can schedule the conversion to happen. continually look at a folder or setup a folder monitor for any additions.

 

.MOV to .MP4 saves a load of space, even without lowering the resolution

Posted

Do you have an adobe creative cloud licence for your school?

 

If so download adobe media encoder - it does everything you need including batch converting and it's a much nicer interface than handbreak/scripts

Posted

I created something in similar in Powershell / Handbrake CLI to encode most media types to mp4

 

Not automated (but that can be done on a folder change etc) as I tend to do batch conversions re-actively / upon request. Keeps a copy of the original as well as the newly encoded media file. Not perfect or polished by any means, but happily chugs its way through a folder worth of files....

 

$filelist = Get-ChildItem D:\ToEncode\ -include ('*.mp4', '*.mts', '*.mov', '*.wmv', '*.avi', '*.mkv') -recurse

$num = $filelist | measure

$filecount = $num.count

 

$i = 0;

ForEach ($file in $filelist)

{

$i++;

$oldfile = $file.DirectoryName + "" + $file.BaseName + $file.Extension;

$newfile = $file.DirectoryName + "\Encoded" + $file.BaseName + ".mp4";

$originalFile = "D:\ToEncode\Original"

 

$progress = ($i / $filecount) * 100

$progress = [Math]::Round($progress,2)

 

Clear-Host

Write-Host -------------------------------------------------------------------------------

Write-Host Handbrake Batch Encoding

Write-Host "Processing - $oldfile"

Write-Host "File $i of $filecount - $progress%"

Write-Host -------------------------------------------------------------------------------

 

Try {

Start-Process "C:\Program Files\HandBrake\HandBrakeCLI.exe" -ArgumentList "-i `"$oldfile`" -o `"$newfile`" -f mp4 --rate 29.97 --verbose=0 " -Wait -NoNewWindow

Move-Item $oldfile -destination $originalFile -ea STOP

}

Catch {

 

 

}

 

}

Posted

I have done this in the past but it was many, many moons ago!

 

I wouldn't use handbrake for though, handbrake is a frontend for ffmpeg, so its an extra wrapper that is not necessary and creates another place for things to break.

ffmpeg directly is the only tool you need for this.

 

It was basically a script that ran monthly, found any files older than 6months then compressed them with ffmpeg.

https://ffmpeg.org/

 

Originally I tried getting the filesystem to intercept the call to save, compressing it and saving the output - but it caused too much load on the fileserver when everyone tried to upload at once. A cron is the way forward.

  • Thanks 1
Posted
Something to note, this will hit the CPU on the machine processing the conversation. If you have something with an Intel Quick Sync it will handle it much better.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...