Free AI Video Upscaling Mac Instructions

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ต.ค. 2024
  • For detailed Windows and Linux instructions see this video:
    • FREE AI Video Upscalin...
    Websites used:
    github.com/nih...
    ffmpeg.org/dow...
    NOTE: Lines that start with // are comments and NOT commands. Don't paste these in!
    // First Create a waifu2X directory on the desktop
    // Change System Settings, Privacy & Security, Full Disk Access and add the terminal program
    // Now open the terminal and change Terminal directory to Desktop/waifu2x
    // Turn off command security
    sudo spctl --master-disable
    // Create the needed subdirectories
    mkdir video
    mkdir frames
    mkdir scaled
    // Copy your MP4 video into waifu2x/video directory and rename it video.mp4
    / Get info about video: i.e. frame rate and dimensions
    ./ffprobe video/video.mp4
    // Extract images to our frames folder
    ./ffmpeg -i video/video.mp4 frames/frame%06d.png
    // Extract audio to our video folder
    ./ffmpeg -i video/video.mp4 video/audio.mp3
    // Scale images: -s valid options are 1 2 4 8 16 or 32
    ./waifu2x-ncnn-vulkan -i frames/ -o scaled/ -n 2 -s 2
    // Put video back together lower -crf means better quality but larger file sizes
    // MAKE SURE YOU CHANGE THE FRAME RATES FROM 24 TO THE ACTUAL VIDEO
    FRAME RATE!
    ./ffmpeg -f image2 -framerate 24 -i scaled/frame%06d.png -i video/audio.mp3 -r
    24 -vcodec libx264 -crf 16 video/upscaled.mp4
    // Turn security back on
    sudo spctl --master-enable

ความคิดเห็น • 56

  • @TheKGRecords
    @TheKGRecords 7 หลายเดือนก่อน +3

    Thank you Sir !the last command was giving me error, I changed it to this "./ffmpeg -f image2 -framerate 23.96 -i scaled/frame%06d.png -i video/audio.mp3 -r 23.96 -vcodec libx264 -crf 16 video/upscaled.mp4
    "

    • @Stars2768
      @Stars2768 4 หลายเดือนก่อน

      THANK YOU SO MUCHHHHH! Bless your heart! I was facing the same error :)

    • @sarahmenz3019
      @sarahmenz3019 3 หลายเดือนก่อน

      This too also worked for me - unlike the command in the description. Thank you

  • @rutkowski1490
    @rutkowski1490 ปีที่แล้ว +1

    worked like a charm on first try. Thanks a lot, really appreciate it!

  • @-inFinity05-
    @-inFinity05- ปีที่แล้ว +3

    My video finally finished scaled after three days. Only issue is, it’s now saying "This format is not compatible with Quickplayer". I can play it anyways, but it only plays the audio, no picture. It's a .mov, but I already have multiple .mov's saved to my photos app. Other than video title and frame rate, I followed the instructions letter for letter, so I’m not sure what’s going on. Here’s the command I used, is it missing anything?
    ./ffmpeg -f image2 -framerate 30 -i scaled/frames%07d.png -i video/audio.mp3 -r 30 -vcodec libx264 -crf 11 video/upscaled.mp4
    I double checked and it saved all 5000+ frames to the upscaled folder, and saved the audio to the "video" folder.

    • @freewarefocus
      @freewarefocus  ปีที่แล้ว +2

      Offhand I would guess that ffmepg can't handle MOVs very well. However you should have a MP3 file in the directory with the resulting video. I would bring it into an editor and recombine them. Then re-encode it to attach the video and get it into a more standard format. Free options for video editors include Kdenlive and Davinci Resolve.

    • @staschye458
      @staschye458 8 หลายเดือนก่อน +2

      Solved!!! The problem is that the output video is not read. Guys, here's a new order of commands, since what the author gives is not readable in the output, use it! I took this from the Realgun repository.
      cd /Users/lilneo/Desktop/Wifu2x
      ./ffprobe video/video.mp4
      ./ffmpeg -i video/video.mp4 -qscale:v 1 -qmin 1 -qmax 1 -vsync 0 frames/frame%06d.png
      ./waifu2x-ncnn-vulkan -i frames/ -o scaled/ -n 2 -s 2
      ./ffmpeg -i scaled/frame%06d.png -i video/video.mp4 -map 0:v:0 -map 1:a:0 -c:a copy -c:v libx264 -r 24 -pix_fmt yuv420p video/upscaled.mp4

    • @charleebrown6972
      @charleebrown6972 4 หลายเดือนก่อน +1

      @@staschye458 Thanks a lot, that really worked for me. Only thing was my video didn't have audio so I had to remove the "-map 1:a:0" line because it was giving an error

    • @topmeoff
      @topmeoff หลายเดือนก่อน +1

      How do you play the videos on Mac? I keep getting error saying formate isn’t supported by QuickTime Player

  • @getahead_dev
    @getahead_dev 10 หลายเดือนก่อน +1

    I love my waifu2x

  • @fordeath_ff1371
    @fordeath_ff1371 3 หลายเดือนก่อน

    it said incompatable driver

  • @Stars2768
    @Stars2768 4 หลายเดือนก่อน

    Thank you so much! You really helped me today!!

  • @paulbrady5259
    @paulbrady5259 9 หลายเดือนก่อน

    Great video. Can you upload and link the txt file with all the prompt names of the code you're entering? Thank you.

    • @freewarefocus
      @freewarefocus  9 หลายเดือนก่อน

      All of the commands are in the video description so you can copy them from there and past them into a text document.

  • @Aiuniqreate
    @Aiuniqreate ปีที่แล้ว

    Hello, I tried following your guide, it's clearly mentioned. Howevever I am stuck her. When I try to scale the images with ./waifu2x-ncnn-vulkan -i frames/ -o scaled/ -n 2 -s 2, it's stuck forever, just not completing. I have just 556 frames. Could you please help?

    • @freewarefocus
      @freewarefocus  ปีที่แล้ว

      What Mac hardware and OS version are you on? Also try adding to the command line "-g -1" (no quotes) - that will force it to use the CPU instead of the GPU. It likely would be very slow but may make it functional at least

    • @Aiuniqreate
      @Aiuniqreate ปีที่แล้ว

      @@freewarefocus Sorry for the delayed response here. I am on Mac Ventura 13.4.1 with 16GB. Btw it worked for me after restarting and waiting a little longer. But I didn't really notice much upscaling so kind of uninstalled it . Thank you!

    • @freewarefocus
      @freewarefocus  ปีที่แล้ว +1

      @@Aiuniqreate Glad it finally completed. Sorry it didn't work out for you, sometimes it has really great results and sometimes it is a bit meh - just depends on the video

  • @geoffyuendesign
    @geoffyuendesign 11 หลายเดือนก่อน

    Thank you for this! How can we use hevc_videotoolbox instead of libx264 for ffmpeg? This will use hardware acceleration on Apple Silicon Macs (m1 and m2). I just tried swaping them out in the commandline but it appears to not work - I just get a non-working mp4.

    • @freewarefocus
      @freewarefocus  11 หลายเดือนก่อน

      I don’t have an Apple Silicon Mac to test on (that was a loaner), however the ffmpeg part is just breaking down the video and recombining the upscaled images. That part runs fairly fast so I am not sure overall you would gain a lot of time. However hopefully someone can help out with the hardware acceleration in ffmpeg - faster is faster

    • @geoffyuendesign
      @geoffyuendesign 11 หลายเดือนก่อน

      @@freewarefocus I was able to figure it out using x264 instead. The encoding is sped up dramatically: 3-4minutes vs 12-14 minutes on a Macbook Pro M1. My final command using a bitrate of 1750k is: ffmpeg -framerate 23.976025 -thread_queue_size 4096 -i scaled/frame%06d.png -i video/audio.mp3 -c:v h264_videotoolbox -b:v 1750k -r 23.976025 video/out.mp4
      I can't figure out how to use hevc_videotoolbox (x265) t convert png frames though other than using a 2-step process but convert the frames to x265 and then converting that output to x265. But because the Apple Silicon has 264/265 acceleration it is still faster than non-accelerated.

  • @-inFinity05-
    @-inFinity05- ปีที่แล้ว

    Hello! I'm upscaling a 3 minute video (~5000 frames), and it’s taking a long time, and my computer auto shut off. Would that have interrupted the process or will it still be running?

    • @freewarefocus
      @freewarefocus  ปีที่แล้ว +1

      If it is just sleeping it should resume. If it stopped running in the terminal window (or the window closed) it likely isn’t running in the background

    • @-inFinity05-
      @-inFinity05- ปีที่แล้ว

      @@freewarefocus Thanks!

  • @rohan3984
    @rohan3984 ปีที่แล้ว

    perfect.

  • @amzclick3696
    @amzclick3696 ปีที่แล้ว

    Thanks! Works!

  • @udaypratapsinghsandhu868
    @udaypratapsinghsandhu868 9 หลายเดือนก่อน

    will it work with apple m series?

    • @freewarefocus
      @freewarefocus  9 หลายเดือนก่อน +1

      This video was recorded on an M1 Mac so it should work fine

    • @udaypratapsinghsandhu868
      @udaypratapsinghsandhu868 9 หลายเดือนก่อน

      I wished on using realesrgan because it it said to be the best could you please guide with that it is available for Mac but I couldn't find any relevant video on TH-cam that could help me
      @@freewarefocus

  • @PixelPop_Officiel
    @PixelPop_Officiel 11 หลายเดือนก่อน

    Hello wich Mac are you using ? thx

    • @freewarefocus
      @freewarefocus  11 หลายเดือนก่อน

      That is an M1 iMac with 8 gigs of RAM

    • @PixelPop_Officiel
      @PixelPop_Officiel 11 หลายเดือนก่อน

      @@freewarefocus Do you think if it’s could be possible to do this on a MacBook Air M2 ?

    • @freewarefocus
      @freewarefocus  11 หลายเดือนก่อน

      @@PixelPop_Officiel I would totally expect it to work, just even faster than the M1

    • @PixelPop_Officiel
      @PixelPop_Officiel 11 หลายเดือนก่อน

      @@freewarefocus i wondering this vecaus there is no fans on the MaBoik Air M2

  • @njdxnjdx
    @njdxnjdx 6 หลายเดือนก่อน

    nah! you've got to be friggin kidding me with this mess

    • @freewarefocus
      @freewarefocus  6 หลายเดือนก่อน +1

      You can use out this all GUI method for Mac here: th-cam.com/video/QdYdq3xO7-k/w-d-xo.htmlsi=LxIwx81rTiSyzq1J

  • @brentonhalio4536
    @brentonhalio4536 ปีที่แล้ว

    /ffmpeg -f image2 -f image2 -framefate 23.98 -i scaled/frame%06d.png -i video/audio.mp3 -r 23.98 -vcodec libx264 -crf 16 video/upscaled.mp4
    Unrecognized option 'framefate'.
    Error splitting the argument list: Option not found
    Any ideas?

    • @freewarefocus
      @freewarefocus  ปีที่แล้ว +1

      That option is frame*r*ate (framerate) and not framefate. That should fix it.

    • @brentonhalio4536
      @brentonhalio4536 ปีที่แล้ว +1

      @@freewarefocus oops looool

  • @jason3975123
    @jason3975123 11 หลายเดือนก่อน

    I get the following for my .avi file (after over 1,090 png "frames" were generated):
    ./waifu2x-ncnn-vulkan: illegal option -- 1
    Is this fixable?

    • @freewarefocus
      @freewarefocus  11 หลายเดือนก่อน

      Guessing but I suspect you might have typed in -1 frames instead of -i frames as part of the command line. -i is for input, -o is for output, -n is for noise and -s is for scaling - you basically just use the first, lower case letter for each option

  • @Chasingvibes2103
    @Chasingvibes2103 7 หลายเดือนก่อน

    Ah man it was going so well I followed very instruction but the last input in terminal I just get ' error option r35
    Error splitting the argument list: invalid argument. I spent an hour for 726 frames. everything is in the right folder frame and upscale etc but I did get an error message when upscaling after code line
    ./waifu2x-ncnn-vulkan -i frames/ -o scaled/ -n 2 -s 2
    [out#0/image2 @ 0x7f82a0017700] video:505212KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
    frame= 726 fps=169 q=-0.0 Lsize=N/A time=00:00:29.04 bitrate=N/A speed=6.77x
    ben@Mac-Studio waifu2x % ./waifu2x-ncnn-vulkan -i frames/ -o scaled/ -n 2 -s 2
    both .DS_Store and output .png ! .DS_Store will output .DS_Store.png
    [0 Apple M2 Max] queueC=0[1] queueG=0[1] queueT=0[1]
    [0 Apple M2 Max] bugsbn1=0 bugbilz=97 bugcopc=0 bugihfa=0
    [0 Apple M2 Max] fp16-p/s/a=1/1/1 int8-p/s/a=1/1/1
    [0 Apple M2 Max] subgroup=32 basic=1 vote=1 ballot=1 shuffle=1
    decode image frames//.DS_Store failed
    it then took quite a while to make the .png which is strange as im using a Mac Studio M@ ultra with 64GB RAM
    Any help much appreciate its a family film from the 90s love to make one bit of it work well., Do you think it was too short of have I gone wrong somewhere I copied an pasted everything from your description setting
    looks good though hope I can get it to work
    cheers

    • @freewarefocus
      @freewarefocus  7 หลายเดือนก่อน +1

      I am not sure I haven't see that before. I would check to make sure the images are actually valid and no are zero bytes or something.

    • @Chasingvibes2103
      @Chasingvibes2103 7 หลายเดือนก่อน

      Thank you I will try again. The original video has been converted from VOB to mp4 through wondershare so I may try running it through handbrake or a similar program. I’m just very busy till 25th Feb so I’ll try again then. Just want to make a nice little upgrade of a video of me when I was 5 back in 1991 so it’s very old vhs that’s been moved to dvd then burnt to .VOB then converted again. Poor video probably doesn’t know what’s going on. Would you recommend any specific settings for wonder share that might help like changing the fps or the H264 etc there so many settings I can tweak I just went with what it offered without looking much further, but I appreciate your help. I will look into it as soon as I get some time. I haven’t really used terminal before so I was quite impressed that I got any of it working.

    • @Gtexport
      @Gtexport 7 หลายเดือนก่อน +1

      running into the same problem. did you get it to work?
      also couldnt i extract the video file to pngs through a different program or is it necessary to use this method

    • @freewarefocus
      @freewarefocus  7 หลายเดือนก่อน

      @@Gtexport You can use any method that takes a video and spits out PNGs of the frames. In fact, in this video I show how to use Shotcut (free, open source & avail for the Mac) to do that via a GUI: th-cam.com/video/QdYdq3xO7-k/w-d-xo.htmlsi=cmMs1GjA0ejskdhb

  • @johnnybloem1
    @johnnybloem1 ปีที่แล้ว

    /waifu2x/models-cunet/noise2_scale2.0x_model.bin failed
    zsh: segmentation fault ./waifu2x-ncnn-vulkan -i frames/ -o scaled/ -n 2 -s 2

    • @freewarefocus
      @freewarefocus  ปีที่แล้ว

      It looks like this could be a directory or naming issue according to a bug report coder.social/nihui/waifu2x-ncnn-vulkan/issues/160 . Make sure you aren't renaming anything and are executing the program in the same directory.