On Fri, Jul 12, 2024 at 1:04 AM Mark Filipak <markfilipak.i...@gmail.com> wrote:
> Try this: > -filter_complex "shuffleframes=<pattern>" > It's worked for me. > Hi Mark and Paul, Sorry for the delay. Thanks very much for the "shuffleframes" filter tip, this seems the right tool to use, even if it implies reencoding. My tests confirmed it works perfectly when the video starts with a mangled 5-frames group: Input: B A E C D - B' A' E' C' D' - B" A" E" C" D" => jaggy shuffleframes = 1 0 3 4 2 Output: A B C D E - A' B' C' D' E' - A" B" C" D" E" => smooth Yay :-) In actual files from the GoPro however, the 5-frame pattern does not always start at the first frame of the video. For example: Input: X - B A E C D - B' A' E' C' D' - B" A" E" C" D" => jaggy shuffleframes = 1 0 3 4 2 Output: B X E C A - B' D E' C' A' - B" D' E" C" A" => jaggy too I can work around the problem and do the fix in two steps : 1. extract the part with "5 frames groups" from the source, discarding the 1st frame by seeking to 40ms for example (as a frame is 1/30s), like so: ffmpeg -i in_bad_frame_order.mp4 -ss 0.04 extract.mp4 2. shuffle frames in that extract to get them in the right order like so: ffmpeg -i extract.mp4 -vf "shuffleframes=1 0 3 4 2" out.mp4 But that means passing through 2 encodings. I then tried to do it in one step: ffmpeg -i in_bad_frame_order.mp4 -ss 0.04 -vf "shuffleframes=1 0 3 4 2" out.mp4 But the result is still jaggy, so it seems the filter does still count the frames skipped by the seek :-( I also tried to put the seek before the input, to no avail: ffmpeg -ss 0.04 -i in_bad_frame_order.mp4 -vf "shuffleframes=1 0 3 4 2" out.mp4 Is there a way to achieve this "seek+shuffleframes" in a single pass ? Kind regards, Vincent _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".