Set up packet duration correctly when encoding using FFmpeg (#2588).
It seems strange that this is necessary (maybe I'm missing some
other way that the packet duration is supposed to be set up).
Without this, when the mov muxer writes the trak tags it uses an
incorrect length value because the length value is calculated
from trk->end_pts, which in turn is calculated from the last-seen
pts + the duration of the last packet. If that packet is marked
as length 0 the length of the track is 1 frame short, so the export
is missing a frame.