I have several files that when I try and cut out a chunk of it, I get a file that is 100+ seconds longer than I asked for.

It appears to be related to the subtitle stream. If I generate the original without the subtitle stream, then I get the file segment I ask for. If it contains the subtitle, it get something 100+ seconds longer than I ask for. What could I do to correct this or determine more specifically what the problem is?

Deron



ffmpeg -i "/work/disk1/HD-IFYL1081.mp4" -map 0 -ss 58.908909 -t 1175.709106 -c:v libx264 -preset veryfast -qp 0 -ac 2 -ar 48000 -c:s mov_text -y "/work/disk1/HD-IFYL1081 A.mp4"

ffmpeg version N-71957-g5f2b4a2 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --enable-shared --enable-gpl --enable-nonfree --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libvorbis --enable-libfaac --enable-libopenjpeg --enable-librtmp
  libavutil      54. 23.101 / 54. 23.101
  libavcodec     56. 37.102 / 56. 37.102
  libavformat    56. 32.100 / 56. 32.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/work/disk1/HD-IFYL1081.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.32.100
  Duration: 00:29:31.80, start: 0.021333, bitrate: 64906 kb/s
Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv422p, 1280x720 [SAR 1:1 DAR 16:9], 64775 kb/s, 59.94 fps, 59.94 tbr, 11988 tbn, 119.88 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 124 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream #0:2(und): Subtitle: mov_text (tx3g / 0x67337874), 1280x720, 0 kb/s (default)
    Metadata:
      handler_name    : SubtitleHandler
No pixel format specified, yuv422p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0xa85e40] using SAR=1/1
[libx264 @ 0xa85e40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0xa85e40] profile High 4:4:4 Predictive, level 3.2, 4:2:2 8-bit
[libx264 @ 0xa85e40] 264 - core 146 r2538 121396c - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=2 psy=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=48 lookahead_threads=5 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=0
Output #0, mp4, to '/work/disk1/HD-IFYL1081 A.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.32.100
Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv422p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 59.94 fps, 11988 tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc56.37.102 libx264
Stream #0:1(und): Audio: aac (libfaac) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc56.37.102 libfaac
Stream #0:2(und): Subtitle: mov_text ([8][0][0][0] / 0x0008), 1280x720 (default)
    Metadata:
      handler_name    : SubtitleHandler
      encoder         : Lavc56.37.102 mov_text
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (libfaac))
  Stream #0:2 -> #0:2 (mov_text (native) -> mov_text (native))
Press [q] to stop, [?] for help
frame=70473 fps=258 q=-1.0 Lsize=10888940kB time=00:19:35.72 bitrate=75869.9kbits/s video:10868826kB audio:18364kB subtitle:22kB other streams:0kB global headers:0kB muxing overhead: 0.015869%
[libx264 @ 0xa85e40] frame I:356   Avg QP: 0.00  size:368826
[libx264 @ 0xa85e40] frame P:70117 Avg QP: 0.00  size:156857
[libx264 @ 0xa85e40] mb I  I16..4: 74.5%  0.0% 25.5%
[libx264 @ 0xa85e40] mb P I16..4: 23.7% 0.0% 1.0% P16..4: 21.4% 3.1% 2.7% 0.0% 0.0% skip:48.1%
[libx264 @ 0xa85e40] 8x8 transform intra:0.0% inter:0.0%
[libx264 @ 0xa85e40] coded y,uvDC,uvAC intra: 77.0% 73.5% 73.4% inter: 33.8% 32.3% 32.3%
[libx264 @ 0xa85e40] i16 v,h,dc,p: 65% 34%  0%  0%
[libx264 @ 0xa85e40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 39% 36% 3% 3% 6% 4% 4% 3% 2%
[libx264 @ 0xa85e40] i8c dc,h,v,p: 27% 30% 44%  0%
[libx264 @ 0xa85e40] Weighted P-Frames: Y:0.5% UV:0.4%
[libx264 @ 0xa85e40] kb/s:75729.76


and now you can see if I examing the file it outputs, ffmpeg thinks it is 1313.98 seconds in length (vs the 1175.7 requested).


ffmpeg -i "/work/disk1/HD-IFYL1081 A.mp4"
ffmpeg version N-71957-g5f2b4a2 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --enable-shared --enable-gpl --enable-nonfree --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libvorbis --enable-libfaac --enable-libopenjpeg --enable-librtmp
  libavutil      54. 23.101 / 54. 23.101
  libavcodec     56. 37.102 / 56. 37.102
  libavformat    56. 32.100 / 56. 32.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/work/disk1/HD-IFYL1081 A.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.32.100
  Duration: 00:21:53.98, start: 0.021333, bitrate: 67887 kb/s
Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv422p, 1280x720 [SAR 1:1 DAR 16:9], 75729 kb/s, 59.94 fps, 59.94 tbr, 11988 tbn, 119.88 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream #0:2(und): Subtitle: mov_text (tx3g / 0x67337874), 1280x720, 0 kb/s (default)
    Metadata:
      handler_name    : SubtitleHandler
At least one output file must be specified


_______________________________________________
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

Reply via email to