title: Getting video sped-up with FFmpeg to have the correct duration
body: <p>I've been speeding up video using <code>ffmpeg</code> by following these <a href="https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video" rel="noreferrer">instructions</a>. For example, to speed up the video by 4 times, I run the following command: </p>
  
  <pre><code>ffmpeg -i vid.MP4 -filter:v "setpts=0.25*PTS" vid_fast.MP4
  </code></pre>
  
  <p>While the video is sped up by the indicated amount, the duration of the video (as indicated under its properties, and also when I play the video in VLC) remains the same as the original. For example, if <code>vid.MP4</code> is initially 4 minutes, then <code>vid_fast.MP4</code> is also 4 minutes, rather than being 1 minute long as expected. (The additional 3 minutes just consist of the video being frozen on the last frame.)</p>
  
  <p>This is a bit of a hassle, since I need to delete the additional 3 minutes that I'm not interested in. Is there any way to avoid this?</p>
  
  <p>Here is a bit more information on the version of <code>ffmpeg</code> I'm using:</p>
  
  <pre><code>ffmpeg version N-69060-gcd960c8 Copyright (c) 2000-2015 the FFmpeg developers
    built on Jan 14 2015 22:13:45 with gcc 4.9.2 (GCC)
    configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
  isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
  le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
  enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-lib
  modplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
  b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
  r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --en
  able-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
   --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-
  libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enab
  le-zlib
    libavutil      54. 16.100 / 54. 16.100
    libavcodec     56. 20.100 / 56. 20.100
    libavformat    56. 18.101 / 56. 18.101
    libavdevice    56.  4.100 / 56.  4.100
    libavfilter     5.  7.101 /  5.  7.101
    libswscale      3.  1.101 /  3.  1.101
    libswresample   1.  1.100 /  1.  1.100
    libpostproc    53.  3.100 / 53.  3.100
  Hyper fast Audio and Video encoder
  </code></pre>