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

MoviePy error: FFMPEG encountered the following error while writing file #78

Closed
DragonVsKira opened this issue Jun 3, 2024 · 4 comments

Comments

@DragonVsKira
Copy link

Error[Errno 22] Invalid argument

MoviePy error: FFMPEG encountered the following error while writing file C:/Users/JJ/Videos/Captures/out\Ishura.S01E01.mkv_RealSRx4_Anime_Resize-100_Interpolation-Low.mp4:

b'x265 [info]: HEVC encoder version 3.2+35-acc5d16999e2\r\nx265 [info]: build info [Windows][GCC 9.2.1][64 bit] 8bit+10bit\r\nx265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2\r\nx265 [error]: frameNumThreads (--frame-threads) must be [0 .. X265_MAX_FRAME_THREADS)\r\n[libx265 @ 000001ba64bae900] Cannot open libx265 encoder.\r\nError initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height\r\n'

@Djdefrag
Copy link
Owner

Djdefrag commented Jun 7, 2024

Hi my friend,

i see that filename has 2 "extension" .mkv and final .mp4.

Can you write the original filename?

@DragonVsKira
Copy link
Author

Ishura.S01E01.mkv

@linenoize
Copy link

I'm getting a similar [errno 22]

Error [Errno 22] Invalid argument

MoviePy error: FFMPEG encountered the following error while writing file C:/Users/user/Videos/Home Videos Upscaled\1992 - Christmas - Brad_LRF_Full_SBS.mp4_BSRGANx4_Resize-50_Interpolation-Low.mp4:

b'[mp4 @ 000001bbaa760bc0] 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 @linenoize

are you using Github code?

Maibe you need a newer version of FFMPEG (Unfortunately, I can't upload it to github because it is too heavy)

  • You can download it from here: https://www.gyan.dev/ffmpeg/builds/

  • Download one of this .zip
    image

  • Extract ffmpeg.exe from .zip and copy it in QualityScaler/Assets folder

  • The app will automatically check the new ffmpeg version and will use it

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

3 participants