I'm given the task to transcode a bunch of GoToMeeting Video files each evening. Once the video has been transcoded, it will be uploaded to a website. However, before I jump too far into the project, I wanted to figure out if this is even possible.
My current sample script is a simple batch file where I can drag and drop several files onto the batch file. It will transcode the first file, display an output and then continue to the second file to transcode. This is the expected behavior that I'm looking for.
@echo off
C:\g2mtranscoder.exe source=%~1
echo %~1 has completed.
C:\g2mtranscoder.exe source=%~2
echo %~2 has completed.
C:\g2mtranscoder.exe source=%~3
echo %~3 has completed.
C:\g2mtranscoder.exe source=%~4
echo %~4 has completed.
pause
My question is that if in C# (will be a Windows Service ultimately), would it be as simple as calling the external program g2mtranscoder.exe
to do the transcoding and then put my upload script right afterwards? Obviously, I would not want to upload a video that is currently being transcoded nor would I want the video to be upload without having been transcoded first.
My subquestion is would putting this in a loop (for each file in a directory) cause any issues if the contents of the directory is only ever the pending videos to be transcoded? If in the loop, would it try to loop through and start the transcoding of all files within the directory asynchronously or would it be more synchronous? I would like to avoid the loop happening asynchronously as it could overload the machine causing artifacts or synchronization issues with the audio/video timing. Most importantly, a video in the middle of transcoding or an untranscoded video cannot be uploaded.
Any coding suggestions for this would be great, but I'm really looking for more of a understanding of how C# works with code execution with having a external program called in the middle of the executed C# code.
I'm more of a Ruby/Rails and Linux person and do not have much experience on C#. I know enough to be dangerous, but just want to make sure that what I'm looking to do is feasible.