Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Command

ffmpeg -ss 5:09 -i foo.mkv -to 5:10 -c copy bar.mkv

works exactly like

ffmpeg -ss 5:09 -i foo.mkv -t 5:10 -c copy bar.mkv

Is it a bug?

Using Zeranoe git-bd75651 for Windows 64-bit

>ffmpeg -version
ffmpeg version N-57906-gbd75651
built on Nov  4 2013 18:09:19 with gcc 4.8.2 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 -
-disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enabl
e-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --ena
ble-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmo
dplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger
--enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enab
le-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis -
-enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-li
bxvid --enable-zlib
libavutil      52. 51.100 / 52. 51.100
libavcodec     55. 41.100 / 55. 41.100
libavformat    55. 21.100 / 55. 21.100
libavdevice    55.  5.100 / 55.  5.100
libavfilter     3. 90.101 /  3. 90.101
libswscale      2.  5.101 /  2.  5.101
libswresample   0. 17.104 /  0. 17.104
libpostproc    52.  3.100 / 52.  3.100
share|improve this question
    
surprisingly, the man page does not list a -to option. linux.die.net/man/1/ffmpeg –  Frank Thomas Nov 6 '13 at 20:51
    
@FrankThomas Absolutely outdated manpage.. –  slhck Nov 6 '13 at 21:52

2 Answers 2

up vote 0 down vote accepted

The real answer is that it works as expected. The -ss option specified before the input lets ffmpeg seek to that position first and then start encoding at 00:00:00 as a time stamp.

This means that it does not matter if you encode for 5 minutes with -t or encode up to 00:05:00 with -to – because you started at 00:00:00.

If you want to start at a later timestamp, cut the file by using -ss after -i. That way, ffmpeg will encode, but start outputting at the specified time stamp, which makes the options work as you expect them to.

share|improve this answer

From ffmpeg documentation

‘-t duration (output)’ Stop writing the output after its duration reaches duration. duration may be a number in seconds, or in hh:mm:ss[.xxx] form.

-to and -t are mutually exclusive and -t has priority.

‘-to position (output)’ Stop writing the output at position. position may be a number in seconds, or in hh:mm:ss[.xxx] form.

-to and -t are mutually exclusive and -t has priority.

share|improve this answer
    
I still don't get it as both this options give the same result: 5:12 length video –  Vantuz Nov 6 '13 at 20:57
1  
@Vantuz No it is not a bug, they work similarly but the difference -t stops writing the output after the duration provided, while -to will stop at a postion given –  meda Nov 6 '13 at 21:03
    
-to gets position relatively output file? So, is there a way i can specify as stop point position relatively input file? So as i could get 1 min video specifying 5:00 as start point and 6:00 as end? –  Vantuz Nov 6 '13 at 21:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.