[FFmpeg-user] h264_v4l2m2m not working properly

twge lltwgell lltwgell at gmail.com
Mon Jun 13 08:11:09 EEST 2022


Sorry, I forgot to mention gpu memory.
/boot/config.txt is set to gpu_mem=512.

2022年6月13日(月) 14:07 twge lltwgell <lltwgell at gmail.com>:

>
> Software encoding was verified.
> *Changed to shorter m2ts clips due to speed issues!
>
> Console output for hardware and software encoding.
> https://0x0.st/ouiE.txt
>
> Software encoding finished encoding successfully. Playback was also
> possible.
>
> But I want to do hardware encoding because software encoding only gives me
> about 0.5x.
>
> Is there anything I can find out from this log?
>
> thanks
>
>
> 2022年6月9日(木) 17:52 Adam Nielsen <a.nielsen at shikadi.net>:
>
>> > I am trying to use h264_v4l2m2m on a Raspberry pi 4B to do M2TS to H264
>> > hardware encoding, but it is not working properly. The log is below.
>> > http://0x0.st/oMOa.txt
>> >
>> > If I don't use hardware encoding or if the source is not m2ts (tested
>> with
>> > mpeg-1 to h264(v4l2m2m)) I can encode.
>>
>> It looks a bit surprising, it seems it's bailing because the audio is
>> corrupted.  What happens if you add -an to try the hardware encode but
>> without any audio?  I don't see why the audio would affect hardware vs
>> software video encoding though.
>>
>> Maybe you could post an equivalent log showing the software H264 encode
>> so we can compare which messages are the same and which are different?
>>
>> Do you get any errors in dmesg from the Pi H264 hardware encoder?
>> Sometimes it can fail if there isn't enough GPU memory, so you could
>> also try increasing gpu_mem in /boot/config.txt to see if it has any
>> effect.  It should work with 128 and definitely with 256.
>>
>> Cheers,
>> Adam.
>>
>


More information about the ffmpeg-user mailing list