[FFmpeg-user] Ffmpeg fails to convert webm files when h264_nvenc forced

Moritz Barsnick barsnick at gmx.net
Wed Feb 28 12:30:28 EET 2018


On Wed, Feb 28, 2018 at 09:04:22 +0000, oktay eşgül wrote:
> Thank you for your comment.Yes ,seems webm encoding is not supportef by my
> gpu.İnstead,I am planning toy use mkv as output container type.

MKV should work fine.

> instruction do you recommend?

> > On Wed, Feb 28, 2018 at 05:53:17 +0000, oktay eşgül wrote:
> > > 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

You weren't even using the output of this step. It's not needed.

> > > 2.Split video and audio of the callee
> > > time ffmpeg -y -i 230087_callee.webm -vn -ab 256 230087_callee.wav

You can get the audio of this file by referring "1:a" and ignoring
"1:v" - as you already actually did in step 3. Therefore not needed.

> > > 3.Mux original caller video with callee audio to store the conversation.
> > > time 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=stereo|c0<c0+c2|c1<c1+c3[out]' -map 0:v -map '[out]'
> > -c:v copy -c:a libvorbis -shortest -f webm caller_temp.webm

You can integrate the video filter and encoding of step 4 into this step:

ffmpeg -y -i 230087_caller.webm -i 230087_callee.webm \
   -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=stereo|c0<c0+c2|c1<c1+c3[aout]; \
    [0:v]drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf:x=8:y=8:fontsize=16:fontcolor=yellow at 1:expansion=strftime:basetime=1518172680000000:text='%Y-%m-%d %H-%M-%S[vout]' \
   -map '[vout]' -map '[aout]' -c:v h264_nvenc -c:a libvorbis -shortest final_font_test.webm

(Untested.)

> > > 4.Add time fontfile to the caller_temp fil which fails with below error.
> > > time 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 at 1:expansion=strftime:basetime=1518172680000000:text='%Y-%m-%d
> > %H-%M-%S' -strict -2 -shortest -c:a libvorbis -c:v h264_nvenc
> > final_font_test.webm

Hint: You were encoding to libvorbis a second time, you could have used
"-c:a copy". But as I have combined it into one step, it doesn't matter
anymore. ;-)

Cheers,
Moritz


More information about the ffmpeg-user mailing list