Opened 10 years ago

Last modified 10 years ago

#3903 new enhancement

Cutting video file with invalid start time does not warn and produces invalid file

Reported by: ahthovaikied Owned by:
Priority: normal Component: ffmpeg
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Take a video file of length for example 10s.

Run:

$ ffmpeg -i file.whatever -ss 10:00:00 -t 00:00:10 -map 0 -c:v copy -c:a copy -c:s copy -f matroska out.mkv

FFmpeg does not warn on the invalid length and produces and invalid output file (not recognized by ffprobe!).

Change History (2)

comment:1 by Carl Eugen Hoyos, 10 years ago

To make this a valid ticket, please provide the complete, uncut console output.

comment:2 by ahthovaikied, 10 years ago

$ curl -s http://www.auby.no/files/video_tests/h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv > ref.mkv
$ ffmpeg -i ref.mkv -ss 10:00:00 -t 00:00:10 -map 0 -c:v copy -c:a copy -f matroska out.mkv
ffmpeg version N-65928-g7997d78 Copyright (c) 2000-2014 the FFmpeg developers
  built on Aug 27 2014 20:45:49 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-runtime-cpudetect --disable-ffserver --disable-ffplay --disable-encoders --disable-decoders --disable-filters --disable-debug --cpu=corei7
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  0.101 / 56.  0.101
  libavformat    56.  3.100 / 56.  3.100
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  0.103 /  5.  0.103
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
[matroska,webm @ 0xe7fca0] Could not find codec parameters for stream 2 (Audio: mp3, 48000 Hz, 2 channels, 160 kb/s): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for  Input Stream #0.1 : stereo
Guessed Channel Layout for  Input Stream #0.2 : stereo
Input #0, matroska,webm, from 'ref.mkv':
  Metadata:
    title           : Harry Potter 4[Eng-Hindi]Dual.Audio BRRIP 720p-=[champ_is_here]=-
    encoder         : libebml v1.0.0 + libmatroska v1.0.0
    creation_time   : 2011-01-07 07:42:53
  Duration: 00:00:57.61, start: 0.000000, bitrate: 613 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x528 [SAR 1:1 DAR 80:33], 25 fps, 25 tbr, 1k tbn, 47.95 tbc
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:1(eng): Audio: aac, 48000 Hz, 2 channels
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:2(hin): Audio: mp3, 48000 Hz, 2 channels, 160 kb/s
    Metadata:
      title           : -=[champ_is_here]=-
Output #0, matroska, to 'out.mkv':
  Metadata:
    title           : Harry Potter 4[Eng-Hindi]Dual.Audio BRRIP 720p-=[champ_is_here]=-
    encoder         : Lavf56.3.100
    Stream #0:0(eng): Video: h264 (H264 / 0x34363248), yuv420p, 1280x528 [SAR 1:1 DAR 80:33], q=2-31, 25 fps, 1k tbn, 1k tbc
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:1(eng): Audio: aac ([255][0][0][0] / 0x00FF), 48000 Hz, stereo
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:2(hin): Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, 160 kb/s
    Metadata:
      title           : -=[champ_is_here]=-
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
frame=    0 fps=0.0 q=-1.0 Lsize=       1kB time=00:00:00.00 bitrate=N/A    
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Just for information, FFprobe output:

$ ffprobe out.mkv 
ffprobe version n2.3.3 Copyright (c) 2007-2014 the FFmpeg developers
  built on Aug 19 2014 21:00:06 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-runtime-cpudetect --disable-ffserver --disable-encoder=vorbis --disable-encoder=aac --enable-x11grab --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --disable-debug --extra-libs=-ldl --cpu=corei7
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 48.100 / 55. 48.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.100 /  4. 11.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[matroska,webm @ 0x18e5080] Unknown entry 0x81
[matroska,webm @ 0x18e5080] Read error at pos. 175 (0xaf)
[matroska,webm @ 0x18e5080] Unknown entry 0x82
    Last message repeated 1 times
Truncating packet of size 16777216 to 880
out.mkv: End of file
Note: See TracTickets for help on using tickets.