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

    TUTORIAL: HOW TO SAVE 75% OF THE SPACE WITH VIDEOS.

    Scheduled Pinned Locked Moved Ideas and Development
    videosscrape retropiescraperscrapescrape data
    13 Posts 4 Posters 1.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.
    • ANDRELLVSA
      ANDRELLVS
      last edited by ANDRELLVS

      0_1542836369681_Sem título.png
      ILLUSTRATIVE IMAGE SHOWN TO BINDER CONTAINING THE FILES NECESSARY. BEING THE .BAT FILE CAN HAVE ANY NAME

      0_1542836712588_Sem título.png
      PRINT OF THE CODE USED BY ME

      HOW TO SAVE 75% WITH VIDEOS

      OBS: Greetings to all! I am from Brazil and I have been following this forum for about 3 years, and always wanted to contribute something important, as a way of thanking everyone for the knowledge I received! So let's go!

      NOTE FOR UNDERSTANDING: Each video has about 30 seconds, some even more. With this tutorial you shorten their size to 7 seconds only.

      BUT WHAT IS THE ADVANTAGE OF THE METHOD? The advantage is to CUT more than 1,000 videos ONCE, making them all the same size!

      WHY ARE THE VIDEOS NOT REPROCESSED? Yes they are! but it is so fast the process, which becomes advantageous for those who like me have more than 20,000 videos of roms, because it saves time.


      REQUIRED:

        • PC WITH WINDOWS
        • FFMPEG - LINK: "https://ffmpeg.zeranoe.com/builds/ "

      1. After downloading the FFMPEG, unzip and go to the folder:
        ffmpeg \ bin
        In this folder there will be only 3 executables: ffplay, ffprobe, ffmpeg

      1. Within this folder you create a text file (any name) and the extension ".BAT"

      1. In this file you type the following:

      for %%a in ("* .mp4") do ffmpeg -i "%% a" -ss 00:00:00 -t 00:00:07 -async 1 -strict -2 "newfiles %% ~ na.mp4 "

      1. Create a folder called: newfiles

      1. Place the videos you want to cut inside this bin folder, along with your ".bat" file, and the 3 executables, all together! Then you execute the BAT, and go in the folder NEWFILES search the new videos, already in reduced size!

      1. FINAL OBS: "-t 00:00:07", is the new duration time. You can edit this for as much as you want!
      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by mitu

        N.B. You should surround the script's contents with code tags ( ```) so they're more easily readable. Like this

        for %% a in ("* .mp4") of ffmpeg -i "%% a" -ss 00:00:00 -t 00:00:07 -async 1 -strict -2 "newfiles \ %% ~ na. mp4 "
        

        Thank you for the hint, but can you explain how/why does this reduce the size of the videos ? From what I see, it just cuts the video to the first 7 seconds without doing any processing on the video itself.

        ClydeC ANDRELLVSA 2 Replies Last reply Reply Quote 0
        • ClydeC
          Clyde @mitu
          last edited by

          @mitu said in TUTORIAL: HOW TO SAVE 75% OF THE SPACE WITH VIDEOS.:

          Thank you for the hint, but can you explain how/why does this reduce the size of the videos ? From what I see, it just cuts the video to the first 7 seconds without doing any processing on the video itself.

          That, and it only saves approx. 75% of the space if the video is 28 seconds long.

          @ANDRELLVS Is that your point or how did you calculate the 75%?

          Although this saves space, it does so at the video's expense, which most people may not want. It's a bit like saying that deleting the videos will save 100% of the space.

          That said, I think it is a nice instruction how to cut videos in a given directory with a single line of commands. You may want to emphasize this in your title instead of saving space.

          1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator
            last edited by

            I tried to follow the instructions, but the .bat file does not work, I get an error when trying to run it

            C:\Users\itsmemitu\Desktop\video\conv.bat
            
            % was unexpected at this time.
            
            synackS ANDRELLVSA 2 Replies Last reply Reply Quote 0
            • synackS
              synack @mitu
              last edited by synack

              @mitu proper syntax below (not that I recommend it)

              for %%a in ("*.mp4") do ffmpeg -i "%%a" -ss 00:00:00 -t 00:00:07 -async 1 -strict -2 "newfiles\%%~na.mp4"
              
              1 Reply Last reply Reply Quote 1
              • ANDRELLVSA
                ANDRELLVS @mitu
                last edited by

                @mitu WHY ARE THE VIDEOS NOT REPROCESSED? Yes they are! but it is so fast the process, which becomes advantageous for those who like me have more than 20,000 videos of roms, because it saves time.

                mituM 1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator @ANDRELLVS
                  last edited by

                  @ANDRELLVS You have no idea what you're talking about, do you ?

                  1 Reply Last reply Reply Quote 1
                  • ANDRELLVSA
                    ANDRELLVS @mitu
                    last edited by

                    @mitu I imagine you did not create the NEWFILES folder, or typed %% too much in the code. If not, then try downloading the latest FFMPEG.

                    mituM 1 Reply Last reply Reply Quote 0
                    • mituM
                      mitu Global Moderator @ANDRELLVS
                      last edited by

                      @ANDRELLVS I actually did and tried that command, which did no work, as I said.
                      Using @synack's correction, I've run the command and noticed exactly what I suspected from your description - the command just gets only the starting 7 seconds of the video. How do you 'save space' if your video is practically missing ? As @Clyde said, you can save 100% space by deleting them - and that doesn't need a tutorial.

                      ANDRELLVSA 1 Reply Last reply Reply Quote 0
                      • ANDRELLVSA
                        ANDRELLVS @mitu
                        last edited by

                        @mitu
                        Well, I posted prints of the command, how the folder looks, everything I did, and I explained in detail. Deleting videos saves space yes! But the intention is to keep the videos with less space. Any questions, I'll try to help. I can not respond at all times, because the forum limits me a number of answers that I can give every half hour.

                        ClydeC 1 Reply Last reply Reply Quote 0
                        • ClydeC
                          Clyde @ANDRELLVS
                          last edited by Clyde

                          @ANDRELLVS said in TUTORIAL: HOW TO SAVE 75% OF THE SPACE WITH VIDEOS.:

                          @mitu
                          Deleting videos saves space yes! But the intention is to keep the videos with less space.

                          Your method also deletes a large part of most preview videos, which tend to be 20-40 seconds long, and keeps only a fraction of their content. The rest is just gone.

                          That said, you changed your guide so that it now explains that the videos will be cut to 7 seconds. That's good, though I still think the title is a bit misleading.

                          You could also change your guide away from those 7 seconds, but instead just explain how to cut videos to any length the user might want. It would be more universal that way.

                          @ANDRELLVS said in TUTORIAL: HOW TO SAVE 75% OF THE SPACE WITH VIDEOS.:

                          @mitu
                          Any questions, I'll try to help. I can not respond at all times, because the forum limits me a number of answers that I can give every half hour.

                          No hurry, I can only check the forum once or twice a day anyway. :) Care to answer my question from before how you calculated the 75% in this thread's title? I'm asking because this only applies to videos of 28 seconds, but the title sounds like it's a general gain.

                          edit: typos corrected.

                          1 Reply Last reply Reply Quote 1
                          • ANDRELLVSA
                            ANDRELLVS
                            last edited by

                            Guys, my code had an error in the end, a symbol that typed wrong that I am putting there in quotes. It was removed and the tutorial was corrected, to agree with the PRINT that I took from the code I use: ")".

                            For those who do not understand, this method really cuts between 20 to 30 seconds of videos that give almost 40 seconds. This is a waste. But, as I said, you can cut much less than that, just change to your own taste. in the part that says:

                            "-t 00:00:07"

                            You can define how many seconds of video you want, and in the above case I left only 7. You can use 10, 20, 30, etc ...

                            ClydeC 1 Reply Last reply Reply Quote 0
                            • ClydeC
                              Clyde @ANDRELLVS
                              last edited by

                              @ANDRELLVS Thanks for adding an explanation to your tutorial about what the batch file actually does.

                              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.