FORUMS: list search recent posts

How to Extract frames from a vide, process them and then reinsert them in their respective places

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Yogi Yang
How to Extract frames from a vide, process them and then reinsert them in their respective places
on Aug 26, 2011 at 2:56:24 pm

Hello I am new to FFMPEG and am trying to find solution for my typical requirements.

I have a need for extracting a few frames from a given video file as JPEG files. Then process these files in Photoshop and after processing them I want to reinsert them into the same video file they were extracted from at their respective location.

Is such an operation possible using FFMPEG?

Thanks in advance.


Return to posts index

Michael Rampe
Re: How to Extract frames from a vide, process them and then reinsert them in their respective places
on Aug 27, 2011 at 12:31:31 am

[Yogi Yang] "I have a need for extracting a few frames from a given video file as JPEG files. Then process these files in Photoshop and after processing them I want to reinsert them into the same video file they were extracted from at their respective location."

Best option would be to dump the whole media file as an image sequence, process the frames you want without changing the size or filename and then convert the whole lot back to a new media file.

There really is not an option to insert images otherwise.

Michael


Return to posts index

Yogi Yang
Re: How to Extract frames from a vide, process them and then reinsert them in their respective places
on Aug 31, 2011 at 7:06:05 am

Thanks for your help.

But then how should I handle Audio of that particular Video?

Can you please guide me as I am new to FFMPEG?

Thanks in advance.


--
Yogi Yang


Return to posts index


Michael Rampe
Re: How to Extract frames from a vide, process them and then reinsert them in their respective places
on Sep 1, 2011 at 12:44:05 am

[Yogi Yang] "But then how should I handle Audio of that particular Video?

Can you please guide me as I am new to FFMPEG?"


sure.

NOTE: "tilt_shift_4.mp4" has audio and video, is 1920x1080 and is 25 fps.

To split the original to jpg files:

$ ffmpeg -i tilt_shift_4.mp4 -vcodec mjpeg -sameq -f image2 temp-%03d.jpg

Then edit the selected files you wish to change in Photoshop or your favourite image editing app. Save the file[s] (making sure the name does not change.

To put them back together with the source audio and compress (using recent FFmpeg and libx264 in this example):

$ ffmpeg -f image2 -i temp-%03d.jpg -i tilt_shift_4.mp4 -acodec copy -vcodec libx264 -b 2000k -preset medium -r 25 combined.mp4

Let me know if this works for you....

Michael


Return to posts index

Yogi Yang
Re: How to Extract frames from a vide, process them and then reinsert them in their respective places
on Sep 2, 2011 at 6:45:59 am

Thanks a lot for helping me out.

It does work perfectly!

What happens that most of the time I will have to produce mpg files and not mp4 files.

I observed while experimenting that we cannot build mpg file with less than 25 fps. Any idea as to why. I am asking this because I have to process avi files and these files at times have very low frame rate like for example 12 fps.

Thanks again.


--
Yogi Yang


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]