Answers.Body: <p>wmv is often detected as 90k FPS by ffmpeg.  (That's a placeholder value since the demuxer doesn't look into the stream right away, to see the intervals between the first few frames).</p>
  
  <p>ffmpeg's default for mp4 output is CFR mode, hard-duplicating frames to bring the framerate up (to 90000FPS in this case).  Even the most efficient codecs take a few bytes to code a frame that's an exact duplicate of the one before.</p>
  
  <p><code>-vsync vfr</code> (same as <code>-vsync 2</code>) on the command line should fix the problem (by letting ffmpeg not drop or duplicate any frames, but instead just use the input timestamps for the output frames).  It goes after the input file but before the output file, as it's an output option.</p>
  
  <p>Other than that, see <a href="https://trac.ffmpeg.org/wiki/Encode/H.264" rel="nofollow">https://trac.ffmpeg.org/wiki/Encode/H.264</a> for example for how to choose settings appropriate for what you're doing.  (e.g. <code>-preset veryslow</code> to spend lots of CPU time for an encode-once task where the quality-per-filesize gain will benefit lots of times.)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-27T09:10:44.580Z
Answers.Text: This explanation is unlikely as 1) even at level 5.2 H264 supports a max of 530M luma samples per second, so a 90K fps output will be limited to a resolution of under 102x58  and 2) I have encoded many WMVs which report a tbn and tbc of 1K (and even some 90Ks), and I have never gotten a bloated output like the OP - I don't specify a framerate as an output flag or filter.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-27T09:27:23.657Z
Answers.Text: @Mulvya: I didn't test this for myself with ffmpeg recently, but `mplayer` did used to show the fps of wmv files as 90k.  Actually, I think I did see something like this with mp4 output and an actual VFR mp4 input.  When you encode from a wmv source, what output format do you use?  ffmpeg's default for most muxers is `-vsync vfr`, but it was changed to `-vsync cfr` for  mp4 as a workaround for some bug that can happen in a corner case.  re: **1)**: This output file is probably nowhere near level 5.2, if my theory is correct.  If ffmpeg / x264 tag it as such, that's a bug.
Answers.UserDisplayName: Peter Cordes
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-27T11:52:49.850Z
Answers.Text: My output was typically H264 in MP4 or MOV. My point re: level was it was very unlikely that ffmpeg was trying to use a fps of 90K as output if only for the simple reason that even at the highest level of 5.2, that framerate would only allow a very low resolution, and the encode should fail at the outset, rather than dump a bloated file.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-27T13:47:48.480Z
Answers.Text: @Mulvya: insane-framerate h.264 is still valid h.264, there just isn't a level do describe it.  I think I now remember at least one other questions on here where ffmpeg used a way-too-high frame rate and made a giant file.  That question had full ffmpeg output, so we could see that was actually what happened.  I agree, in an ideal world, ffmpeg would be able to tell when this happened by accident and abort, without failing to do what's asked if you really *did* ask it to make a 90k fps CFR output file.
Answers.UserDisplayName: Peter Cordes
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-28T15:40:19.840Z
Answers.LastActivityDate: 2015-06-28T15:40:19.840Z
Answers.UserDisplayName: Peter Cordes
Answers.Body: <p>Both <code>avconv</code> and <code>ffmpeg</code> suffer from the poorly chosen defaults for each container and codec. Therefore you should not simply give the command in the format as you have presented, but also tell it what to do.</p>
  
  <p>I use <code>avconv</code>, but if you are still using <code>ffmpeg</code> then the format is rather similar, so you should be able to follow.</p>
  
  <p>You will need to specify the audio settings. In many cases you will want to copy your audio without actually reencoding. This is done via <code>-c:a copy</code>. For example:</p>
  
  <pre><code>avconv -i video.wmv -c:a copy (...) video.mkv
  </code></pre>
  
  <p>This wasn't a complete line, so don't yet try it.</p>
  
  <p>You can also chose to reencode your audio, in that case rather than <code>copy</code> you should use the name of the codec (or for some reason often the library that does the encoding). For example, you can write:</p>
  
  <pre><code>avconv -i video.wmv -c:a libvorbis (...) video.mkv
  </code></pre>
  
  <p>But this will not produce good results, because we didn't give any parameters for the audio conversion. Let's just give it a quality setting, and then we will be all set with audio:</p>
  
  <pre><code>avconv -i video.wmv -c:a libvorbis -q:a 3 (...) video.mkv
  </code></pre>
  
  <p>Now the video. We can often just copy that one as well, but this is rarely what we want. If you want to just remux the file (meaning you want to change the format, but not codecs), then you can do:</p>
  
  <pre><code>avconv -i video.wmv -c:a copy -c:v copy video.mkv
  </code></pre>
  
  <p>As you see we have copied both video and audio, and we put them in the new file that is of Matroska format. This command line already will work, and you can give it a try.</p>
  
  <p>You should keep in mind that not each format can take every possible codec, some of them are more picky than others.</p>
  
  <p>Let's say you now want to reencode the video into something. Personally i prefer libtheora, due to the fact that it is a free codec, but you can have different preferences. I will let you decide for yourself which one you use.</p>
  
  <p>So we can have something like this:</p>
  
  <pre><code>avconv -i video.wmv -c:a copy -c:v libtheora -q:v 8 video.mkv
  </code></pre>
  
  <p>In there i have asked <code>avconv</code> to copy the audio, but to reencode the video with the library <code>libtheora</code> and video quality of 8. The entire thing will be saved inside video.mkv, which means it's a Matroska file.</p>
  
  <p>You can play around with settings, but you should very rarely use default presets. And keep in mind, that even if the file format is the same for output as for the input, <code>avconv</code> <em>will</em> reencode it by default. If you want to copy streams, you should specify it manually.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-27T11:34:29.017Z
Answers.LastActivityDate: 2015-04-27T11:34:29.017Z
Answers.UserDisplayName: v010dya
Body: <p>I'd like to use FFmpeg on the Mac Terminal command line to convert a .WMV file. I'm familiar with the syntax:</p>
  
  <pre><code>ffmpeg -i /path/OriginalMovieFile.wmv /path/NewMovieFile.???
  </code></pre>
  
  <p>However, my recent attempt to convert a 38 MB .WMV file to .MP4 resulted in an 800 MB file that wouldn't play. Perhaps there is a mistake in my syntax above. Or maybe I need to install a special package for handling .WMV. </p>
  
  <p>How can I convert .WMV files using FFmpeg from the Mac Terminal command line?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-20T17:00:07.957Z
Comments.Text: Please include the complete console output from your command. You can add the `-t` option if encoding a short duration will suffice to help explain the issue.
Comments.UserDisplayName: llogan
Tags: <ffmpeg><mac><transcoding>
Title: Convert .WMV using FFmpeg
UserDisplayName: Crowder
ThreadText: # Convert .WMV using FFmpeg
  
  (Asked by: username_0 on 2015-04-20)
  
  I'd like to use FFmpeg on the Mac Terminal command line to convert a .WMV file. I'm familiar with the syntax:
  
  ```
  ffmpeg -i /path/OriginalMovieFile.wmv /path/NewMovieFile.???
  
  ```
  
  However, my recent attempt to convert a 38 MB .WMV file to .MP4 resulted in an 800 MB file that wouldn't play. Perhaps there is a mistake in my syntax above. Or maybe I need to install a special package for handling .WMV.
  
  How can I convert .WMV files using FFmpeg from the Mac Terminal command line?
  
  **Tags:** ffmpeg, mac, transcoding
  
  > **Comments:**
  > **username_1**: Please include the complete console output from your command. You can add the `-t` option if encoding a short duration will suffice to help explain the issue.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2015-06-28. Score: 1
  
  wmv is often detected as 90k FPS by ffmpeg. (That's a placeholder value since the demuxer doesn't look into the stream right away, to see the intervals between the first few frames).
  
  ffmpeg's default for mp4 output is CFR mode, hard-duplicating frames to bring the framerate up (to 90000FPS in this case). Even the most efficient codecs take a few bytes to code a frame that's an exact duplicate of the one before.
  
  `-vsync vfr` (same as `-vsync 2`) on the command line should fix the problem (by letting ffmpeg not drop or duplicate any frames, but instead just use the input timestamps for the output frames). It goes after the input file but before the output file, as it's an output option.
  
  Other than that, see <https://trac.ffmpeg.org/wiki/Encode/H.264> for example for how to choose settings appropriate for what you're doing. (e.g. `-preset veryslow` to spend lots of CPU time for an encode-once task where the quality-per-filesize gain will benefit lots of times.)
  
  > **Comments:**
  > **username_3**: This explanation is unlikely as 1) even at level 5.2 H264 supports a max of 530M luma samples per second, so a 90K fps output will be limited to a resolution of under 102x58  and 2) I have encoded many WMVs which report a tbn and tbc of 1K (and even some 90Ks), and I have never gotten a bloated output like the OP - I don't specify a framerate as an output flag or filter.  
  > **username_2**: @Mulvya: I didn't test this for myself with ffmpeg recently, but `mplayer` did used to show the fps of wmv files as 90k.  Actually, I think I did see something like this with mp4 output and an actual VFR mp4 input.  When you encode from a wmv source, what output format do you use?  ffmpeg's default for most muxers is `-vsync vfr`, but it was changed to `-vsync cfr` for  mp4 as a workaround for some bug that can happen in a corner case.  re: **1)**: This output file is probably nowhere near level 5.2, if my theory is correct.  If ffmpeg / x264 tag it as such, that's a bug.  
  > **username_3**: My output was typically H264 in MP4 or MOV. My point re: level was it was very unlikely that ffmpeg was trying to use a fps of 90K as output if only for the simple reason that even at the highest level of 5.2, that framerate would only allow a very low resolution, and the encode should fail at the outset, rather than dump a bloated file.  
  > **username_2**: @Mulvya: insane-framerate h.264 is still valid h.264, there just isn't a level do describe it.  I think I now remember at least one other questions on here where ffmpeg used a way-too-high frame rate and made a giant file.  That question had full ffmpeg output, so we could see that was actually what happened.  I agree, in an ideal world, ffmpeg would be able to tell when this happened by accident and abort, without failing to do what's asked if you really *did* ask it to make a 90k fps CFR output file.  
  
  ---
  
  ### Answer by username_4 on 2015-04-27. Score: 0
  
  Both `avconv` and `ffmpeg` suffer from the poorly chosen defaults for each container and codec. Therefore you should not simply give the command in the format as you have presented, but also tell it what to do.
  
  I use `avconv`, but if you are still using `ffmpeg` then the format is rather similar, so you should be able to follow.
  
  You will need to specify the audio settings. In many cases you will want to copy your audio without actually reencoding. This is done via `-c:a copy`. For example:
  
  ```
  avconv -i video.wmv -c:a copy (...) video.mkv
  
  ```
  
  This wasn't a complete line, so don't yet try it.
  
  You can also chose to reencode your audio, in that case rather than `copy` you should use the name of the codec (or for some reason often the library that does the encoding). For example, you can write:
  
  ```
  avconv -i video.wmv -c:a libvorbis (...) video.mkv
  
  ```
  
  But this will not produce good results, because we didn't give any parameters for the audio conversion. Let's just give it a quality setting, and then we will be all set with audio:
  
  ```
  avconv -i video.wmv -c:a libvorbis -q:a 3 (...) video.mkv
  
  ```
  
  Now the video. We can often just copy that one as well, but this is rarely what we want. If you want to just remux the file (meaning you want to change the format, but not codecs), then you can do:
  
  ```
  avconv -i video.wmv -c:a copy -c:v copy video.mkv
  
  ```
  
  As you see we have copied both video and audio, and we put them in the new file that is of Matroska format. This command line already will work, and you can give it a try.
  
  You should keep in mind that not each format can take every possible codec, some of them are more picky than others.
  
  Let's say you now want to reencode the video into something. Personally i prefer libtheora, due to the fact that it is a free codec, but you can have different preferences. I will let you decide for yourself which one you use.
  
  So we can have something like this:
  
  ```
  avconv -i video.wmv -c:a copy -c:v libtheora -q:v 8 video.mkv
  
  ```
  
  In there i have asked `avconv` to copy the audio, but to reencode the video with the library `libtheora` and video quality of 8. The entire thing will be saved inside video.mkv, which means it's a Matroska file.
  
  You can play around with settings, but you should very rarely use default presets. And keep in mind, that even if the file format is the same for output as for the input, `avconv` *will* reencode it by default. If you want to copy streams, you should specify it manually.
  
  
  ---
  
  