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

    [SCRIPT] RetroPie Convert Videos

    Scheduled Pinned Locked Moved Projects and Themes
    conversionomxscriptvideoyuv
    133 Posts 29 Posters 34.2k 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.
    • D
      Duel
      last edited by

      1st of all great script. I converted all my videos with no problems. Question though, I'm getting an error when rebooting RetroPie. Illegal-Mpeg-Header . Here's a picture of the error code. https://www.dropbox.com/s/whgj075huoke8u6/img_20211201_075232.jpg?dl=0. Can you tell me what this means and how to fix it?

      D 1 Reply Last reply Reply Quote 0
      • D
        Duel @Duel
        last edited by

        @duel said in [SCRIPT] RetroPie Convert Videos:

        1st of all great script. I converted all my videos with no problems. Question though, I'm getting an error when rebooting RetroPie. Illegal-Mpeg-Header . Here's a picture of the error code. https://www.dropbox.com/s/whgj075huoke8u6/img_20211201_075232.jpg?dl=0. Can you tell me what this means and how to fix it?

        Nevermind on this error. I've rebooted instead of restarting emulation station and the error went away. Thank you for this script. I've looked everywhere to find a fix for video snaps for MAME to play properly and this was it. Major props.

        hiulitH 1 Reply Last reply Reply Quote 1
        • hiulitH
          hiulit @Duel
          last edited by

          @duel Hey, I'm glad you find it useful :)

          My little contributions to the RetroPie project:

          • Shell-Script-Boilerplate
          • Fun-Facts-Splashscreens
          • Limit-Last-Played-Games
          P 1 Reply Last reply Reply Quote 0
          • P
            pianoman72 @hiulit
            last edited by

            @hiulit Is there a way to force the script to look in a specific video directory? Mine are in /opt/retropie/configs/all/emulationstation/downloaded_images/arcade/

            S hiulitH 2 Replies Last reply Reply Quote 0
            • S
              sleve_mcdichael @pianoman72
              last edited by sleve_mcdichael

              @pianoman72 said in [SCRIPT] RetroPie Convert Videos:

              Is there a way to force the script to look in a specific video directory?

              No, it's listed in the prerequisites that you have to use the ROM folder:

              Use the ROM folder for gamelists & images option in Steven Selph's Scraper.

              Use the ROM folder for gamelists & media option in Lars Muldjord's Skyscraper.

              You could use Clyde's original script that this was based off of though; that one operates on a single directory at a time.

              P 1 Reply Last reply Reply Quote 1
              • P
                pianoman72 @sleve_mcdichael
                last edited by pianoman72

                @sleve_mcdichael Thanks
                Here is the old script updated to use ffprobe and FFmpeg if it helps anyone

                mkdir -p converted                         # create the folder "converted" if it doesn't exist
                for f in *-video.mp4                       # process all videos
                  do
                    c=$(ffprobe -show_streams $f 2>&1 | grep -c yuv444p) # (-c)ount no. of "444p"
                
                    if [ "$c" -gt 0 ]                      # if 444p is present,
                      then				   # convert into 420p
                        ffmpeg -i $f  -y -pix_fmt yuv410p -strict experimental converted/$f
                    fi
                done
                
                1 Reply Last reply Reply Quote 0
                • hiulitH
                  hiulit @pianoman72
                  last edited by

                  @pianoman72 I'll take a look to see if it's easy to implement :)

                  My little contributions to the RetroPie project:

                  • Shell-Script-Boilerplate
                  • Fun-Facts-Splashscreens
                  • Limit-Last-Played-Games
                  1 Reply Last reply Reply Quote 0
                  • LolonoisL Lolonois referenced this topic on
                  • LolonoisL
                    Lolonois
                    last edited by

                    @hiulit Can you update the links in the OP as they changed over time?

                    • Steven Selph's Scraper: https://retropie.org.uk/docs/Scraper/#steven-selphs-scraper
                    • Lars Muldjord's Skyscraper: https://retropie.org.uk/docs/Scraper/#skyscraper

                    Thanks

                    hiulitH 1 Reply Last reply Reply Quote 0
                    • hiulitH
                      hiulit @Lolonois
                      last edited by

                      @Lolonois Done! Thanks for the heads up!

                      My little contributions to the RetroPie project:

                      • Shell-Script-Boilerplate
                      • Fun-Facts-Splashscreens
                      • Limit-Last-Played-Games
                      1 Reply Last reply Reply Quote 0
                      • C
                        camcamkennedy
                        last edited by

                        Re: [SCRIPT] RetroPie Convert Videos
                        I am not technical and honestly, github is confusing and scares me LOL but this script was EXACTLY what I needed thanks so much! My only recommendation is for absolute newbs like me to have an upfront callout that the steps are to:

                        • Install the script
                        • Run the program using those mandatory/optional items on the Pie
                        • Manually update the video files using file explorer on a PC or other method

                        That last item was the only thing that stumped me for a little bit... was figuring out what to do after the conversion was successful. But your documentation does have it.. I just found it a little hard to find.

                        Thank you again, this was so helpful and literally was what actually let me consider my arcade build "complete because both the Mame and NeoGeo videos I had werent working, but now they are!

                        1 Reply Last reply Reply Quote 0
                        • mrmadcatzM
                          mrmadcatz
                          last edited by

                          This tool does not seem to work with how skyscraper downloades images/videos to /home/pi/.emulationstation/downloaded_media/<system_name>/videos/

                          Any advice?

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

                            Forget this tool. I tried it to no avail. Just copy the videos on your Mac
                            , install ffmpeg with brew and run this script

                            #!/bin/bash
                            
                            # Directory containing the original videos
                            input_dir="path/to/your/input_directory"
                            
                            # Directory where the converted videos will be saved
                            output_dir="$input_dir/converted"
                            
                            # Create the output directory if it doesn't exist
                            mkdir -p "$output_dir"
                            
                            # Loop through all video files in the input directory
                            for video in "$input_dir"/*; do
                                if [[ -f "$video" ]]; then
                                    # Extract the filename without the path
                                    filename=$(basename "$video")
                                    # Set the full path for the output file
                                    output_video="$output_dir/$filename"
                                    
                                    # Perform the conversion with ffmpeg
                                    ffmpeg -i "$video" -c:v libx264 -pix_fmt yuv420p -c:a copy "$output_video"
                                fi
                            done
                            
                            echo "Conversion complete. Converted files are located in $output_dir"
                            
                            1 Reply Last reply Reply Quote 0
                            • C CARRisma referenced this topic on
                            • C
                              CARRisma
                              last edited by CARRisma

                              I've created post on how to convert these vids in Windows:

                              https://retropie.org.uk/forum/topic/35722/video-preview-fix-conversion-yuv444p-to-yuv420p

                              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.