11

I need convert MP4 to webm with ffmpeg. So, i use :

ffmpeg -i input.mp4 -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis output.webm

But it's very long.

Is there faster ?

llogan
  • 121,796
  • 28
  • 232
  • 243
Luzwitz
  • 197
  • 1
  • 3
  • 11

1 Answers1

9

libvpx is a relatively slow encoder. According to the VP8 Encode Parameter Guide: Encode Quality vs. Speed, you can use the -cpu-used option to increase encoding speed. A higher value results in faster encoding but lower quality:

Setting a value of 0 will give the best quality output but is extremely slow. Using 1 (default) or 2 will give further significant boosts to encode speed, but will start to have a more noticeable impact on quality and may also start to effect the accuracy of the data rate control. Setting a value of 4 or 5 will turn off "rate distortion optimisation" which has a big impact on quality, but also greatly speeds up the encoder.

Alternatively, it appears that VA-API can be utilized for hardware accelerated VP8 encoding, but I have no experience with this.

llogan
  • 121,796
  • 28
  • 232
  • 243
  • Ok, thanks ! But is there no an other encoder that libvpx ? A faster encoder ? – Luzwitz Apr 26 '17 at 10:16
  • @Luzwitz For VP8, I'm guessing your choices are libvpx or VA-API. – llogan Apr 26 '17 at 16:30
  • @LordNeckbeard , I am facing an issue with stopping video recording with ffmpeg. I saw this answer [https://askubuntu.com/questions/436956/stop-the-recording-after-some-period-of-time] for stopping after a peiod of time, and It worked fine . But I want to stop the recording after a button click . How can I do this? Please help – Liya Apr 27 '17 at 12:18
  • 1
    @Liya Use the button to issue `kill `. For related info see [Is there a way to pause and resume FFmpeg encoding?](https://video.stackexchange.com/a/17069/1760) I'm assuming you're using Linux since you didn't specify. If it's another OS you should ask a new question at [su] (or [so] if the question involves programming). – llogan Apr 27 '17 at 18:24
  • @LordNeckbeard ya I am using Linux, I could'nt get the process id using **pgrep ffmpeg** command, So I coudnt kill that process. – Liya May 05 '17 at 06:13