Log in

View Full Version : ffmpeg output performance problems on cell phone


Anakunda
14th May 2010, 09:32
Greetings,

got this problem:

I have encoded a video by ffmpeg and copied to cell phone, and the phone can't keep the video speed, ie. it raises delay behind audio.

this is the used commandline I used:

ffmpeg.exe -threads 2 -i test.avs -y -sn -vcodec mpeg4 -qscale 7 test.mp4

the video plays normally on PC so this is performance problem.

So the question is can I use some additional optimization or switches to unburden the portable hardware by decoding the video?

About a year ago I did encode videos with a 5years old version of ffmpeg and the video could be played without performqance problems so I guess there must be a faster MPEG4 implemenation.


Moreover, if I encode with ffmpeg, it only uses one core, even if I use the -threads 2 switch. Any ideas?

Dark Shikari
14th May 2010, 16:20
It only uses one core because you put -threads before -i, which means "use multiple threads to decode the input".

Anakunda
14th May 2010, 18:24
It only uses one core because you put -threads before -i, which means "use multiple threads to decode the input".

hmm thats strange
now I m encoding with:
ffmpeg.exe -threads 2 -y -i "input.avs" -an -sn -vcodec mpeg4 -f mp4 -qscale 7 -threads 2 "EncoderOutput.mp4"

And I still have almost 50% CPU idle.

where exactly should I put the -threads option to apply to encoding process?

Dark Shikari
14th May 2010, 18:25
Are you sure you aren't bottlenecked by the Avisynth input?

Anakunda
14th May 2010, 18:30
I am not sure

But always decoding should be faster than encoding?

Blue_MiSfit
15th May 2010, 04:50
Nope, not when using fast encode settings! I bottleneck QuickTime every day (ok that's not saying much, but STILL :))

Anakunda
16th May 2010, 09:34
I still would say the encoder gets enough speed as when I encode the same video (same avs) with x264, I see CPU is fully exhausted.

Ghitulescu
17th May 2010, 10:02
I am not sure

But always decoding should be faster than encoding?

Usually yes, as the MPEG-family codecs are asymmetrical, that is the time is spent on the encoder side rather than on the decoder. This way the users get cheaper players, and the encoding needs expensive encoders for RT or time-consuming software-based encoders (also keeps the normal users away from the business).