Phantom Posted May 22, 2009 Share Posted May 22, 2009 I started making some video snaps of my Karaoke songs for KaraFun. I wanted to be able to preview the highlighted song so video quality isn't really important. Well after doing a few with the built in CREATE SNAP option in Game Ex, I find out it doesn't record the sound. Is there anyway to have it record sound when making the video snaps? Ideally I just need it to play the song, but there are too many mixes of file types (mp3, kar, kfn, mid...) so I'd be happy with just a video preview playing.Thanks(Sorry For the double post... got click happy) Link to comment Share on other sites More sharing options...
Stu1983 Posted May 22, 2009 Share Posted May 22, 2009 I've never had much luck with the create snaps or videos option in GameEx but I've been having pretty good success with FRAPS, it let's you assign a record key on your keyboard to start and stop recording.I also wrote a pluggin for GameEx that will automatically rename the FRAPS recording to be the same as the rom you where playing in GameExStu Link to comment Share on other sites More sharing options...
Phantom Posted May 27, 2009 Author Share Posted May 27, 2009 I've never had much luck with the create snaps or videos option in GameEx but I've been having pretty good success with FRAPS, it let's you assign a record key on your keyboard to start and stop recording.I also wrote a pluggin for GameEx that will automatically rename the FRAPS recording to be the same as the rom you where playing in GameExStuIs there a particular reason why GameEx doesn't record sound when making snapshot videos? How do all the videos from EmuMovies get made with sound? I'll look into FRAPS I guess. Maybe try to make some kind of AHK Script that will load the songs one at a time for a few seconds then trigger FRAPS and then use your Plugin to name them... (I'm already over my head just writing that) My Create Snaps seems to always work in GameEX just wish I knew a switch to turn on sound Link to comment Share on other sites More sharing options...
Phantom Posted May 28, 2009 Author Share Posted May 28, 2009 Is there a particular reason why GameEx doesn't record sound when making snapshot videos? How do all the videos from EmuMovies get made with sound? I'll look into FRAPS I guess. Maybe try to make some kind of AHK Script that will load the songs one at a time for a few seconds then trigger FRAPS and then use your Plugin to name them... (I'm already over my head just writing that) My Create Snaps seems to always work in GameEX just wish I knew a switch to turn on sound Just had a lil brain fart...Would it be possible to use the built in GameEx snap feature to grab a picture snapshot every say 20-30 seconds, (pictures cause they take up less space) but meanwhile have the plugin and fraps running to record video and sound during those 20-30 seconds? And could the plugin run and trigger the recording of the video every 20 seconds or so... does that make sense? I just don't want to sit there for hours hitting F9 like and episode of LOST...Thanks Link to comment Share on other sites More sharing options...
bkenobi Posted May 28, 2009 Share Posted May 28, 2009 If you are asking if the current plugin can do all that...well, no. Is it possible for a plugin to be written to do that...yes. But, in order for it to come to life, either you or some other interested person would have to write it. Link to comment Share on other sites More sharing options...
Phantom Posted May 28, 2009 Author Share Posted May 28, 2009 If you are asking if the current plugin can do all that...well, no. Is it possible for a plugin to be written to do that...yes. But, in order for it to come to life, either you or some other interested person would have to write it.Considering I've been trying to make an AHK script to just send the capture keys to record then stop recording after 20 seconds and then start again while gameex cycles through the game list for the passed day without success I think my programming skills are pretty much tapped out. Thanks for the help Link to comment Share on other sites More sharing options...
bkenobi Posted May 29, 2009 Share Posted May 29, 2009 Well, it is possible to do some of this kind of stuff with AHK, but since there's not going to be much feedback for the script to go on, it's not likely to work 100% on it's own and get things 100% right. It would be better to do this with a GameEx plugin, but again, that requires someone to write it.Just a hint though, there are a few AHK scripts that do send inputs to GameEx successfully, so if you aren't getting any response from the sent keys, try reviewing one of those scripts. Link to comment Share on other sites More sharing options...
Phantom Posted May 29, 2009 Author Share Posted May 29, 2009 Well, it is possible to do some of this kind of stuff with AHK, but since there's not going to be much feedback for the script to go on, it's not likely to work 100% on it's own and get things 100% right. It would be better to do this with a GameEx plugin, but again, that requires someone to write it.Just a hint though, there are a few AHK scripts that do send inputs to GameEx successfully, so if you aren't getting any response from the sent keys, try reviewing one of those scripts.Sorry to be a pest about this.I'm not capable of making or editing a plugin so AHK is as far as I can go, and at this point this is the toughest script I've had to make for my cab. I've been messing with some different scripts but can't seem to get it to work.I have figured out the problem I think. When I select Create Snaps from inside GameEx it just seems to switch songs and not close or kill the Karaoke program (KaraFun) So no matter how I tell the script to send the capture key to stop recording it just doesn't work. I can get it to Start recording but stopping and then restarting at the next song is the problem.The only solution I have found is using the AHK WINDOW SPY I can see that the Window Title changes to the file name. The Class stays the same. SooooooAnyone know how I I can get the script to press F9 to start Fraps to record and then stop and then restart once the Window Name changes?I'm using Stu's KaraFun Loader he made a while back, so I would like to alter it to do this job and then resort back to the original loader when I actually play.Again sorry for being a PITA... having a party this week end so I just wanted to get this working before then.Thanks guys..This is the original Loader used to get KaraFun to start fullscreen, with the game always on top and remapped keys.; <COMPILER: v1.0.47.5>SetTitleMatchMode 3CoordMode, Mouse, ScreenGroupAdd Display, KaraFun3GroupAdd Display, ahk_class TKFNViewFrmrun KaraFun.exe "%1%"WinWaitActive, ahk_group Display#Persistent SetTimer, Clicker, 2000lctrl::rdown::xup::g5::spaceescape::!xreturnClicker: SetTimer, Clicker, Off winHide, ahk_class TPlayFrm WinWaitClose, ahk_group Display WinShow, ahk_class TPlayFrm WinClose, ahk_class TPlayFrm run pskill.exe KaraFun.exe ExitApp Link to comment Share on other sites More sharing options...
bkenobi Posted May 29, 2009 Share Posted May 29, 2009 Sending the F9 button is easySend {F9}Determining if the window title has changed requires a timer and comparing the titles. As long as you are just concerned with the active window, that isn't too difficult either. Here's an example that's not very advanced, but it should help...I think.#persistentSetTimer, WatchTitle, 5000WinGetTitle, Title, AWatchTitle:WinGetTitle, TitleNew, AIf Title <> %TitleNew%{ msgbox %Title% is now %TitleNew% Title = %TitleNew%}else{ msgbox %Title% hasn't changed}return Link to comment Share on other sites More sharing options...
Tempest Posted June 6, 2009 Share Posted June 6, 2009 Phantom,Here's what I came up with: #SingleInstance ForceSongLocation := "C:\Program Files\KaraFun\Songs"Extension := ".kfn"Recurse = 1KeyToSend := "{F9}"StartDelay = 1000RecordTime = 10000TempFolder := "C:\Program Files\Fraps\Temp"VideoFolder := "C:\Program Files\Fraps\Videos"FileDelete, %TempFolder%\*.aviLoop, %SongLocation%\*%Extension%, 0, %Recurse%{StringTrimRight, FileName, A_LoopFileName, 4IfNotExist, %VideoFolder%\%FileName%.avi{Run, %A_LoopFileLongPath%WinWait, ahk_class TKFNViewFrm.UnicodeClassWinActivate, ahk_class TKFNViewFrm.UnicodeClassSleep, %StartDelay%Send %KeyToSend%Record := !RecordSleep, %RecordTime%Send %KeyToSend%WinClose, ahk_class TKFNViewFrm.UnicodeClass FileMove, %TempFolder%\*.avi, %VideoFolder%\%FileName%.avi, 1Sleep, 2000}}ExitApp^Q::If Record = 1Send %KeyToSend%WinClose, ahk_class TKFNViewFrm.UnicodeClassExitAppI'll post it again with comments, use the code from the first window: #SingleInstance ForceSongLocation := "C:\Program Files\KaraFun\Songs"; Location of your song filesExtension := ".kfn";Extension of your song filesRecurse = 1;This will recurse into subfolders, if you don't want subfolders recursed set this to 0 (Zero)KeyToSend := "{F9}";Key to start recording in Fraps. F9 is defaultStartDelay = 1000; Time to wait before starting recording in milliseconds (1000 milliseconds = 1 second)RecordTime = 10000; How long to make each recordingTempFolder := "C:\Program Files\Fraps\Temp"; Temporary folder for recordings (See Fraps snapshot)VideoFolder := "C:\Program Files\Fraps\Videos"; Folder to put recordings intoLoop, %SongLocation%\*%Extension%, 0, %Recurse%;Loop Songfolder{StringTrimRight, FileName, A_LoopFileName, 4;Get the name of current file, without extensionIfNotExist, %VideoFolder%\%FileName%.avi; No video exists, Let's make one{Run, %A_LoopFileLongPath%;Run the songWinWait, ahk_class TKFNViewFrm.UnicodeClass;Wait for the Karafun window to existWinActivate, ahk_class TKFNViewFrm.UnicodeClass; Make Karafun activeSleep, %StartDelay%; Pause before starting recording (Adjustable time in variable above)Send %KeyToSend%; Send key to Fraps (Adjustable in variable above)Record := !Record; Are we recording, or not?Sleep, %RecordTime%; Number of seconds to record (Adjustable time in variable above)Send %KeyToSend%;Send key to Fraps WinClose, ahk_class TKFNViewFrm.UnicodeClass ;Close Karafun WindowFileMove, TempFolder\*.avi, %VideoFolder%\%FileName%.avi, 1;Rename video to current filename, and move to video folderSleep, 2000; Wait 2 seconds (I added this because there was a problem with the next Karafun window not showing without the wait)}}ExitApp^Q::If Record = 1; If we recording...Send %KeyToSend%; Stop recordingWinClose, ahk_class TKFNViewFrm.UnicodeClass; Close KarafunExitAppYou will need to creat a temporary folder for fraps to store the video in. All .avi files in this folder will be deleted when you start the script. Point Fraps to the temporary folder.Set the "Video Capture Hot Key" to match the "KeyToSend" Variable above.Put a tick in the box for "No Cursor"Also set any other options that you want... Leave Fraps running in the background.Run Karafun, and right clik on the KaraFun Window to bring up a menu.Select "options"Under the "General" tab, make sure your karafun files are associated with Karafun. (If you double click on a song, and karafun starts, the associations are correct.Under the "Display" tab, you can set Karafun to run fullscreen at startup, and other options.Close Karafun.You will need to download and install AutoHotKey.Copy and paste the text in the first codebox into notepad.Adjust any of the variables (Paths, record time, etc.) as described in the second codebox.Save as KarafunVideos.ahkDouble click on KarafunVideos.ahk to run the script.You can use {Ctrl} Q to exit the program. I recommend doing a couple of videos, and checking to see if you are satisfied with the results. You may need to adjust some of the timing variables.The script checks to see if there is an existing video for each song, so if you want to re-do a video, delete the existing one.If you have any problems, let me know... If everything goes well, I want to know that too! Link to comment Share on other sites More sharing options...
Phantom Posted June 7, 2009 Author Share Posted June 7, 2009 Hey Tempest,I tried out the script and it wants to run but the problem is that my songs are zipped up. Karafun can read songs inside the zip and I tried changing the extension in your script to .zip and set windows to use Karafun as the default zip program (thought it would be easier) but it doesn't work.I don't mind extracting all the songs and then extracting them once the snaps are done if that makes your life easier. But if thats the case can I add more than one extention to your script since there are multiple file types Karafun uses? (can I just seperate them with a semi colon? .kfn;.cdg;kok....)Or maybe if the script has the actual path to start Karafun (E:\Karoake\Karafun\Karafun.exe) so it can use the zipped files?Just a thought.Thanks Link to comment Share on other sites More sharing options...
Phantom Posted June 7, 2009 Author Share Posted June 7, 2009 Hey Tempest,I tried out the script and it wants to run but the problem is that my songs are zipped up. Karafun can read songs inside the zip and I tried changing the extension in your script to .zip and set windows to use Karafun as the default zip program (thought it would be easier) but it doesn't work.I don't mind extracting all the songs and then extracting them once the snaps are done if that makes your life easier. But if thats the case can I add more than one extention to your script since there are multiple file types Karafun uses? (can I just seperate them with a semi colon? .kfn;.cdg;kok....)Or maybe if the script has the actual path to start Karafun (E:\Karoake\Karafun\Karafun.exe) so it can use the zipped files?Just a thought.ThanksSo I was playing around some more with this... I unzipped all my songs into separate folders since your script scans subfolders. I tried editing the script to do more file types but it doesn't work with a semicolon or a coma. Right now I'm doing one file type at a time and its WORKING!Just a few things I notice... In KARAFUN, you can NOT have the START FULLSCREEN option enabled. It has to be a window, but thats fine cause somehow FRAPS captures only the window and nothing else.Also in your original post you have an extra line in the top codeFileDelete, %TempFolder%\*.aviI took that out and its working fine... not sure if I should have done that but with that in there, the files weren't being renamed and moved... they just disappeared.So right now it would just be great to have multiple filetypes, I'm not too worried about the zip support cause the size difference isn't that great and once the scanning is done, i can just rezip the folders.But if the script stays as it is right now, its totally usable. Link to comment Share on other sites More sharing options...
Tempest Posted June 7, 2009 Share Posted June 7, 2009 So I was playing around some more with this... I unzipped all my songs into separate folders since your script scans subfolders. I tried editing the script to do more file types but it doesn't work with a semicolon or a coma. Right now I'm doing one file type at a time and its WORKING!Just a few things I notice... In KARAFUN, you can NOT have the START FULLSCREEN option enabled. It has to be a window, but thats fine cause somehow FRAPS captures only the window and nothing else.Also in your original post you have an extra line in the top codeFileDelete, %TempFolder%\*.aviI took that out and its working fine... not sure if I should have done that but with that in there, the files weren't being renamed and moved... they just disappeared.I was changing the code as I posted (As I was typing, ideas kept coming to me) so I had a few untested lines in there...The important thing is that the TempFolder is empty on startup so that the script is moving, and renaming the correct file.Looking at the code, it seems correct though...So right now it would just be great to have multiple filetypes, I'm not too worried about the zip support cause the size difference isn't that great and once the scanning is done, i can just rezip the folders.But if the script stays as it is right now, its totally usable.You can have it do all extensions by changing this line:Loop, %SongLocation%\*%Extension%, 0, %Recurse%to:Loop, %SongLocation%\*.*, 0, %Recurse%Just make sure that only songs are in the folder, I don't know what would happen if you tried to make a video from a .txt file!Glad to hear that it is working for you! Link to comment Share on other sites More sharing options...
Phantom Posted June 7, 2009 Author Share Posted June 7, 2009 I was changing the code as I posted (As I was typing, ideas kept coming to me) so I had a few untested lines in there...The important thing is that the TempFolder is empty on startup so that the script is moving, and renaming the correct file.Looking at the code, it seems correct though...You can have it do all extensions by changing this line:Loop, %SongLocation%\*%Extension%, 0, %Recurse%to:Loop, %SongLocation%\*.*, 0, %Recurse%Just make sure that only songs are in the folder, I don't know what would happen if you tried to make a video from a .txt file!Glad to hear that it is working for you! I can't scan the folder for everything cause some songs have an mp3 that goes with a CDG file so I can't have it making a snap for the mp3 aswell as the cdg. I'll just do it one file type at a time, its no biggy.Thanks for all the help Matt, I really appreciate it. If you lived in Toronto I'd buy you a beer... ThanksNelson Link to comment Share on other sites More sharing options...
Tempest Posted June 7, 2009 Share Posted June 7, 2009 This one should handle multiple extensions.Also, the FileDelete, %TempFolder%\*.avi should be correct. Do you have two seperate folders, one for TempFolder, and a second one for VideoFolder? #SingleInstance ForceSongLocation := "C:\Program Files\KaraFun\Songs"Extension := ".kfn;.cdg;.kok"Recurse = 1KeyToSend := "{F9}"StartDelay = 1000RecordTime = 10000TempFolder := "C:\Program Files\Fraps\Temp"VideoFolder := "C:\Program Files\Fraps\Videos"StringSplit, Extension, Extension, `;FileDelete, %TempFolder%\*.aviLoop, %Extension0%{ Extension := Extension%A_Index% Loop, %SongLocation%\*%Extension%, 0, %Recurse% { StringTrimRight, FileName, A_LoopFileName, 4 IfNotExist, %VideoFolder%\%FileName%.avi { Run, %A_LoopFileLongPath% WinWait, ahk_class TKFNViewFrm.UnicodeClass WinActivate, ahk_class TKFNViewFrm.UnicodeClass Sleep, %StartDelay% Send %KeyToSend% Record := !Record Sleep, %RecordTime% Send %KeyToSend% WinClose, A FileMove, %TempFolder%\*.avi, %VideoFolder%\%FileName%.avi, 1 Sleep, 2000 } }}ExitApp^Q::If Record = 1 Send %KeyToSend%WinClose, ahk_class TKFNViewFrm.UnicodeClassExitAppDon't forget to change the variables to match the ones you have now. Link to comment Share on other sites More sharing options...
Tempest Posted June 7, 2009 Share Posted June 7, 2009 I have two folders of songs for Karafun. In one folder the songs are titled:Artist - Title of song.karWhile in the other folder, the songs are titled:Title of Song - artist.karIf you run this script it will reverse the names on either side of the -, so:Title of Song - artist.karbecomes:Artist - Title of song.karand vice-Versa.This is not helpful if all of your songs are in one directory...#SingleInstance ForceDir := "C:\Program Files\KaraFun\Songs\"Loop, %Dir%*.*{ SplitPath, A_LoopFileName,,, Extension, FileName StringSplit, TempVar, FileName, -, %A_Space% FileName := Dir . TempVar2 . " - " . TempVar1 . "." . Extension FileMove, %A_LoopFileLongPath%, %FileName%}Change the Variable "Dir" to the folder that contain the files that you want renamed.Please Backup your files first! Link to comment Share on other sites More sharing options...
Phantom Posted June 11, 2009 Author Share Posted June 11, 2009 FINALLY!Its done!I let your script run unattended for about 3 days (except for the odd song that was corrupt but that actually helped me filter out the garbage) and it worked perfectly. You really helped to add a "uniqueness" to my cab so thanks for that. I had to run all the video captures through an encoder afterwords cause once I was done capturing all 2980 songs, I had 80 gigs of video snaps, but once they were re-encoded it was down to 2 gigs.I've uploaded a little video so Tempest can see the outcome as well as maybe tease you others to do the same. My tip to anyone that does decide to do this is to really pay attention to the naming of the songs before the video capturing cause its such a headache to have to rename so many files to match each other. So really get the file naming down before you start. ( I used "Artist @ Song.zip" so its easier to make a mdb database or map file)Thanks again Tempest and everyone that helped with this one. Sorry for the quick jumping around between songs... trying to avoid youtube's copyright policy Link to comment Share on other sites More sharing options...
Tempest Posted June 11, 2009 Share Posted June 11, 2009 FINALLY!Its done!I let your script run unattended for about 3 days (except for the odd song that was corrupt but that actually helped me filter out the garbage) and it worked perfectly. You really helped to add a "uniqueness" to my cab so thanks for that. I had to run all the video captures through an encoder afterwords cause once I was done capturing all 2980 songs, I had 80 gigs of video snaps, but once they were re-encoded it was down to 2 gigs.I've uploaded a little video so Tempest can see the outcome as well as maybe tease you others to do the same. My tip to anyone that does decide to do this is to really pay attention to the naming of the songs before the video capturing cause its such a headache to have to rename so many files to match each other. So really get the file naming down before you start. ( I used "Artist @ Song.zip" so its easier to make a mdb database or map file)Thanks again Tempest and everyone that helped with this one.Your Welcome! (And I do have you on my list for a beer if I'm ever in Toronto )I have been working on the renamer script. I scraped 3 websites, and have a list of over 16000 artists. Out of the 250 songs that I have, I was able to rename 207 correctly. Most of the 43 that aren't renamed are mispelled, so I am working on Fuzzy Matching for the rest. It would also help if I could add artists to the database. I tried googling "Artist @ Song.zip", but I did not come up with anything useful. Could you clarify - What is (where I could find) Artist @ Song.zip? Link to comment Share on other sites More sharing options...
Phantom Posted June 11, 2009 Author Share Posted June 11, 2009 Your Welcome! (And I do have you on my list for a beer if I'm ever in Toronto )I have been working on the renamer script. I scraped 3 websites, and have a list of over 16000 artists. Out of the 250 songs that I have, I was able to rename 207 correctly. Most of the 43 that aren't renamed are mispelled, so I am working on Fuzzy Matching for the rest. It would also help if I could add artists to the database. I tried googling "Artist @ Song.zip", but I did not come up with anything useful. Could you clarify - What is (where I could find) Artist @ Song.zip?Should have clarified Artist @ Title.zip more... Its just the way I named MY collection... it was a naming suggestion.I'll add my Database in case you can do something with it. Maybe get more names for you scraper. (Don't pay attention to the frenchy music... )As a side note, is there anyway to change the names at the top of GameEx... like Manufacturer to Artist?Songlist.zip Link to comment Share on other sites More sharing options...
Recommended Posts