h264_nvenc 강제 실행 시 FFmpeg가 webm 파일 변환에 실패함

h264_nvenc 강제 실행 시 FFmpeg가 webm 파일 변환에 실패함

I have been working with below environment.

==>Ubuntu 16.04.3

==>FFmpeg :3.4.2

-- configuration: --prefix=/usr/local/ffmpeg_new/ --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --enable-libvpx --enable-libvorbis --enable-libfreetype

==>Cuda 9.1.85

==> GPU: GeForce GTX 1080ti

My purpose is to accelerate video modifications via GPU source since there is high rate traffic on my media server.

Here is the main steps of my process:

1.Split video and audio of the caller.

time ffmpeg -y -i 230087_caller.webm -vn -ab 256 230087_caller.wav

2.Split video and audio of the callee

time ffmpeg -y -i 230087_callee.webm -vn -ab 256 230087_callee.wav

3.Mux original caller video with callee audio to store the conversation.

시간 ffmpeg -y -i 230087_caller.webm -i 230087_callee.wav -filter_complex '[0:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo,volume=0.5[a1]; [1:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo,volume=0.5[a2]; [a1][a2]amerge,pan=스테레오|c0

4. 아래 오류로 인해 실패하는 caller_temp 파일에 시간 글꼴 파일을 추가합니다.

시간 ffmpeg -y -i caller_temp.webm -vf drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf:x=8:y=8:fontsize=16:fontcolor=yellow@1: 확장=strftime:basetime=1518172680000000:text='%Y-%m-%d %H-%M-%S' -strict -2 -shortest -c:a libvorbis -c:v h264_nvenc final_font_test.webm

[webm @ 0x29e8540] WebM에서는 VP8 또는 VP9 비디오와 Vorbis 또는 Opus 오디오 및 WebVTT 자막만 지원됩니다. av_interleaved_write_frame(): 잘못된 인수 output_temwp.webm의 예고편 쓰기 오류: 잘못된 인수

==================================

내 webm 파일의 세부 정보는 다음과 같습니다.

스트림 #0:0(eng): 비디오: vp8, yuv420p, 640x480, SAR 1:1 DAR 4:3, 27.58 tbr, 1k tbn, 1k tbc(기본값) 메타데이터: 제목: 비디오 스트림 #0:1(eng) : 오디오: opus, 48000Hz, 스테레오, fltp(기본값)

==================================

nvidia 비디오 인코딩/디코드 지원 매트릭스를 살펴보았는데 내 GPU가 이 변환을 지원해야 하는 것 같습니다.

https://developer.nvidia.com/video-encode-decode-gpu-support-matrix

=================================

그러나 출력 파일 형식을 mp4/avi/mpeg로 변경하면 GPU를 문제 없이 사용할 수 있습니다. 하지만 스토리지 관점에서 다른 컨테이너 파일 크기가 위험해지기 때문에 webm은 우리에게 중요합니다.

이 문제를 진행하기 위해 귀하의 의견과 피드백을 공유해 주시면 감사하겠습니다.

미리 감사드립니다. 문안 인사

답변1

에 따르면지원 매트릭스NVENC는 AVCHD(H.264) 및 HEVC(H.265)만 지원합니다.

호환되는 GPU가 있는 경우 NVDEC를 사용하여 VP8/9를 디코딩할 수 있습니다.

VP8/VP9의 하드웨어 지원 인코딩에 대해서는 확인하십시오.FFMPEG의 VAAPI 인코더 지원.

일부 입력에 기본 디코더를 사용하려면 프레임을 VAAPI에 업로드하고 VP9 및 기본 설정으로 인코딩합니다.

ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v vp9_vaapi output.webm

관련 정보