This indicated something was going wrong when processing transparent pixels. This bug only affected Stickers, which are GIFs with some transparent pixels. The buggy renditions were traced back to an FFmpeg command that we use to re-scale GIFs while retaining the original color palette: ffmpeg -i in.gif -filter_complex "scale=100:-1, split palettegen paletteuse" out.gif Unwilling to let the world go without pixel-perfect poop, I started hunting down the bug. Trim=start=80,setpts=PTS-STARTPTS \Ītrim=start=80,asetpts=PTS-STARTPTS \Ĭoncat concat=v=0:a=1" -map -map out.Notice that some parts of the image get stuck (eg, the top of this GIF) Trim=start=40:end=50,setpts=PTS-STARTPTS \Ītrim=start=40:end=50,asetpts=PTS-STARTPTS \Ĭoncat concat=v=0:a=1 \ So the command should be: ffmpeg -i utv.ts -filter_complex \ If you want to have audio too, You have to do the same for audio streams. What I did here? I trimmed first 30 sec, 40-50 sec and 80 sec to end, and then combined them into stream out1 with the concat filter.Ībout setpts: we need this because trim does not modify picture display time, and when we cut out 10 sec decoder counter does not see any frames for this 10 sec. Trim=start=40:end=50,setpts=PTS-STARTPTS \ Here is an example, lets assume that you want to cut out segments 30-40 sec (10 sec) and 50-80 sec (30 sec): ffmpeg -i in.ts -filter_complex \ Well, you still can use the trim filter for that. Instant gratification no need to re-encode.Also seeĪs you've seen above with the ffplay example some players allow you to crop upon playback. In this example the audio is just stream copied (re-muxed) since you probably don't need to re-encode it. Re-encode using the crop filter $ ffmpeg -i input.mp4 -vf crop=1280:720:0:0 -c:a copy output.mp4 Preview with ffplay $ ffplay -vf crop=1280:720:0:0 input.mp4ģ. So according to cropdetect we can use crop=1280:720:0:0. In this example the first 90 seconds is skipped and 10 frames are processed: $ ffmpeg -ss 90 -i input.mp4 -vframes 10 -vf cropdetect -f null. Get crop parametersĬropdetect can be used to provide the parameters for the crop filter.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |