Opened 8 years ago

Last modified 8 years ago

#5791 new defect

-itsoffset shifts using a different value on some subtitles

Reported by: gillux Owned by:
Priority: minor Component: ffmpeg
Version: 3.0.2 Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I tried to resync subtitles with the -itsoffset option. The resulting subtitles had timestamps offset to a different value from what I provided on the command line.

I figured out that the problem has to do with the first subtitle that would have a negative timestamp once the offset is applied. I attached a simple subtitle file (to_resync.srt) to demonstrate the problem. The following command:

$ ffmpeg -itsoffset -15 -i to_resync.srt synched.srt
ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdcadec --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-netcdf --enable-shared --enable-version3 --enable-x11grab
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, srt, from 'to_resync.srt':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Subtitle: subrip
Output #0, srt, to 'synched.srt':
  Metadata:
    encoder         : Lavf57.25.100
    Stream #0:0: Subtitle: subrip (srt)
    Metadata:
      encoder         : Lavc57.24.102 srt
Stream mapping:
  Stream #0:0 -> #0:0 (subrip (srt) -> subrip (srt))
Press [q] to stop, [?] for help
size=       0kB time=00:00:10.00 bitrate=   0.1kbits/s speed=6.9e+04x    
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 144.680847%

produces synched.srt with timestamps shifted to -1 second whereas I asked for -15 seconds.

Attachments (2)

to_resync.srt (121 bytes ) - added by gillux 8 years ago.
Input file demonstrating the bug
synched.srt (115 bytes ) - added by gillux 8 years ago.
Output subtitle with unexpected offset -1 second

Download all attachments as: .zip

Change History (3)

by gillux, 8 years ago

Attachment: to_resync.srt added

Input file demonstrating the bug

by gillux, 8 years ago

Attachment: synched.srt added

Output subtitle with unexpected offset -1 second

comment:1 by Carl Eugen Hoyos, 8 years ago

Is this issue reproducible with current FFmpeg git head?

Note: See TracTickets for help on using tickets.