Title: Change ffmpeg settings / encoding parameters
Last modified: August 21, 2016

---

# Change ffmpeg settings / encoding parameters

 *  [jenkisan](https://wordpress.org/support/users/jenkisan/)
 * (@jenkisan)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/change-ffmpeg-settings-encoding-parameters/)
 * Kylie, first off, amazing plugin. Truly. It does everything I need in one plugin.
 * The question I have is simple: I need to change the ffmpeg settings for the various
   encoding formats because the results are not very good. I uploaded a 10mb mp4
   files 720 and encoded into 480 and it became 28mb 🙂 I’m sure nothing a little
   tinkering can help.
 * Thanks.
 * [http://wordpress.org/extend/plugins/video-embed-thumbnail-generator/](http://wordpress.org/extend/plugins/video-embed-thumbnail-generator/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [jenkisan](https://wordpress.org/support/users/jenkisan/)
 * (@jenkisan)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/change-ffmpeg-settings-encoding-parameters/#post-3945893)
 * Figured it out. I now encode way faster with decent settings. Thanks.
 * OPen the main plugin php file and around line 2790. Careful. This is only for
   who knows php. Make a copy of the file first!
 *  Plugin Author [Kyle Gilman](https://wordpress.org/support/users/kylegilman/)
 * (@kylegilman)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/change-ffmpeg-settings-encoding-parameters/#post-3945900)
 * Can you post the revised FFMPEG settings you’re using?
 *  [ppehrson](https://wordpress.org/support/users/ppehrson/)
 * (@ppehrson)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/change-ffmpeg-settings-encoding-parameters/#post-3945911)
 * Kyle, it is a matter of tinkering with quantizing. You need to compress at the
   right level, but don’t you know FFMPEG? 🙂
 * The quantizer (in FFMPEG output: Q=20 from the params in your script) should 
   be around 20, which it actually is.
    It can be played with but I agree you should
   add a way to choose video quality in the conversion.
 *  Thread Starter [jenkisan](https://wordpress.org/support/users/jenkisan/)
 * (@jenkisan)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/change-ffmpeg-settings-encoding-parameters/#post-3945912)
 * Kyle, I ran some other tests to simplify the settings.
 * Fundamentally, you need to change three parameters:
 * 1. the vpre flag needs to change from slow to veryfast
    2. threads are a really
   important part of speed, ideally change it to 0 to use all available threads 
   otherwise run tests using 2, 3, 4 threads. This will increase speed on a shaed
   hosting dramatically. 3. This is the principal parameter for quality> -crf and
   it can go from 15 (lossless) to 30 really compress and low quality. I use 24 
   which yields and excellent size quality ratio.
 * To make the changes simple (because honestly audio should be adjusted too but
   lets not go there now) I simplified the changes to adding these:
 * Line 2787: if ( $options[‘ffmpeg_vpre’] == ‘on’ ) { $vpre_flags = ‘-vpre slow-
   vpre ipod640’; }
 * Change to:
 * if ( $options[‘ffmpeg_vpre’] == ‘on’ ) { $vpre_flags = ‘-vpre veryfast threads
   0 -crf 24’; }
 * This will execute if you select the vpre switch in settings on the admin side.
 * Hope this helps.
 * PS This is for h264. I have not even looked at webm (which presents specific 
   issues for encoding parameters) and ogg.
 *  Plugin Author [Kyle Gilman](https://wordpress.org/support/users/kylegilman/)
 * (@kylegilman)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/change-ffmpeg-settings-encoding-parameters/#post-3945914)
 * Thanks for the tips. I set most of the ffmpeg settings almost two years ago and
   I haven’t revisited them much since then. I don’t actually use the encoding functions
   myself (I do all my encoding before I upload) so I don’t spend a lot of time 
   thinking about it.
 * At the time I remember being concerned about monopolizing system resources on
   a machine that was simultaneously being used as a web server, which is why I’m
   only using 1 thread. I think I used the “slow” vpre because it was supposed to
   take its time and provide better quality compression.
 * As far as I can tell the default crf for libx264 is 23. Is there a noticeable
   difference between 23 and 24?
 * I’ve always meant to allow users to modify encoding settings but I kept forgetting
   to do it. It’s on my list now and it will be pretty simple to implement.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Change ffmpeg settings / encoding parameters’ is closed to new replies.

 * ![](https://ps.w.org/video-embed-thumbnail-generator/assets/icon.svg?rev=2965979)
 * [Videopack](https://wordpress.org/plugins/video-embed-thumbnail-generator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/video-embed-thumbnail-generator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/video-embed-thumbnail-generator/)
 * [Active Topics](https://wordpress.org/support/plugin/video-embed-thumbnail-generator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/video-embed-thumbnail-generator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/video-embed-thumbnail-generator/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [Kyle Gilman](https://wordpress.org/support/users/kylegilman/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/change-ffmpeg-settings-encoding-parameters/#post-3945914)
 * Status: not resolved