Author Topic: Removing unwanted snap videos  (Read 4829 times)

pressDUCK

  • Newbie
  • *
  • Posts: 5
    • View Profile
Removing unwanted snap videos
« on: May 29, 2017, 12:50:40 PM »
Thank you to the developers of Attract Mode, this is fucking awesome

Having downloaded complete video snap packs from sites such as http://emumovies.com/ and using the awesome tool https://www.waste.org/~winkles/ROMLister/ to cull mame roms down to a manageable level of non-clone, working games. I found I had way too many video snaps and looked for a method to cull the video files the same way that romlister removed the unwanted roms.  As there is only a 128gb card in my pi3, I felt the need to conserve space, and cause I want to create an image I could be proud of.
Below is the method I have been using to remove any videos which do not match rom names and hence will never be viewed.
This assumes the video snaps have, to the best of your knowledge, exactly the same name as the roms, or else they won't be played in AM anyways, and are all in .mp4 format
(Hint: if you couldn't get ffmpeg to compile like I couldn't (missing dependencies or something) and when video played back would go grey or other such nonsense, download this little gem https://www.winxdvd.com/hd-video-converter-deluxe/?cus-ins5.9.8 It is a demo version which will only convert 5 minutes of video, which is fine because the snaps generally around 30 seconds long and the batch conversion will let you do hundreds as a time.  What you want to do is set the video conversion up to convert all files to 30 frames a second, not the 60 that everyone thinks is so cool, they have issues on playback, select the files and click the little gear icon on one of the displayed vids)

But, I digress, anyways, I hope this method will help someone else.

This method also assumes your roms are on a folder on a Windows drive.  If you know the path to your retropie roms then you undoubtedly will be able to adjust the information below to suit your needs.
This can easily be adjusted for wheel files, flyers, what-have-you buy changing the extension in the CONCATENATE formula shown below.

We will be doing this with text files and a spreadsheet.

The videos will be copied into a folder called batchmove.  You need to create this folder on drive C:\ or else edit the formula, which is quite easy, just change C:\batchmove to which ever directory you want               
Step 1: Create a batch file to create a list of all the roms in a directory This is incredibly easy! Don't Panic!               
   To do this, create a new text file (right-click inside of the rom folder -- click new on the menu -- click Text Document            
   Open (double-click) the text file and when open copy and paste, or retype, the line below:            
   dir /b>"romlist.txt"            
   Now you will save this file as a .bat file. From the file menu in notepad, select "Save As..."             
   In  the save as dialog, under the file name, click the pull down menu "Save As Type:" and select All Files            
   Now, type in romlist.bat   This turns that text file with the single line dir /b>"romlist.txt" into a Windows Batch file which can be run            
Step 2: Run the romlist.bat file by double clicking on it or right clicking and selecting Open               
   There will now be a file called romlist.txt inside of the folder that you ran the batch file from            
Step 3: Open the romlist.txt file               
   You will find a list of all the files from the directory romlist.bat was ran from            
   If there are other files in the list that aren't roms, you can delete them from romlist.txt and resave it or just ignore them.            
Step 4:  Select and Copy of the lines of text in the romlist.txt file.  You can click and drag the mouse from the first letter to the last or press Ctrl+A and then right-click and select copy or press Ctrl+C               
Step 5: Paste the copied list into a spreadsheet such as https://docs.google.com/spreadsheets/u/0/   or Excel.  Left click in cell A1 and right click then paste or press Ctrl+v   
Step 6: Copy this formula from between the lines | =CONCATENATE("copy ",CHAR(34),(LEFT(A1, LEN(A1)-4)),".MP4",CHAR(34)," ",CHAR(34),"C:\batchmove",CHAR(34)) | and paste it through all of the cells in the colmum B far down as the rom names list extends. Don't copy the "|" lines, just what's in between            
   Right-click on cell B1 and hold the right mouse button and drag the mouse all the way down the column to where the romlist ends, release the right button and select press Ctrl+V or select paste. You may only be able to paste to the first cell in which case, copy the formula from cell B1, and drag-paste it down the cells.    
        All the cells pasted into will now have new text, from this text you will create another batch file.            
Step 7:Copy the new text and create a new .bat file called  copy.bat               
   Left-click (and hold) in the first cell which displays the "copy" line which was just created            
   Holding the left mouse button down, select (highlight) all of the new "copy" lines, all in the same column, you only want the line that starts with "copy"            
   Create and open a new text file in the folder where the videos are located            
   Paste the lines copied from the spreadsheet into the new text file            
   Save this file as copy.bat            
Step 7: Run the copy.bat file               
   When the file is ran a CMD window will popup which will copy each of the videos which have matching roms             
   This folder will be located at C:\batchmove unless you changed the formula
The batchmove folder will now contain only snaps which match your rom list            
« Last Edit: May 29, 2017, 12:53:17 PM by pressDUCK »

akafox

  • Hero Member
  • *****
  • Posts: 985
    • View Profile
Re: Removing unwanted snap videos
« Reply #1 on: May 29, 2017, 01:07:41 PM »
*claps loudly and pats you on the back*

good work! :)

I thought about writing a tut like you did..but my thought was "everyone's set up will be different". Well maybe for PC not so much the pi..but the method would be the same regardless..heh..duh  :-[

Thank you for your hard work. I do want to point out one thing (and maybe more when I can read through it.)

With my set up I have duplicates. That is to say I have a parent and one clone (US version). AM will use the same snap for parent or clone. To clean my list I just delete the parent off of my list. Now only the clone remains. I could combine the roms and I may do that eventually. Just seems easier to delete the parent from the list and be done with it.

This way all the files are needed to run...and "pac-man" shows up and not "puckman" or "galalga 3" shows up and not "Gaplus"..most people are farmilar with those names instead.
People want life easy..then complain about it