You are not logged in.
ffmpeg -i ~/input.mkv -ss 00:02:28 -to 00:02:37 ./source/output.mkvoutputs a completely different part of the video, a different version of this video outputs correctly but the input video is lower quality.
How do I find out what causes this issue?
Last edited by mega0drive (2023-01-26 00:38:43)
Offline
Is the syntax w/o -ss legal?
That aside, try mkvinfo, there're probably multiple video streams (concatenated?) and ffmpeg picks the wrong one, or maybe audio and video are of different length or whatnot.
How did you obtain the timestamps? ffplay?
Offline
@seth
oops, forum typo, fixed it
mkvinfo doesn't show multiple video streams, it does show that the 'default duration' for the video and audio streams are different though, is that something? 00:00:00.041708333 vs 00:00:00.085333333 (video and audio respectively)
i got the time stamps from watching it in smplayer, had no trouble with other files doing it like that
I tried just copying the video stream but it still doesn't clip the part I want
Last edited by mega0drive (2023-01-26 00:44:42)
Offline
The order of arguments is important in ffmpeg. Your `-ss` and `-to` do not apply to the input file. What you do is re-encode the entire file using default settings (usually producing poor quality) and then cut the output, using timestamps from the output stream, not the input stream.
If you wanted to cut a fragment from the input, the options should apply to the input, not to the output file:
ffmpeg -ss START -to END -i INPUT ENCODING_OPTIONS… OUTPUTLast edited by mpan (2023-01-26 03:23:34)
Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!
Offline
@mpan did not realise that, thank you
ffmpeg -ss 00:02:28 -to 00:02:37 -i ~/input.mkv -c:v copy -map 0:0 ./source/output.mkvhas the same issue, but when trying ffplay like @seth suggested i noticed the video im trying to clip has an opening section missing which changes the timestamps vs when it's opened in smplayer or vlc, could someone explain why that might be?
Last edited by mega0drive (2023-01-26 16:20:04)
Offline
It's probably because the audio track is twice as long as the video and probably starts ahead.
Matroska is a really versatile format (hence the name) and allows offsets in the container as well as timestamp scaling; simply adding a start and endposition might not be enough information to know what you want and ffmpeg guesses/defaults "wrong" (you could possibly use mkvmerge instead)
Offline