Cutting a video with FFmpeg produces audio-only output

1

I have to extract some small clips with FFmpeg but the movie produced has no video but only audio even if it is correctly an mp4 file.

Command:

ffmpeg -i ORIGINAL.mp4 -ss 5.263 -t 2.085 -y -avoid_negative_ts 1 -c copy OUTPUT.mp4

There was no output error from the console.

Here is the image of the files: screenshot

The generated mp4 file has only audio and no video. What is the problem?

Paperauz

Posted 2019-02-19T18:38:07.423

Reputation: 21

Answers

1

Video can only be spliced at keyframes. If there is no keyframe at -t 2.085, this operation can not be completed. You must transcode the video to covert the frame at -t 2.085 into a keyframe. e.g.

ffmpeg -i ORIGINAL.mp4 -ss 5.263 -t 2.085 -y -avoid_negative_ts 1 -acodec copy OUTPUT.mp4

szatmary

Posted 2019-02-19T18:38:07.423

Reputation: 2 181

I would have preferred not to re-encode the video so as not to lose quality, thanks – Paperauz – 2019-04-03T20:17:20.650

Then the output will contain no decodable frames. Its one of the other, You can have both. – szatmary – 2019-04-03T20:19:36.417