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

[h264_nvenc] ERROR: Conversion failed! #25130

Closed
steam3d opened this issue May 4, 2020 · 2 comments
Closed

[h264_nvenc] ERROR: Conversion failed! #25130

steam3d opened this issue May 4, 2020 · 2 comments
Labels

Comments

@steam3d
Copy link

@steam3d steam3d commented May 4, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.05.03
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Description

I try to enable h264_nvenc. First time i have tried to do it through python. my question. I could not fix error and decided to make sure that conversion through the youtube-dl.exe works. I found similar problem here and tried to do the same command.
All the time i got the error: ERROR: Conversion failed!. I found a regularity.

Render on CPU

Input:

 youtube-dl.exe 'https://www.youtube.com/watch?v=32ZG9WiR4wg' '--no-playlist' '--ignore-config' '--write-info-json' '--continue' '--output=%(title)s.%(ext)s' '--restrict-filenames' '--format=bestvideo+bestaudio' '--recode-video=mp4' '--verbose'

Output:

[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:4K_UNDER_SEA_30_SECONDS_DEMO.f313.webm" -i "file:4K_UNDER_SEA_30_SECONDS_DEMO.f251.webm" -c copy -map "0:v:0" -map "1:a:0" "file:4K_UNDER_SEA_30_SECONDS_DEMO.temp.webm"
Deleting original file 4K_UNDER_SEA_30_SECONDS_DEMO.f313.webm (pass -k to keep)
Deleting original file 4K_UNDER_SEA_30_SECONDS_DEMO.f251.webm (pass -k to keep)
[ffmpeg] Converting video from webm to mp4, Destination: 4K_UNDER_SEA_30_SECONDS_DEMO.mp4
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:4K_UNDER_SEA_30_SECONDS_DEMO.webm" "file:4K_UNDER_SEA_30_SECONDS_DEMO.mp4"

Render on GPU

Input:

youtube-dl.exe 'https://www.youtube.com/watch?v=32ZG9WiR4wg' '--no-playlist' '--ignore-config' '--write-info-json' '--continue' '--output=%(title)s.%(ext)s' '--restrict-filenames' '--format=bestvideo+bestaudio' '--recode-video=mp4' '--postprocessor-args=-c:v h264_nvenc' '--verbose'

Output:

[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:4K_UNDER_SEA_30_SECONDS_DEMO.f313.webm" -i "file:4K_UNDER_SEA_30_SECONDS_DEMO.f251.webm" -c copy -map "0:v:0" -map "1:a:0" "-c:v" h264_nvenc "file:4K_UNDER_SEA_30_SECONDS_DEMO.temp.webm"
ERROR: Conversion failed!

How to fix

As you can see the problem is the first command to ffmpeg.

ffmpeg -y -loglevel "repeat+info" -i "file:4K_UNDER_SEA_30_SECONDS_DEMO.f313.webm" -i "file:4K_UNDER_SEA_30_SECONDS_DEMO.f251.webm" -c copy -map "0:v:0" -map "1:a:0" "-c:v" h264_nvenc "file:4K_UNDER_SEA_30_SECONDS_DEMO.temp.webm"

If I start converting through the CPU and after the file 4K_UNDER_SEA_30_SECONDS_DEMO.webm is ready i interrupt the process. And then I’ll start the conversion through the GPU (Render on GPU command). Then the first command will be skipped, since the file is already ready and the second command will be executed without errors on the video card

[download] 4K_UNDER_SEA_30_SECONDS_DEMO.webm has already been downloaded and merged
[ffmpeg] Converting video from webm to mp4, Destination: 4K_UNDER_SEA_30_SECONDS_DEMO.mp4
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:4K_UNDER_SEA_30_SECONDS_DEMO.webm" "-c:v" h264_nvenc "file:4K_UNDER_SEA_30_SECONDS_DEMO.mp4"
Deleting original file 4K_UNDER_SEA_30_SECONDS_DEMO.webm (pass -k to keep)
@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 4, 2020

Run ffmpeg command alone to see the actual error.

@dstftw dstftw closed this May 4, 2020
@dstftw dstftw added the invalid label May 4, 2020
@steam3d
Copy link
Author

@steam3d steam3d commented May 4, 2020

@dstftw It is real problem. If youtube_dl correctly transfer the commands to ffmpeg then the encoding will be without error.

Output from ffmpeg

Input #0, matroska,webm, from 'file:4K_UNDER_SEA_30_SECONDS_DEMO.f313.webm':
  Metadata:
    encoder         : google/video-file
  Duration: 00:00:30.93, start: 0.000000, bitrate: 16072 kb/s
    Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709), 3840x2160, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 1k tbn, 1k tbc (default)
Input #1, matroska,webm, from 'file:4K_UNDER_SEA_30_SECONDS_DEMO.f251.webm':
  Metadata:
    encoder         : google/video-file
  Duration: 00:00:31.00, start: -0.007000, bitrate: 137 kb/s
    Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Stream mapping:
  Stream #0:0 -> #0:0 (vp9 (native) -> h264 (h264_nvenc))
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[webm @ 000001ca593706c0] Only VP8 or VP9 or AV1 video and Vorbis or Opus audio and WebVTT subtitles are supported for WebM.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
Conversion failed!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.