1

This is the ffmpeg version I am working with on Debian testing -

$ ffmpeg -version
ffmpeg version 4.4.1-2+b1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (Debian 11.2.0-12)
configuration: --prefix=/usr --extra-version=2+b1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
libpostproc    55.  9.100 / 55.  9.100

This is the command I was trying to work with -

$ ffmpeg -ss 00:22:20 -t 60 -i 123.mkv 456.mkv

This comes from extracting/copying audio from a specific part of a video file, possible? which I had asked years ago.

I also had a look at FFMpeg : Creating a video clip of approx. 10 seconds when video duration is unknown without audio- but if I try to use the timestamp as showed in that, it errors out saying -

Invalid duration specification for ss: 00:22:20:0.0

The media file I am playing is around 50 odd minutes and I just want that one minute file 22:20 second and a minute after.

Has something changed in ffmpeg or the way it processes things. I have obviously changed the file names. Nevertheless, this is what is it shows the file as if I put it under mkvinfo

$ mkvinfo 456.mkv 
+ EBML head
|+ EBML version: 1
|+ EBML read version: 1
|+ Maximum EBML ID length: 4
|+ Maximum EBML size length: 8
|+ Document type: matroska
|+ Document type version: 4
|+ Document type read version: 2
+ Segment: size 6959454
|+ Seek head (subentries will be skipped)
|+ EBML void: size 81
|+ Segment information
| + Timestamp scale: 1000000
| + Title: 123
| + Multiplexing application: Lavf58.76.100
| + Writing application: Lavf58.76.100
| + Segment UID: 0x19 0xba 0x01 0xe0 0xed 0x6f 0x79 0xef 0xfb 0x9d 0xe6 0xcd 0x2b 0xad 0x2f 0x79
| + Duration: 00:23:54.905000000
|+ Tracks
| + Track
|  + Track number: 1 (track ID for mkvmerge & mkvextract: 0)
|  + Track UID: 4989308985802999081
|  + "Lacing" flag: 0
|  + Name: abcd
|  + Language: und
|  + Codec ID: V_MPEG4/ISO/AVC
|  + Track type: video
|  + Default duration: 00:00:00.041708333 (23.976 frames/fields per second for a video track)
|  + Video track
|   + Pixel width: 1280
|   + Pixel height: 720
|   + Interlaced: 2
|   + Video colour information
|    + Horizontal chroma siting: 1
|    + Vertical chroma siting: 2
|  + Codec's private data: size 45 (H.264 profile: High @L3.1)
| + Track
|  + Track number: 2 (track ID for mkvmerge & mkvextract: 1)
|  + Track UID: 5858605359486045911
|  + "Lacing" flag: 0
|  + Name: abcd
|  + Language: eng
|  + Codec ID: A_VORBIS
|  + Track type: audio
|  + Audio track
|   + Channels: 2
|   + Sampling frequency: 48000
|   + Bit depth: 32
|  + Codec's private data: size 3959
| + Track
|  + Track number: 3 (track ID for mkvmerge & mkvextract: 2)
|  + Track UID: 6757137498994684877
|  + "Lacing" flag: 0
|  + Name: abcd
|  + Language: eng
|  + Codec ID: S_TEXT/ASS
|  + Track type: subtitles
|  + Codec's private data: size 576
|+ Tags
| + Tag
|  + Targets
|  + Simple
|   + Name: COMMENT
|   + String: abcd
|  + Simple
|   + Name: ENCODER
|   + String: Lavf58.76.100
| + Tag
|  + Targets
|   + Track UID: 4989308985802999081
|  + Simple
|   + Name: BPS
|   + String: 1050683
|  + Simple
|   + Name: BPS
|   + Tag language: eng
|   + String: 1050683
|  + Simple
|   + Name: DURATION
|   + Tag language: eng
|   + String: 00:47:01.110000000
|  + Simple
|   + Name: NUMBER_OF_FRAMES
|   + String: 67639
|  + Simple
|   + Name: NUMBER_OF_FRAMES
|   + Tag language: eng
|   + String: 67639
|  + Simple
|   + Name: NUMBER_OF_BYTES
|   + String: 370511729
|  + Simple
|   + Name: NUMBER_OF_BYTES
|   + Tag language: eng
|   + String: 370511729
|  + Simple
|   + Name: _STATISTICS_WRITING_APP
|   + String: mkvmerge v13.0.0 ('The Juggler') 64bit
|  + Simple
|   + Name: _STATISTICS_WRITING_APP
|   + Tag language: eng
|   + String: mkvmerge v13.0.0 ('The Juggler') 64bit
|  + Simple
|   + Name: _STATISTICS_WRITING_DATE_UTC
|   + String: 2018-09-20 14:51:30
|  + Simple
|   + Name: _STATISTICS_WRITING_DATE_UTC
|   + Tag language: eng
|   + String: 2018-09-20 14:51:30
|  + Simple
|   + Name: _STATISTICS_TAGS
|   + String: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
|  + Simple
|   + Name: _STATISTICS_TAGS
|   + Tag language: eng
|   + String: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
|  + Simple
|   + Name: ENCODER
|   + String: Lavc58.134.100 libx264
|  + Simple
|   + Name: DURATION
|   + String: 00:01:00.022000000
| + Tag
|  + Targets
|   + Track UID: 5858605359486045911
|  + Simple
|   + Name: BPS
|   + String: 640000
|  + Simple
|   + Name: BPS
|   + Tag language: eng
|   + String: 640000
|  + Simple
|   + Name: DURATION
|   + Tag language: eng
|   + String: 00:47:01.120000000
|  + Simple
|   + Name: NUMBER_OF_FRAMES
|   + String: 88160
|  + Simple
|   + Name: NUMBER_OF_FRAMES
|   + Tag language: eng
|   + String: 88160
|  + Simple
|   + Name: NUMBER_OF_BYTES
|   + String: 225689600
|  + Simple
|   + Name: NUMBER_OF_BYTES
|   + Tag language: eng
|   + String: 225689600
|  + Simple
|   + Name: _STATISTICS_WRITING_APP
|   + String: mkvmerge v13.0.0 ('The Juggler') 64bit
|  + Simple
|   + Name: _STATISTICS_WRITING_APP
|   + Tag language: eng
|   + String: mkvmerge v13.0.0 ('The Juggler') 64bit
|  + Simple
|   + Name: _STATISTICS_WRITING_DATE_UTC
|   + String: 2018-09-20 14:51:30
|  + Simple
|   + Name: _STATISTICS_WRITING_DATE_UTC
|   + Tag language: eng
|   + String: 2018-09-20 14:51:30
|  + Simple
|   + Name: _STATISTICS_TAGS
|   + String: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
|  + Simple
|   + Name: _STATISTICS_TAGS
|   + Tag language: eng
|   + String: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
|  + Simple
|   + Name: ENCODER
|   + String: Lavc58.134.100 libvorbis
|  + Simple
|   + Name: DURATION
|   + String: 00:01:00.003000000
| + Tag
|  + Targets
|   + Track UID: 6757137498994684877
|  + Simple
|   + Name: BPS
|   + String: 40
|  + Simple
|   + Name: BPS
|   + Tag language: eng
|   + String: 40
|  + Simple
|   + Name: DURATION
|   + Tag language: eng
|   + String: 00:46:08.244000000
|  + Simple
|   + Name: NUMBER_OF_FRAMES
|   + String: 636
|  + Simple
|   + Name: NUMBER_OF_FRAMES
|   + Tag language: eng
|   + String: 636
|  + Simple
|   + Name: NUMBER_OF_BYTES
|   + String: 14113
|  + Simple
|   + Name: NUMBER_OF_BYTES
|   + Tag language: eng
|   + String: 14113
|  + Simple
|   + Name: _STATISTICS_WRITING_APP
|   + String: mkvmerge v13.0.0 ('The Juggler') 64bit
|  + Simple
|   + Name: _STATISTICS_WRITING_APP
|   + Tag language: eng
|   + String: mkvmerge v13.0.0 ('The Juggler') 64bit
|  + Simple
|   + Name: _STATISTICS_WRITING_DATE_UTC
|   + String: 2018-09-20 14:51:30
|  + Simple
|   + Name: _STATISTICS_WRITING_DATE_UTC
|   + Tag language: eng
|   + String: 2018-09-20 14:51:30
|  + Simple
|   + Name: _STATISTICS_TAGS
|   + String: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
|  + Simple
|   + Name: _STATISTICS_TAGS
|   + Tag language: eng
|   + String: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
|  + Simple
|   + Name: ENCODER
|   + String: Lavc58.134.100 ssa
|  + Simple
|   + Name: DURATION
|   + String: 00:23:54.905000000
|+ Cluster

Now what I can infer from the above is that ffmpeg merely cut the video and hence shows properties from the old version including the time although the media file I created was around a minute.

Is there anyway to do better, meaning it uses the ffmpeg version from today and gives the same, also the duration would change to one minute rather than the 23 minutes it is showing?

FWIW, mkvmerge from my current system is -

$ mkvmerge --veion
mkvmerge v64.0.0 ('Willows') 64-bit
4
  • 1
    The order of parameters in that answer looks wrong to me. The duration is an output option. Does ffmpeg -ss 00:22:20 -i 123.mkv -t 60 456.mkv work?
    – Hermann
    Jan 6, 2022 at 19:57
  • That worked, can you put it as answer so I can reward you thank you :)
    – shirish
    Jan 6, 2022 at 20:19
  • 00:22:20:0.0 is not a valid time duration (and the link you gave doesn't say that it would be).
    – rowboat
    Jan 7, 2022 at 3:52
  • @rowboat I overlooked that mistake as it was not mentioned in the given commands.
    – Hermann
    Jan 7, 2022 at 7:55

1 Answer 1

1

The sample you posted looks fine, yet the error message suggests there was an extra 0.0 appended to the start time when you executed the command. This should work:

ffmpeg -ss 00:22:20 -t 60 -i 123.mkv 456.mkv
3
  • Aha, that is what I was doing wrong, thank you for sharing :)
    – shirish
    Jan 7, 2022 at 0:52
  • 1
    -t is not an ouput-only option
    – rowboat
    Jan 7, 2022 at 3:58
  • @rowboat Indeed. The man-page suggests, ffmpeg -ss 00:22:20 -t 60 -i 123.mkv 456.mkv should work, too. I have no idea why it would not.
    – Hermann
    Jan 7, 2022 at 7:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .