How can I use gfpgan for video? #164

Open
opened 2026-01-29 21:44:32 +00:00 by claunia · 8 comments
Owner

Originally created by @osmankaya on GitHub (Feb 23, 2022).

Hello, how can i use gfpgan for video?

Originally created by @osmankaya on GitHub (Feb 23, 2022). Hello, how can i use gfpgan for video?
Author
Owner

@ArjixWasTaken commented on GitHub (Mar 12, 2022):

It is quite simple actually, just extract all the frames first, and run the program for each frame, after that join the frames together.

@ArjixWasTaken commented on GitHub (Mar 12, 2022): It is quite simple actually, just extract all the frames first, and run the program for each frame, after that join the frames together.
Author
Owner

@johnGettings commented on GitHub (May 18, 2022):

Video to frames:

def vid2frames(vidPath, framesOutPath):
    vidcap = cv2.VideoCapture(vidPath)
    success,image = vidcap.read()
    frame = 1
    while success:
      cv2.imwrite(framesOutPath + str(frame).zfill(5) + '.png', image)
      success,image = vidcap.read()
      frame += 1

[Restore Images with GFPGAN]

Restored frames to video:

framesPath = 'path/to/GFPGAN/frames/%5d.png'
ffmpeg -y -r {fps} -f image2 -i {framesPath} -i {audioPath} -vcodec mpeg4 -b:v 20000k {vidOutPath}
@johnGettings commented on GitHub (May 18, 2022): Video to frames: ``` def vid2frames(vidPath, framesOutPath): vidcap = cv2.VideoCapture(vidPath) success,image = vidcap.read() frame = 1 while success: cv2.imwrite(framesOutPath + str(frame).zfill(5) + '.png', image) success,image = vidcap.read() frame += 1 ``` [Restore Images with GFPGAN] Restored frames to video: ``` framesPath = 'path/to/GFPGAN/frames/%5d.png' ffmpeg -y -r {fps} -f image2 -i {framesPath} -i {audioPath} -vcodec mpeg4 -b:v 20000k {vidOutPath} ```
Author
Owner

@Tanvir1433 commented on GitHub (Mar 25, 2023):

ku Uploading VID-20230325-WA0004.mp4…

@Tanvir1433 commented on GitHub (Mar 25, 2023): ku Uploading VID-20230325-WA0004.mp4…
Author
Owner

@ajay6162 commented on GitHub (Jun 27, 2023):

My video plz edite

@ajay6162 commented on GitHub (Jun 27, 2023): My video plz edite
Author
Owner

@ajay6162 commented on GitHub (Jun 27, 2023):

1

@ajay6162 commented on GitHub (Jun 27, 2023): 1
Author
Owner

@tasnim04298 commented on GitHub (Oct 4, 2023):

Uploading d2dd60a360178d172da252dc3a2e12bb.mp4…

@tasnim04298 commented on GitHub (Oct 4, 2023): Uploading d2dd60a360178d172da252dc3a2e12bb.mp4…
Author
Owner

@ratonwgjkkredgjjjre commented on GitHub (Jan 18, 2024):

HD 4k video

@ratonwgjkkredgjjjre commented on GitHub (Jan 18, 2024): HD 4k video
Author
Owner

@ratonwgjkkredgjjjre commented on GitHub (Jan 18, 2024):

Uploading 2024-01-18-193635723.mp4…

@ratonwgjkkredgjjjre commented on GitHub (Jan 18, 2024): Uploading 2024-01-18-193635723.mp4…
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TencentARC/GFPGAN#164