gmf icon indicating copy to clipboard operation
gmf copied to clipboard

[Example request] The most asked use case on Stackoverflow: a bunch of images to a video (mp4/h264)

Open denismakogon opened this issue 7 years ago • 5 comments

Would someone mind to post an example of an application that takes a bunch of images and puts them inside a video (please, avoid any references to opencv).

denismakogon avatar Jun 23 '18 19:06 denismakogon

Could you please clarify your request, what does it mean "place inside video", you wanna make a video from sequence of images... or what? Please give some use case.

3d0c avatar Jun 23 '18 20:06 3d0c

Sorry for confusing you. So, the idea is - take a video file, split that onto images, and put them to a new video file. So, the original and a new video might be the same (ignoring sound).

denismakogon avatar Jun 23 '18 20:06 denismakogon

If the only thing you need is to remove audio streams — it could be easily done — take a look at tests and "transcode.go" example. Do you really need to convert frames into images first? If you want to get preview or something, you don't need to encode frames into "images" and then back into stream, you just can get it from original one without conversion. You can write me directly to [email protected] (in russian)

3d0c avatar Jun 23 '18 20:06 3d0c

sorry for mistake in email - [email protected]

3d0c avatar Jun 23 '18 21:06 3d0c

#42 still open, @3d0c what are the options to write an image to a frame?

Following the logic of video stream to JPEG transformation, the bare minimum requirements are:

  • be aware of FPS
  • codec
  • be aware of dimensions (H/W)

what else?

It seems like there has to be introduced new API endpoints:

func (p *Packet) SetFrames(fms []*Frame) error // to set frames
func (p *Packet) SetData(data [] byte) error // to initialize packet with image file content
func (f *Frame) Decode(r io.Reader) (*Frame, error) // to decode frame from image.Image or any other reader

denismakogon avatar Jun 29 '18 07:06 denismakogon