[FFmpeg-devel] [FFmpeg-cvslog] avformat/mov: make STTS duration unsigned int

Michael Niedermayer michael at niedermayer.cc
Mon Nov 22 15:20:09 EET 2021


On Mon, Nov 22, 2021 at 02:17:24PM +0100, Michael Niedermayer wrote:
> On Mon, Nov 22, 2021 at 09:49:26AM +0000, Gyan Doshi wrote:
> > ffmpeg | branch: master | Gyan Doshi <ffmpeg at gyani.pro> | Tue Nov 16 19:02:32 2021 +0530| [203b0e3561dea1ec459be226d805abe73e7535e5] | committer: Gyan Doshi
> > 
> > avformat/mov: make STTS duration unsigned int
> > 
> > As per 8.6.1.2.2 of ISO/IEC 14496-12:2015(E), STTS sample offsets
> > are to be always stored as uint32_t. So far, they have been signed ints
> > which led to desync in files with very large offsets.
> > 
> > The MOVStts struct was used to store CTTS offsets as well. These can be
> > negative in version 1. So a new struct MOVCtts was created and all
> > declarations for CTTS usage changed to MOVCtts.
> > 
> > > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=203b0e3561dea1ec459be226d805abe73e7535e5
> > ---
> > 
> >  libavformat/isom.h   |  9 +++++++--
> >  libavformat/mov.c    | 20 ++++++++++----------
> >  libavformat/movenc.c |  2 +-
> >  3 files changed, 18 insertions(+), 13 deletions(-)
> 
> This breaks:
> 
> ./ffmpeg -i ~/videos/mp4-negative-stts-problem.mp4 -c copy  -t 3 -y file-negstts.mov
> 
> https://samples.ffmpeg.org/mov/mp4-negative-stts-problem.mp4

failure happens like this:

[mov @ 0x56332ba06800] Application provided duration: 4294966430 is invalidkbits/s speed=N/A    
av_interleaved_write_frame(): Invalid argument
frame=   16 fps=0.0 q=-1.0 Lsize=      99kB time=00:00:00.99 bitrate= 807.3kbits/s speed=5.4e+03x    
video:90kB audio:7kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.341823%
Conversion failed!



[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

You can kill me, but you cannot change the truth.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20211122/7518b476/attachment.sig>


More information about the ffmpeg-devel mailing list