HypnoToad
Posts: 77
Joined: Thu Dec 11, 2014 6:00 pm

Has anyone managed to use 'avconv' to encode 4k video?

Mon May 01, 2017 1:07 am

on Jessie?

I'm trying to encode some still frames taken from the camera and would like to view them on a 4k display, but I'm getting 'malloc' errors.
I've encoded videos in the past at lower resolutions without issue.

Here's the command line I'm using:

Code: Select all

avconv -i %04d.jpg -c:v libx264 -crf 20 -preset slow -vf scale=2880:2160 c:a copy ../4k_test.mp4
and here is the error message I get:

Code: Select all

x264 [error]: malloc of size 19779248 failedme=10000000000.00 bitrate=   0.0kbits/s
Video encoding failed
Killed
Is there a way of getting this to work?

Thanks

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24161
Joined: Sat Jul 30, 2011 7:41 pm

Re: Has anyone managed to use 'avconv' to encode 4k video?

Tue May 02, 2017 8:52 am

Hmm , a 19MB allocation doesn't seem too bad, but it depends what has already been allocated. Some sort of swap space would help, but it would be quite slow.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

HypnoToad
Posts: 77
Joined: Thu Dec 11, 2014 6:00 pm

Re: Has anyone managed to use 'avconv' to encode 4k video?

Wed May 10, 2017 12:15 am

Thanks, I'll try setting up a swap file and see if I still get the same problem.

Return to “Raspbian”