RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Take and Scrape Your Own Screenshots

    Scheduled Pinned Locked Moved Ideas and Development
    retroarchscreenshotscrapesselphruncommand
    122 Posts 8 Posters 66.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      gomisensei @meleu
      last edited by

      @meleu they're both the same problem, rather than find an existing entry, and add the image tag, it creates a whole new entry, (which is probably fine for console titles, but not Arcade). Still does it, but it works with the ~ dir now...

      I can probably rescrape after I get all the pics done, and my names/descs will be back.

      meleuM 1 Reply Last reply Reply Quote 0
      • meleuM
        meleu @gomisensei
        last edited by

        @gomisensei said in Take and Scrape Your Own Screenshots:

        I can probably rescrape after I get all the pics done, and my names/descs will be back.

        Please, keep in mind that the script doesn't mess with your original gamelist.xml. If you want to undo what the method 2 did, it's pretty easy. Look here:
        https://github.com/RetroPie/RetroPie-Setup/wiki/Take-and-Scrape-Your-Own-Screenshots#i-didnt-like-how-it-looks-i-want-my-old-images-back-and-disable-this-stuff

        • Useful topics
        • joystick-selection tool
        • rpie-art tool
        • achievements I made
        G 1 Reply Last reply Reply Quote 0
        • G
          gomisensei @meleu
          last edited by

          @meleu Yes, but if i scrape without downloading images, and point the scraper to my image dir, it will use the screenshots made with method2, and reset the other metadata.

          meleuM 2 Replies Last reply Reply Quote 0
          • meleuM
            meleu @gomisensei
            last edited by

            @gomisensei said in Take and Scrape Your Own Screenshots:

            @meleu Yes, but if i scrape without downloading images, and point the scraper to my image dir, it will use the screenshots made with method2, and reset the other metadata.

            I got it. You are right.
            The problem happens because my script "detects" if the game is present in the gamelist.xml trying to find the "<image>...</image>" entry for this game. And it's proven that it is not the best idea.
            I'll try to find another approach.

            • Useful topics
            • joystick-selection tool
            • rpie-art tool
            • achievements I made
            1 Reply Last reply Reply Quote 0
            • meleuM
              meleu @gomisensei
              last edited by

              @gomisensei
              I think I solved all the issues. Let's remember:

              • deal with tilde ~ in screenshot_directory.
              • do not use the rom name if it's an arcade game.
              • do not create duplicated gamelist.xml entries (actually this was solved as "do not detect games in gamelist looking for the <image> field").
                • if the game is present and has no <image> field, just create this field with the screenshot.

              And as an extra:

              • can start a gamelist.xml from scratch.

              Could you test it again?

              wget https://raw.githubusercontent.com/meleu/src/master/screeper.sh
              mv screeper.sh /opt/retropie/configs/all/runcommand-onend.sh
              

              Thanks again.

              • Useful topics
              • joystick-selection tool
              • rpie-art tool
              • achievements I made
              G 1 Reply Last reply Reply Quote 0
              • G
                gomisensei @meleu
                last edited by

                @meleu said in Take and Scrape Your Own Screenshots:

                I think I solved all the issues. Let's remember:

                Seems to work, just did a few quick test as i am about to sleep.

                Successfully adds image to entry with no image.

                Replaces existing image if a new one is found.

                Will test gamelist creation tmrw.

                Thanks for the work, appreciate it, this is a great tool for us folks who want our own screenshots without using a text editor.

                meleuM 1 Reply Last reply Reply Quote 1
                • meleuM
                  meleu @gomisensei
                  last edited by

                  @gomisensei
                  Your feedback was really important to these last fixes.

                  I enjoyed to code it. Improved my sed skills. :-)

                  I'm just having troubles to take screenshots of the arcade games main screen, because the hotkey is select and it also insert coins (easy to workaround remapping this function to another button). :-) Apart from that, everything seems to be fine.

                  • Useful topics
                  • joystick-selection tool
                  • rpie-art tool
                  • achievements I made
                  G 1 Reply Last reply Reply Quote 0
                  • G
                    gomisensei @meleu
                    last edited by

                    @meleu said in Take and Scrape Your Own Screenshots:

                    @gomisensei
                    Your feedback was really important to these last fixes.

                    I enjoyed to code it. Improved my sed skills. :-)

                    YW

                    I'm just having troubles to take screenshots of the arcade games main screen, because the hotkey is select and it also insert coins (easy to workaround remapping this function to another button). :-) Apart from that, everything seems to be fine.

                    I just hit menu key, then quick menu -> take screenshot for each one.

                    1 Reply Last reply Reply Quote 0
                    • meleuM
                      meleu
                      last edited by

                      Just sharing an info...
                      I have just noticed that when scraping screenshots with those methods, the runcommand launch menu art doesn't work.

                      I think it happens because runcommand searches for filenames ending with -image.{jpg,png}, as we can see here:

                              for path in "${image_paths[@]}"; do
                                  if [[ -f "$path/${rom_bn}-image.jpg" ]]; then
                                      image="$path/${rom_bn}-image.jpg"
                                      break
                                  elif [[ -f "$path/${rom_bn}-image.png" ]]; then
                                      image="$path/${rom_bn}-image.png"
                                      break
                                  fi
                              done
                      
                      • Useful topics
                      • joystick-selection tool
                      • rpie-art tool
                      • achievements I made
                      herb_fargusH 1 Reply Last reply Reply Quote 0
                      • herb_fargusH
                        herb_fargus administrators @meleu
                        last edited by

                        @meleu simple enough to either add an on start function to look for non -images or a different function to batch append -image to all jpg and png files.

                        If you read the documentation it will answer 99% of your questions: https://retropie.org.uk/docs/

                        Also if you want a solution to your problems read this first: https://retropie.org.uk/forum/topic/3/read-this-first

                        meleuM 1 Reply Last reply Reply Quote 0
                        • meleuM
                          meleu @herb_fargus
                          last edited by

                          @herb_fargus
                          The renaming process needs to occurs before the gamelist.xml manipulation in both methods. If it occurs after, the ES will look for the filename in the <image> field and won't find the file.

                          It would be simple in method 2, because it already uses a runcommand-onend.sh script. But method 1 would need a runcommand-onend.sh just for this task.

                          For now I will just add a warning in the wiki talking about this issue...

                          • Useful topics
                          • joystick-selection tool
                          • rpie-art tool
                          • achievements I made
                          1 Reply Last reply Reply Quote 0
                          • C
                            Chameleon
                            last edited by Chameleon

                            @meleu

                            I followed the wiki but found out that Retroarch was overwriting the changes your runcommand-onend.sh script was making.

                            Turns out, "Save Meta Data On Exit" was enabled by default under "Main Menu>Other Settings". Once I disabled this everything worked beautifully.

                            I think it would be helpful if the wiki is updated to reflect/mention checking this.

                            Thanks for the great work on the script!

                            PS: I'm on RetroPie 4.0.

                            edit: words

                            meleuM 2 Replies Last reply Reply Quote 0
                            • meleuM
                              meleu @Chameleon
                              last edited by meleu

                              @Chameleon The "save metadata on exit" has nothing to do with RetroArch. It's an emulationstation feature. Anyway, I can't reproduce your issue here.

                              I turned on the "save metadata on exit", played some games that has screenshots as emulationstation image, exited emulationstation (to get metadata updated), came back to emulationstation and the screenshots still there.

                              Can you describe what exactly happened to you?

                              • Useful topics
                              • joystick-selection tool
                              • rpie-art tool
                              • achievements I made
                              C 1 Reply Last reply Reply Quote 0
                              • C
                                Chameleon @meleu
                                last edited by

                                @meleu

                                I was trying to capture screenshots for arcade roms that didn't have an existing image (ie: no existing <image> tags in the gamelist.xml).

                                After capturing an in game screenshot, a file would be saved to my custom screenshot directory with the rom as the name of the file (as expected).

                                The emu/system level gamelist.xml showed that your script added the <image> tag details (as expected).

                                Once I restarted emulationstation (via the menu), I noticed the emu/system level gamelist.xml has been overwritten with the original contents (ie: <Image> tag details are removed).

                                Further testing concluded that what ever was in memory was most likely being written back into the gamelist.xml file upon emulationstation restart; hence the <image> tag removal.

                                I then turned off "Save MetaData On Exit" and the gamelist.xml file was no longer being overwritten upon emulationstation restart.

                                Side note: trying to capture screenshots with lr-mame2003 produces no images in my custom folder, but it works fine for fba-next and lr-mame4all.

                                1 Reply Last reply Reply Quote 1
                                • meleuM
                                  meleu @Chameleon
                                  last edited by meleu

                                  @Chameleon Oh! I reproduced here. I took a screenshot for a game that didn't have an screenshot as emulationstation image, the script updated the gamelist.xml, and when I exited emulationstation the updated entry was gone.

                                  Thanks for the feedback. I'll update the wiki.
                                  [edit: wiki page updated]

                                  • Useful topics
                                  • joystick-selection tool
                                  • rpie-art tool
                                  • achievements I made
                                  1 Reply Last reply Reply Quote 0
                                  • C
                                    Chameleon
                                    last edited by Chameleon

                                    >Side note: trying to capture screenshots with lr-mame2003 produces no images in my custom folder, but it works fine for fba-next and lr-mame4all.

                                    Further investigation reveals that lr-mame2003 is saving screenshots to:

                                    /home/pi/.config/retroarch/screenshots

                                    With filenames like: RetroArch-0530-043358.png

                                    I assume that is the typical default filename with datetime stamp as suffix. Viewing the png files reveals direct matches to the screenshots I took in game.

                                    Is there a way to inform lr-mame2003 to use the my custom screenshot_directory as defined in the retroarch.cfg file?

                                    Not sure why lr-mame2003 isnt following the convention.

                                    Edit: my retropie datetime stamp is currently set to May 30 just in case the above filename causes confusion lol.

                                    Edit: spelling

                                    meleuM 1 Reply Last reply Reply Quote 0
                                    • meleuM
                                      meleu @Chameleon
                                      last edited by

                                      @Chameleon it seems that it is ignoring auto_screenshot_filename AND screenshot_directory. Can you check if its respective retroarch.cfg #includes the global one?

                                      • Useful topics
                                      • joystick-selection tool
                                      • rpie-art tool
                                      • achievements I made
                                      C 1 Reply Last reply Reply Quote 0
                                      • C
                                        Chameleon @meleu
                                        last edited by

                                        @meleu said in Take and Scrape Your Own Screenshots:

                                        @Chameleon it seems that it is ignoring auto_screenshot_filename AND screenshot_directory. Can you check if its respective retroarch.cfg #includes the global one?

                                        You are totally correct. I overwrote my mame-libretro \ retroarch.cfg awhile back and hence the #include "/opt/retropie/configs/all/retroarch.cfg" line was missing as the last line of the file - my bad.

                                        Putting the #include line back in fixed it for me.

                                        Thanks a lot!

                                        1 Reply Last reply Reply Quote 0
                                        • C
                                          CoolCat
                                          last edited by

                                          what would be the easiest way of have screenshots instead of art?
                                          i like the idea of take our own screenshot, but sometimes scrapper is handy.
                                          best wishes,

                                          meleuM 1 Reply Last reply Reply Quote 0
                                          • meleuM
                                            meleu @CoolCat
                                            last edited by

                                            @CoolCat said in Take and Scrape Your Own Screenshots:

                                            what would be the easiest way of have screenshots instead of art?

                                            My opinion:

                                            1. Use the runcommand-onstart.sh from method 1 (this will set the needed configs in retroarch.cfg files).
                                            2. Use the runcommand-onend.sh from method 2 (this will fill the gamelist.xml with the path to the screenshot files).
                                            3. Turn off "save metadata on exit" in emulationstation.
                                            4. Take screenshots of your games.

                                            i like the idea of take our own screenshot, but sometimes scrapper is handy.

                                            Uh... I think it was a little contradictory... :-)
                                            If you scrape your roms first of all, and then do what I described above, you'll get what I think you want.

                                            • Useful topics
                                            • joystick-selection tool
                                            • rpie-art tool
                                            • achievements I made
                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.