studio icon indicating copy to clipboard operation
studio copied to clipboard

video transitions instead of images.

Open Sudheerbolla opened this issue 4 years ago • 17 comments
trafficstars

I know it's possible for videos, but are you planning on extending it to videos in this app?

Sudheerbolla avatar Mar 30 '21 09:03 Sudheerbolla

@Sudheerbolla I would like to add video transition, but it's quite tricky to do so.

seanghay avatar Apr 26 '21 07:04 seanghay

@seanghay Can you help me with that. I mean, how to achieve that.

Sudheerbolla avatar Apr 26 '21 21:04 Sudheerbolla

@seanghay Can you help me with that. I mean, how to achieve that.

Yes, I have some clue on how to do it, but it's taking sometime.

Let me share what I thought:

  1. Load each video and audio sample using MediaExtractor.
  2. Decode them with MediaCodec + MediaFormat.
  3. Send decoded buffer accordingly to OpenGL Surface (Offscreen Surface) to apply transformations such as filter, transition..
  4. Create another MediaCodec for Encoding output buffer from the OpenGL surface.
  5. Make sure timestamps are aligned properly so it won't be messed up.
  6. Merge audios from different videos into a single audio using MediaCodec. (Codec: avc)
  7. Mux the audio buffer and the output video buffer to a single video container using MediaMuxer.

I'm not professional in this field, so if I said anything wrong please correct me.

seanghay avatar Apr 26 '21 21:04 seanghay

@Sudheerbolla That's what I can think of.

seanghay avatar Apr 26 '21 21:04 seanghay

Hi @seanghay , I have problem when blur video when progress in openGL . Do you know solution ? Thanks.

kekhong95 avatar Jul 25 '21 08:07 kekhong95

Hi @seanghay , I have problem when blur video when progress in openGL . Do you know solution ? Thanks.

Hi @kekhong95, can you explain the issue you're facing?

seanghay avatar Jul 25 '21 09:07 seanghay

Hi @seanghay

I try to blur video background in openGL same you blur with photo in project . But you using canvas to draw blur bitmap as background . But with video i do not read bitmap to blur , glReadBit will take time . So I want blur it in OpenGL . If you can solution please tell me And I want using gl transition in your project with video it can work ? Thanks for supports

kekhong95 avatar Jul 25 '21 10:07 kekhong95

@kekhong95 You need to render video into a SurfaceTexture and use a shader to make that video blurry in realtime. Video and photo are basically the same. Check out this Shader I wrote: https://github.com/seanghay/studio/blob/master/studio/src/main/java/com/seanghay/studio/gles/shader/filter/GaussianBlurFilterShader.kt

seanghay avatar Jul 25 '21 10:07 seanghay

@kekhong95 Also check this sample as well, it might help. https://github.com/google/grafika

seanghay avatar Jul 25 '21 10:07 seanghay

Hi @seanghay , thanks for information , But when I modify using transition with video , I do not know load currentTexture of fromFrameBuffer. with photo you using Bitmap to texture , with video scene last and next frame , but I do not know them solution to progess it , If you can solution please share to me.

kekhong95 avatar Jul 25 '21 17:07 kekhong95

@kekhong95 you'll need to use MediaCodec + MediaExtractor to decode video into SurfaceTexture. You'll also need to manage audio as well. MediaCodec is the key.

seanghay avatar Jul 25 '21 17:07 seanghay

For merging multiple .mp4 files(video + audio) you'll have to arrange timestamp for reach individual video.

seanghay avatar Jul 25 '21 17:07 seanghay

No no . I do not know progess with frame when transition , not video process , I know video decoder and encoder with MediaCodec + MediaExtractor + MediaMux , but i do know process transition frame with video image

kekhong95 avatar Jul 25 '21 18:07 kekhong95

I modify onDraw of VideoComposer for video progress , but it not work ? Do I mistake ?

kekhong95 avatar Jul 25 '21 18:07 kekhong95

I modify onDraw of VideoComposer for video progress , but it not work ? Do I mistake ?

Have you succeeded with video drawing?

abkoradiya avatar Sep 22 '21 05:09 abkoradiya

@seanghay Can you help me with that. I mean, how to achieve that.

Yes, I have some clue on how to do it, but it's taking sometime.

Let me share what I thought:

  1. Load each video and audio sample using MediaExtractor.
  2. Decode them with MediaCodec + MediaFormat.
  3. Send decoded buffer accordingly to OpenGL Surface (Offscreen Surface) to apply transformations such as filter, transition..
  4. Create another MediaCodec for Encoding output buffer from the OpenGL surface.
  5. Make sure timestamps are aligned properly so it won't be messed up.
  6. Merge audios from different videos into a single audio using MediaCodec. (Codec: avc)
  7. Mux the audio buffer and the output video buffer to a single video container using MediaMuxer.

I'm not professional in this field, so if I said anything wrong please correct me.

Can you participate in hecktoberfest event with this repo? If so, other developer can help for this implementation.

abkoradiya avatar Oct 08 '21 10:10 abkoradiya

Hello @kekhong95 , @abkoradiya . Did any of you guys have implemented it for videos. I am about to start working on this and need your help/inputs regarding this.

Thanks in advance.

Sudheerbolla avatar Nov 23 '21 08:11 Sudheerbolla