I’m proud to announce a little project I’ve been working on the past few days called FRC Video Splitter. *(https://github.com/tytremblay/FRC-Video-Splitter) Download the .zip file and run setup.exe to install it on your computer.
Video Splitter is a simple interface for batching the splitting of a large file into many smaller ones, specifically aimed at FRC match video. The aim is to make it easier for people to split an entire day of recording into individual match videos. At it’s core, it’s simply a GUI for generating ffmpeg commands.
Browse to the location of the large video file you want to split.
Browse to the folder you want to save the match videos to.
**Enter qualification match information. **
If the video includes qualification matches, set the numbers of the first and last qualification matches in the large video.
**Enter playoff / elimination match information. **
If the video includes qualification matches, enter their names (QF#, SF#, F#, SF1-2, etc).
If desired, override the default video length.
This is set to 3 minutes to give a little wiggle room when inputting the time stamps.
**Click the “Generate Timestamp Table” button. **
Video Splitter will generate a table of all the matches you indicated on the right.
**Enter time stamp information. **
This is the part I couldn’t automate. You’ll have to scrub through your video and enter the start time of each match in the HH:MM:SS format. It’s not too painful. I’m able to scrub through an entire day of matches in about 20 min.
Click "SPLIT VIDEOS"
and sit back and watch the magic.
Notes:
This currently only works in windows. I wrote it in C# because I’m not very good with python GUIs yet.
You’ll need to have FFmpeg installed and located at C:\ffmpeg.exe. (Download here)
Make sure you have enough disk space on the drive you’re saving videos to.
If you want a basis from cross-platform support, I’ve got a command line python script that does basically the same thing on my GitHub. It works almost exactly the same way - read the time data from a csv file, send ffmpeg commands to split it, upload to youtube, add to a playlist, and generate a CSV file to copy/paste into the TBA Video Spreadsheet.
That’s what I was gonna suggest since the sound of the transition from Auton to Teleop has a “unique” sound signature that should be easily identifiable. Or maybe not I’ve never done anything related to analyzing audio. Let us know if it works out if you attempt it.
I’ll definitely use it for this year. It’s going to be crazy driving, and directing my little freshman video crew I trained earlier this year. So anything with organizing video will help. When I do it myself it’s easy to know which one is which because I make mental notes. When there’s 4 other kids using my equipment I don’t know what file is which and these kind of programs help. I’ll use this in conjunction with plural eyes to organize everything.
I tried installing this but I got an error when running the setup, I’ve included a copy of the error log file below. Not sure if it’s the program or if I installed ffmpeg wrong (dragged the executable into “C:”).
PLATFORM VERSION INFO
Windows : 6.1.7601.65536 (Win32NT)
Common Language Runtime : 4.0.30319.34209
System.Deployment.dll : 4.0.30319.34244 built by: FX452RTMGDR
clr.dll : 4.0.30319.34209 built by: FX452RTMGDR
dfdll.dll : 4.0.30319.34244 built by: FX452RTMGDR
dfshim.dll : 4.0.41209.0 (Main.041209-0000)
SOURCES
Deployment url : file:///C:/Users/*MyUsername*/Downloads/FRC-Video-Splitter-master/FRC-Video-Splitter-master/FRCVideoSplitter.application
Application url : file:///C:/Users/*MyUsername*/Downloads/FRC-Video-Splitter-master/FRC-Video-Splitter-master/Application%20Files/FRCVideoSplitter_1_0_0_0/FRCVideoSplitter.exe.manifest
IDENTITIES
Deployment Identity : FRCVideoSplitter.application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6f52f40a19a9655d, processorArchitecture=msil
APPLICATION SUMMARY
* Installable application.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Users\*MyUsername*\Downloads\FRC-Video-Splitter-master\FRC-Video-Splitter-master\FRCVideoSplitter.application resulted in exception. Following failure messages were detected:
+ Application manifest has either a different computed hash than the one specified or no hash specified at all.
+ File, FRCVideoSplitter.exe.manifest, has a different computed hash than specified in manifest.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [3/3/2015 11:38:11 PM] : Activation of C:\Users\*MyUsername*\Downloads\FRC-Video-Splitter-master\FRC-Video-Splitter-master\FRCVideoSplitter.application has started.
* [3/3/2015 11:38:11 PM] : Processing of deployment manifest has successfully completed.
* [3/3/2015 11:38:11 PM] : Installation of the application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [3/3/2015 11:38:11 PM] System.Deployment.Application.InvalidDeploymentException (HashValidation)
- Application manifest has either a different computed hash than the one specified or no hash specified at all.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, Uri& appSourceUri, String& appManifestPath)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Deployment.Application.InvalidDeploymentException (HashValidation)
- File, FRCVideoSplitter.exe.manifest, has a different computed hash than specified in manifest.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ComponentVerifier.VerifyFileHash(String filePath, Hash hash)
at System.Deployment.Application.ComponentVerifier.VerifyFileHash(String filePath, HashCollection hashCollection)
at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
I think I fixed the manifest hash error. Github was modifying the file during pushes which messed with the computed hash. I told git not to mess with those files.
I think using computer vision to show when to mark the end of a match would be good too. I’ve seen archived matches where they don’t show the final score.
If you can’t detect the beginning of a match sound I think that labeling the start of the match ‘X’ seconds before the unique auto/teleop sound would work well too.
This is a tough call. You want to show the final score, but sometimes there’s that 5-10 minute delay while the refs talk confer. You could cut that out, but that’s a lot of manual labor and would be a great target for automation.
Yes, cutting out the time when the refs/scorekeepers are doing their thing would be better. You could then automate it by saying match start = 10 seconds before noise, match end =2 minutes after noise (or whatever the correct timings are) and then if the difference between that and the scoreboard screen is larger than 20 seconds or so flag it for manual review or even automate it more to delete that time inbetween…
So I’ve finally had some time to play around with this and I must say I’m very impressed with the speed and simplicity of using this program. I’m even more happy (and a bit surprised) that it’s compatible with .flv files (the native output of our stream software).
One idea on the whole scoreboard discussion; can ffmpeg merge video clips? If it can, you could just add another (optional) timestamp column to the match list for scoreboard appearance times, then take like a 10 second video clip (or for that matter just a still image would work) from that point and tack it on to the end of the match video.
Instead of getting crazy with sound or video recognition you could add in FRC or TBA API calls to get the match score, then generate a PNG or JPG image with all the info, then append that to the end of the match video as a still image slide for a few seconds.
This is a pretty great idea. The FRC API includes actual match start time in its Results endpoint (we’ll add it into TBA if this ever happens).
I bet you could manually sync the video with the actual times by entering them both for the first match, then have a script calculate the rest of match start times using the API, then cut out the next ~2:30.
This actually seems really feasible. If I get the chance today, I’ll try and integrate that into my python scripts