Answers.Body: <p>There is no switch to set a file size in percentage but there is the <code>-fs</code> switch.
  This switch can bet set to let ffmpeg try to get to a specific target file size set in bytes (for example <code>-fs 52428800</code> to get to 50MB).
  You can write a script that takes the original file size and calculates your new desired file size depending on your specified percentage value and passes that calculated value to the -fs switch.
  The resulting file wont be <em>exactly</em> at that file size though, ffmpeg will try its best but depending on the source file and your desired file size it wont be possible to reach that file size.</p>
  
  <p>Even with the worst possible bit rate you can't produce a 20byte sized 720p mkv with 1 hour runtime. You get the idea, there will always be a certain error margin with the resulting file size.</p>
  
  <p>If you simply want to reduce the file size by a good portion I recommend just using presets. Generally using the normal preset for x264 will give you a lot smaller video with no or very little quality reduction.
  Remuxed or encoded Blu-rays or camera recordings usually have a crazy bitrate which results in these huge file sizes.</p>
  
  <p>In your case if you are not interested in 5.1 sound you could also convert the 5.1 DTS sound into stero AAC or MP3 sound which will reduce the file size quite a bit aswell without hearable quality loss (for most human beings) in the sound.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-04-21T16:14:39.390Z
Answers.LastActivityDate: 2014-04-21T16:14:39.390Z
Answers.UserDisplayName: timonsku
Body: <p>I have several movie files in a <code>mkv</code> container.</p>
  
  <p><code>ffmpeg -i filename</code> gives me the following output:</p>
  
  <pre><code>Stream #0.0(eng): Video: h264 (High), yuv420p, 1280x720, PAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
  Stream #0.1(eng): Audio: dca (DTS), 48000 Hz, 5.1, s16, 1536 kb/s (default)
  Stream #0.2(eng): Subtitle: [0][0][0][0] / 0x0000 (default) (forced)
  </code></pre>
  
  <p>Unfortunately the file size is pretty big. I was wondering, if there is a way to reduce the file size percentage-wise? Something like: "Reduce file size by 10%"?</p>
  
  <p>I would prefer command line tools, such as <code>ffmpeg/avconv</code> or similar?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-04-21T07:50:05.100Z
Comments.Text: Well, I'd prefer reducing file size.
Comments.UserDisplayName: Frederik Spurner
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-04-22T16:46:53.393Z
Comments.Text: Do you want to achieve a specific file size, or do you just want it measurably smaller? Do you want to keep the 5.1 channels or make it stereo? Do you want to change 1280x720 to something smaller?
Comments.UserDisplayName: llogan
Tags: <ffmpeg><video-quality>
Title: Reduce quality percentage wise
UserDisplayName: Frederik Spurner
ThreadText: # Reduce quality percentage wise
  
  (Asked by: username_0 on 2014-04-20)
  
  I have several movie files in a `mkv` container.
  
  `ffmpeg -i filename` gives me the following output:
  
  ```
  Stream #0.0(eng): Video: h264 (High), yuv420p, 1280x720, PAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
  Stream #0.1(eng): Audio: dca (DTS), 48000 Hz, 5.1, s16, 1536 kb/s (default)
  Stream #0.2(eng): Subtitle: [0][0][0][0] / 0x0000 (default) (forced)
  
  ```
  
  Unfortunately the file size is pretty big. I was wondering, if there is a way to reduce the file size percentage-wise? Something like: "Reduce file size by 10%"?
  
  I would prefer command line tools, such as `ffmpeg/avconv` or similar?
  
  **Tags:** ffmpeg, video-quality
  
  > **Comments:**
  > **username_0**: Well, I'd prefer reducing file size.  
  > **username_1**: Do you want to achieve a specific file size, or do you just want it measurably smaller? Do you want to keep the 5.1 channels or make it stereo? Do you want to change 1280x720 to something smaller?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2014-04-21. Score: 1
  
  There is no switch to set a file size in percentage but there is the `-fs` switch.
  This switch can bet set to let ffmpeg try to get to a specific target file size set in bytes (for example `-fs 52428800` to get to 50MB).
  You can write a script that takes the original file size and calculates your new desired file size depending on your specified percentage value and passes that calculated value to the -fs switch.
  The resulting file wont be *exactly* at that file size though, ffmpeg will try its best but depending on the source file and your desired file size it wont be possible to reach that file size.
  
  Even with the worst possible bit rate you can't produce a 20byte sized 720p mkv with 1 hour runtime. You get the idea, there will always be a certain error margin with the resulting file size.
  
  If you simply want to reduce the file size by a good portion I recommend just using presets. Generally using the normal preset for x264 will give you a lot smaller video with no or very little quality reduction.
  Remuxed or encoded Blu-rays or camera recordings usually have a crazy bitrate which results in these huge file sizes.
  
  In your case if you are not interested in 5.1 sound you could also convert the 5.1 DTS sound into stero AAC or MP3 sound which will reduce the file size quite a bit aswell without hearable quality loss (for most human beings) in the sound.
  
  
  ---
  
  