Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Losing 2 frame after upscaling #1318

Open
christopi opened this issue Feb 1, 2025 · 1 comment
Open

Losing 2 frame after upscaling #1318

christopi opened this issue Feb 1, 2025 · 1 comment
Labels
state:Planned This issue is already scheduled to be worked on type:Bug Something isn't working

Comments

@christopi
Copy link

Losing 2 Frames After Upscaling with Video2X

Description

When upscaling videos using Video2X, the output consistently loses 2 frames compared to the original video. This issue has been observed across multiple tests with varying video durations and frame counts. For example:

  • A video with 25 frames outputs 23 frames after upscaling.
  • A video with 51 frames outputs 49 frames after upscaling.

This mismatch in frame count makes it impossible to evaluate the upscaled video using VMAF.


Steps to Reproduce

Follow these steps to reproduce the issue:

  1. Use the following commands to upscale a video file:

    • For HEVC input/output:
      video2x -i input.hevc -o output.hevc -p realesrgan -s 2 -c libx265 -e preset=slow -e crf=24
    • For MP4 input/output:
      video2x -i input.mp4 -o output.mp4 -p realesrgan -s 2 -c libx264 -e preset=slow -e crf=24
  2. Compare the frame count of the original video and the upscaled video using the following script:

    python scripts/video_info_cap.py

    here is the full script

  3. Observe the number of frames in the original and upscaled videos.


Expected Behavior

The upscaled video should retain the same number of frames as the original video.


Actual Behavior

The upscaled video consistently loses 2 frames.


Example Output

Original Video:

=== Video File Information ===
File Path: /workspace/vidaio-subnet/services/upscaling/videos/7579959_hd.mp4
========================================
File Format: mov,mp4,m4a,3gp,3g2,mj2
File Size: 0.21 MB
Duration: 1.00 seconds
Bitrate: 1795.94 kbps
Compressed: Yes

=== Stream Information ===
Stream Type: Video
Codec: h264
Codec Long Name: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Resolution: 2049x1080
Frame Rate: 25.00 fps
Number of Frames: 25
Pixel Format: yuv444p
Bitrate: 1786.65 kbps

Upscaled Video:

=== Video File Information ===
File Path: /workspace/vidaio-subnet/services/upscaling/videos/4k_7579959_hd.mp4
========================================
File Format: mov,mp4,m4a,3gp,3g2,mj2
File Size: 0.57 MB
Duration: 0.92 seconds
Bitrate: 5236.69 kbps
Compressed: Yes

=== Stream Information ===
Stream Type: Video
Codec: h264
Codec Long Name: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Resolution: 4098x2160
Frame Rate: 25.00 fps
Number of Frames: 23
Pixel Format: yuv444p
Bitrate: 5226.82 kbps

Environment

  • OS: Ubuntu 24.04
  • GPU: NVIDIA RTX 6000 Ada Gene...
  • Video2X Version: 6.4.0

Request

Please investigate why Video2X consistently loses 2 frames during the upscaling process and provide a solution to ensure the output retains the same number of frames as the input.

@christopi christopi added the type:Bug Something isn't working label Feb 1, 2025
@github-actions github-actions bot added the state:Backlog This issue will be worked on in the future label Feb 1, 2025
@k4yt3x k4yt3x changed the title <Rosing 2 frame after upscaling> Losing 2 frame after upscaling Feb 1, 2025
@k4yt3x k4yt3x added state:Planned This issue is already scheduled to be worked on and removed state:Backlog This issue will be worked on in the future labels Feb 2, 2025
@k4yt3x
Copy link
Owner

k4yt3x commented Feb 2, 2025

Thanks for the detailed bug report. I'll look into it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:Planned This issue is already scheduled to be worked on type:Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants