MacFizz
Posts: 19
Joined: Tue Oct 08, 2013 6:51 am

Performance of transcoding video with ffmpeg/avconv

Thu Nov 14, 2013 9:00 am

Hi

I need to convert mp4 videos to other formats (mostly xvid and flv).
It all works OK using avconv but it is very slow.
It's encoding at less than 1 frame per second !!!

- Why is it so slow ?
- Is there a way to improve this ?


Thx
Macfizz

User avatar
topguy
Posts: 6424
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Performance of transcoding video with ffmpeg/avconv

Thu Nov 14, 2013 9:32 am

- Why is it so slow ?

Because the CPU on the PI is not very powerful.
And ffmpeg/aconv dont use the GPU to help with decoding/encoding.

- Is there a way to improve this ?

You can reduce video resolution and/or quality.

MacFizz
Posts: 19
Joined: Tue Oct 08, 2013 6:51 am

Re: Performance of transcoding video with ffmpeg/avconv

Thu Nov 14, 2013 9:58 am

Well, while I do get the fact that the RPI is a single core arm CPU running at 700MHz, I still don't understand how and why it can't decode and encode faster than 1fp/s.
Also, the video sources are 1280*720 and the output files are 720*384.
Now, it's my understanding that decoding a video is going well with a RPI because it uses the GPU hardware decoding capabilities, is there a way to use that to decode and encode ?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Performance of transcoding video with ffmpeg/avconv

Thu Nov 14, 2013 10:00 am

There is a GPU accelerated enabled tool called omxtx for video encoding, I've never used this myself so I cannot comment on it's effectiveness. - https://github.com/dickontoo/omxtx

Why are you transcoding these files anyway the Pi's GPU has hardware decoding for DivX, xVid and FLV (with h.264)??

If you want to change the container but retain the codec data you can use ffmpeg's codec copy option i.e.
ffmpeg -i in_file.flv -acodec copy -vcodec copy out_file.mp4

Richard S.

MacFizz
Posts: 19
Joined: Tue Oct 08, 2013 6:51 am

Re: Performance of transcoding video with ffmpeg/avconv

Thu Nov 14, 2013 12:32 pm

Well, I've heard of omxtx but I've been unable to compile it.
The rpi can read those video just fine and I would need any conversion if those videos didn't need to be read on other devices.

Would there be anyway to use something like mplayer to decode the video using the GPU and pipe it through avconv or the GPU. There's a camera existing for the rpi, I doubt it record and encode video at 1fp/s.
Would it speed the process using something like mplayer myvideo.mp4 | avconv myvideo.avi ?

thx

Return to “Graphics, sound and multimedia”