The Problem

I have around 3000+ videos growing daily. Each of these videos need to be converted to H.264, with 2 audio tracks, straight through and Stereo in an M4V container. I currently use a .Net application and the HandBrakeCLI to encode these videos. My problem is that this requires me to do it manually and monitor it continually.

The Ideal Solution

I am looking for a solution which can meet the following criteria:

  • Monitor a set of folders for when an AVI/WMV file is dropped
  • Encoded the video and log results to a log file, or notify of failures in some form.
  • Remove the AVI/WMV and replace it with the M4V if it is successfully encoded.

The solution can be Windows, Linux or Mac based.

Any good suggestions?

I can modify the existing code for the encoding to do this, but honestly don't have the time to. Therefore I am looking for an existing solution before modifying and writing my own code to do this

Conclusion

The closest solution was harrymc's suggestion for using DropFolders, however it lacks multiple folder support and removal functionality. I have bit the bullet on this and I am integrating the functionality into an existing Media Management tool I am in the process of developing.

link|improve this question

feedback

5 Answers

up vote 3 down vote accepted
+100

See Watch Folders & Convert Video Files with DropFolders & HandBrake :

DropFolders is an Adobe AIR program to be run on Windows that integrates with HandBrake. It automates the video conversion process by watching specified folders and performing the actions you assign.

link|improve this answer
Nice Find. My only reservation with using this is the lack of multiple folder support, and not being able to specify which file types to search for, otherwise, extremely close to my needs. – Diago Oct 22 '10 at 10:13
It supports multiple presets - is this not the same as multiple folders? – harrymc Oct 22 '10 at 10:32
Unfortunately not. Presets are the settings used to encode with, and doesn't include the folders. I have bit the bullet and I am building my own application to do this with. – Diago Oct 24 '10 at 19:22
I wonder if you can still make it work by using a dummy folder containing junctions to the other folders. The disadvantage is having one output folder only, but your script can maybe solve this. – harrymc Oct 25 '10 at 19:46
feedback

I am sure I can come up with something better, or someone can program something, but for a quick solution, I put this together for you as a batch file. Simply put the full path to the program that you run in the line and set this as a scheduled task to run however frequent you want.

If no videos are found, or if it is already running, it will just quit and it should be very low CPU/Memory, so running every 5 seconds would be perfectly safe.

Copy and paste to a .BAT file in the folder containing the videos

@echo off

if exist locked.txt goto locked

if exist *.avi goto found
if exist *.wmv goto found
if not exist *.avi goto step2

:step2
if not exist *.wmv goto nothing

:nothing
echo no files found, quiting!

:found
@echo locked > locked.txt
**-----PUT COMMAND TO RUN HERE**
del locked.txt

:locked
echo I am already running... quiting
exit
link|improve this answer
1  
+1 Very nice solution. Would be interested to see what you can come up when you have some more time :) – Diago Oct 15 '10 at 18:13
@Diago - just thinking - if your current program works, I can modify this to add a few more of your requirements before getting too advanced, namely, delete all AVI/WMV files when their M4V is created, however, if I was to do it like this, it would be via filename search - however, if when your program has an error, it doesn't delete the half created m4v file, it will delete the original - alternatively, a lot of codec/creation programs allow you to add scripts, an option may be to delete the source after a successful transcode... Let me know if there is anything more I can do to help. – William Hilsum Oct 15 '10 at 22:37
feedback

I use WinFF (which is a front-end for FFMPEG for windows/OS X/linux). It has a number of existing presets, as well as having the ability to create your own.

It also has a batch list by default, and can specify the destination folder of a batch.

It can also run in multiple instances.

link|improve this answer
What the user is looking for is a program or solution that integrates with HandBrake since he has already perfected the setting to that program and doesn't want to redo the setting once again. – KronoS Oct 25 '10 at 14:21
feedback

I do not know about the "monitoring existing folder", if you mean that it will actually startup the script if a file is added or changed, but I know that for automating the transcoding this is something that could be done very efficiently with ffmpeg.

And given not having time to write it yourself, there's already millions of ffmpeg scripts that have been written already, I think a quick google search for ffmpeg script to convert wmv to H.264 should get what you need. First several hits look pretty good.

Add to Wil's script above, and maybe you've got something that almost does what you need.

I'm wondering if you started a bounty on this question for a working script for a couple hundred status points if you would not get an answer quickly, assuming this would not be too unacceptable a use of the bounty system?

link|improve this answer
1  
couple of things: 1. ` I do not know about the "monitoring existing folder"` - unfortunately, that's pretty much the core of his question. 2. Please don't sign off your post with your handle since the system does so automatically (ref: meta.stackoverflow.com/questions/5029/… ) 3. on bounty: I'd suggest you move it to meta ( meta.superuser.com ) since the point doesn't answer @Diago's question. TO answer: bounty can be awarded only after 2 days of formulating the question. 4. Google links are frowned upon (cont) – Sathya Oct 16 '10 at 2:37
1  
m.fields as they often lead to a wild goose chase, and more often than not bring up this very question, resulting in recursion loop. Just thought I'll bring you upto speed on my experiences on Super User. Cheers. – Sathya Oct 16 '10 at 2:39
I have been looking into the idea of using FFMPEG. My biggest problem is that I have the perfect settings for HandBrakeCLI. The time I will need to get those settings right for FFMPEG means I may as well rewrite the existing application. My reason for the question is time, and the monitoring part is my biggest bug bear at the moment. – Diago Oct 16 '10 at 6:28
feedback

I've found "Unattended FFMPEG Encoder".

Haven't try it yet.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.