3

I am new to working with FFmpeg and would like to automate video trimming but can't find a way to do it.

So, what I would like to achieve is this: I want to delete the beginning of a video file until a certain pixel (x,y) is colored gray (0x303030).

I am sure that somewhere in the video, say, pixel (100,50) will be colored gray (0x303030). And I want the video to begin exactly at this point.

Optionally it would be great if I could move a few micro/mili seconds back-and-forth from this exact point so can have some spare time.

Tried many complex commands but nothing works for me :(

For example I've tried:

ffmpeg -i in.mp4 -vf "select='gt(scene,0.01)+eq(pict_type\,I)*eq(r(X,Y)\,128)*eq(g(X,Y)\,128)*eq(b(X,Y)\,128)',setpts=N/FRAME_RATE/TB" output.mp4

The same thing I want to do from the end of the video...

Please help!

1

1 Answer 1

0

Does the in.mp4 have some audio that you could use instead to find where to cut?

You could also try to do something similar to this... Find video file position using an image match

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Feb 17, 2023 at 11:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .