cutting video with ffmpeg gives no image

Questions involving a Windows version of FFmpeg.
Post Reply
lrp
Posts: 3
Joined: Sun Jun 25, 2017 4:26 pm

cutting video with ffmpeg gives no image

Post by lrp » Mon Sep 11, 2017 3:29 pm

I am trying to cut videos I get from a IPTV add-on in Kodi. The original video can be watched with VLC, Mplayer, xine, etc, but after being copied there is no image. According to mediainfo there is a video stream but nothing can be seen. The command I use is:

ffmpeg -y -i test-1.mpeg -scodec copy -vcodec copy -c:a copy -map 0 -ss 00:00:10.000 -t 00:00:10.000 test-1-cut.mpeg

I suppose there is something wrong with the original videos recorded by kodi, but they give no problem with any player. A short example video is this one:

https://drive.google.com/open?id=0B0WC8 ... zhxRUxkOXc

The output with the -report option is this one (it is too long to be copied here, sorry)

https://drive.google.com/open?id=0B0WC8 ... WpfOXlzUkU

Could someone help me to fix this problem, please?

pepoluan
Posts: 4
Joined: Sun Aug 27, 2017 6:02 am

Re: cutting video with ffmpeg gives no image

Post by pepoluan » Mon Sep 25, 2017 4:09 pm

I tried your sample with your exact command line, and it works.

Granted, there's about 1.5 seconds at the beginning where there was no motion, a clear indication of "missing keyframe", a certain danger of using the "copy" method.

To the best of my knowledge, the only sure-fire method to prevent this "missing keyframe" incident is to re-encode the clip. If I use:

Code: Select all

ffmpeg -y -i test-1.mpeg -scodec copy -vcodec libx264 -crf 18 -c:a copy -map 0 -ss 00:00:10.000 -t 00:00:10.000 test-1-cut-2.mpeg
the clip starts perfectly from the very beginning.

lrp
Posts: 3
Joined: Sun Jun 25, 2017 4:26 pm

Re: cutting video with ffmpeg gives no image

Post by lrp » Sat Sep 30, 2017 11:57 pm

thank you for the feedback. The fact is that I cannot see any image, trying with both VLC and with MPlayer in linux. Maybe it is a problem with my players, or yours is more forgiving...

In any case I have just solved my problem thanks to the answer by the developper of the addon I am using, when I finally asked to him. Simply I have changed the filename of the output file to .ts. That is the command would be something like:
ffmpeg -y -i test-1.mpeg -scodec copy -vcodec copy -c:a copy -map 0 -ss 00:00:10.000 -t 00:00:10.000 test-1-cut.ts

The .ts file is playable from initial time, with both VLC and Mplayer.

Post Reply
'