0

I don't understand if I am missing a parameter or am I wrong to understand the documentation. I have a program that forces me to use FFmpeg (so I can't use ffprobe). FFMpeg I am using "N-99928-g96f1b45b8c". I have a MKV x265 (movie) with FLAC, 2 ASS and chapters. I have to extract exactly from millisecond "A" to millisecond "B" quiandi -ss and -to (if I'm not mistaken). Output must only be an .mp4 with this trim (no audio, no subs etc).

Commands I've tried:

ffmpeg -ss 00:40:42.210 -i "Y:\Anime2\Movie1.mkv" -to 00:40:44.210 -copyts -map 0:v -codec libx264 -crf 8 -sn "D:\raw.mp4"

or

ffmpeg -ss 00:40:42.210 -i "Y:\Anime2\Movie1.mkv" -to 00:40:44.210 -copyts -start_at_zero -map 0:v "D:\raw.mp4"

or instead of -start_at_zero I tried: avoid_negative_ts make_zero

But nothing... It creates an mp4 of that duration but if open it is all black and on mediainfo as duration in the general section it tells me the value I put in -to (so it has a duration of 44: 21s instead of 1960ms). this is a problem related to ffmpeg and -ss because with MPV it creates the cut without problems (only MPV cannot be used).

-copyts I added it because it must be exactly from that ms to the other ms. (0-47 frames or 1-48frames); -map 0:v I added it because the audio track etc. they are not needed; -sn I added it because from what I understand it must be specified (even if ass cannot be added to an .mp4 regardless);

So, my problem is that it trims me but the file it generates is all black (if open it is all black) and the duration is wrong (it should be 1960ms, about 2s and instead it says it is 44minutes and 21seconds, which is the -to value entered). The time values are in HH: MM: SS.xxx and I have to use -to (so no -t and frames).

Edit1: Quick Seek, I can't use the slow one (it's too slow).

Thanks in advance for those who reveal the mystery

1 Answer 1

0

Fixed adding -pix_fmt yuv420p after -crf 4. It seems that quicktime 7 (Sh@*) does not read videos well if this parameter is not forced to ffmpeg command. Final working command (trim on aegisub):

"#{encbin}" -ss #{startt} -sn -an -i "#{inpath}\#{input}" -vframes #{lenf} -c:v libx264 -r 24000/1001 -crf 4 -pix_fmt yuv420p "#{prefix}/#{output}[#{startf}-#{endf}].mp4"

Final ffmpeg command:

ffmpeg -ss 00:40:42.210 -sn -an -i "Y:\Anime2\Movie1.mkv" -vframes 48 -c:v libx264 -r 24000/1001 -crf 4 -pix_fmt yuv420p "D:\raw.mp4"

You must log in to answer this question.

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