#!/bin/sh -x
# $1 - input video file, e.g. video.mp4
# $2 - timestamp, e.g. 00:33
# $3 - output image file, e.g. output.jpg
ffmpeg -ss $2 -i $1 -vframes 1 -q:v 2 $3
#!/bin/sh -x
# $1 - input file, e.g. input.mp4
ffmpeg -i "$1" -q:v 2 %06d.jpg
ffmpeg -f image2 -framerate 30 -i %06d.jpg -c:v libx264 out.mp4
@rlan So my issue is:
I am using h264 codec and mp4 as container format.
Steps: 1. split video to 3 components: <1> - <2> -<3> using ffmpeg cut (-ss, -t)
2. write the frames from component 2 to disk using "ffmpeg -i {video_file}.mp4 -vf 'fps={video_fps},format=yuv420p' {out_folder}/{prefix}%d.png"
3. convert these frames to video using: "ffmpeg -f concat -safe 0 -i '{frames_txt_file}' -c:v libx264 -vf 'fps={frame_rate},format=yuv420p' '{output_video_path}'.mp4"
4. concat: <1> - <new 2> - <3>: will result in the middle component to be a little darker. shift is clearly visible?