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

Upscaling doesnt work, gives me this error, how do i fix this? (input file is .mp4 and everything looks fine) #104

Open
nevolua opened this issue Sep 22, 2024 · 6 comments

Comments

@nevolua
Copy link

nevolua commented Sep 22, 2024

[QualityScaler] Preference file exist
Loading AI model
Upscaling from scrach

  1. Extracting video audio
    Frames supported simultaneously by GPU: 47
  2. Upscaling video
  3. Upscaling video (6 threads)
  4. Upscaling video 5.76% (06s)
  5. Upscaling video 11.51% (04s)
  6. Upscaling video 17.27% (03s)
  7. Upscaling video 23.02% (02s)
  8. Upscaling video 28.78% (02s)
  9. Upscaling video 34.53% (02s)
  10. Upscaling video 40.29% (01s)
  11. Upscaling video 46.04% (01s)
  12. Upscaling video 51.80% (01s)
  13. Upscaling video 57.55% (01s)
  14. Upscaling video 63.31% (01s)
  15. Upscaling video 69.06% (01s)
  16. Processing upscaled video
    Error [Errno 22] Invalid argument

MoviePy error: FFMPEG encountered the following error while writing file C:/Users/Ben/Downloads/test_RealESR_Gx4_Resize-100_Interpolation-Low.mp4:

b'[mp4 @ 000001deccbcdc00] Could not find tag for codec pcm_s16le in stream #1, codec not currently supported in container\r\nCould not write header for output file #0 (incorrect codec parameters ?): Invalid argument\r\nError initializing output stream 0:0 -- \r\n'

The video export failed, possibly because the codec specified for the video (libx264) is not compatible with the given extension (mp4). Please specify a valid 'codec' argument in write_videofile. This would be 'libx264' or 'mpeg4' for mp4, 'libtheora' for ogv, 'libvpx for webm. Another possible reason is that the audio codec was not compatible with the video codec. For instance the video extensions 'ogv' and 'webm' only allow 'libvorbis' (default) as avideo codec.

@Djdefrag
Copy link
Owner

Hi my friend,

you need the newer version of ffmpeg.

  1. Go to this site (https://www.gyan.dev/ffmpeg/builds/)
  2. Download one of this zip
    365366956-6bbc7c1a-92ba-498c-9e02-fd858d2ba32b
  3. Extract ffmpeg.exe from the downloaded .zip
  4. Copy ffmpeg.exe to QualityScaler/Assets

@eulisan
Copy link

eulisan commented Sep 24, 2024

Does not work for me, getting the same error with newest ffmpeg. But when i delete the audiofile from the "working" directory where also the frames and scaled images are stored, it works.

Seems it cant process the audio into the video for me.

@Dodeedoo
Copy link

Does not work for me, getting the same error with newest ffmpeg. But when i delete the audiofile from the "working" directory where also the frames and scaled images are stored, it works.

Seems it cant process the audio into the video for me.

you are correct, it is an issue with incorrect audio codec being used to save the video

add audio_codec='pcm_32le' replace 32 with bit depth of saved wav audio from your video

@Djdefrag
Copy link
Owner

Djdefrag commented Sep 25, 2024

@Dodeedoo @eulisan @nevolua Hi my friends

just released an update that fix this problem, let me know if it works

@eulisan
Copy link

eulisan commented Sep 25, 2024

Uhm, well. I used RealScaler which did extract the audio and had the same error. But i think it used external FFMPEG and i didnt had exiftool in the Asset Directory.

Now i placed FFMPEG and EXIFTOOL in the Asset Directory and using the 3.10 Qualityscaler it does work, but without audio. Means, i wont extract the audio.wav

But Realscaler 3.9 now works for me, lol.

@Djdefrag
Copy link
Owner

Exiftool only extract original file metadata (so it's not about audio)

With QualityScaler 3.10 the app does not extract the audio as file, but use FFMPEG to copy the audio from original video to upscaled video. This function is called Audio Passthrough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants