On Jul 7, 2019, at 8:51 PM, Hu Saijun <saijunhu@outlook.com> wrote:
Hi,dear friends, recently I have a task which need cut the long videos to many segments. The concrete code I used as follow:
1. First I convert all video to mpeg4 codec. Use [cid:image001.png@01D53569.052114F0]
2. Second I cut the video in a simple python script. Use [cid:image002.png@01D53569.647DEC70]
3. Then when I decode the video, try to extract some i-frames and MVs,I got a error.. [cid:image003.png@01D53569.F5AEF5E0]
Is there a reason for transcoding to mpeg4 and then splitting? If you transcode them as separate segments in the first place, I don’t think you will see this issue (codec copying and splitting mpeg4 might be the problem). Something like: ffmpeg -ss ${start} -to ${end} -i ${inname} -vf scale=340:256,setsar=1:1 -q:v 1 -c:v mpeg4 ${output1} and repeat for however many cuts you need to make. P.S. It’s preferable to paste the command and output as text rather attach an image of them