androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.63k stars 386 forks source link

Ability to use setDebugViewProvider in Transformer.Builder without the need to create an Output file #816

Open pawaom opened 11 months ago

pawaom commented 11 months ago

When filing a feature request:

[REQUIRED] Use case description

Ability to use setDebugViewProvider in Transformer.Builder without the need to create an Output file

When we checked the code for getDebugPreviewSurfaceView this

and the transformer.start(composition, outputPath); this

it seems FinalShaderProgramWrapper doesnot need to create any file as its just implements the GlShaderProgram also even when we try to mix audio and video the Video is created and the output file works perfectly however the debugpreview doesnot play any audio so there is no need to create a separate file just for the preview.

Proposed solution

allow ability to pass null for oputputpath so we dont need to create a file just for the preview transformer.start(composition, null);

Alternatives considered

We tried passing null for the oputputpath however it gives an error.

dway123 commented 11 months ago

Transformer is intended for exporting edited files, not previewing. What is your use case, for outputting to a SurfaceView? If the goal is to use this for previewing, ExoPlayer.setVideoEffects may allow you to play a video or image and output with VideoFrameProcessor effects applied.

pawaom commented 11 months ago

we want to have the ability for the user to preview the live edits, we know about ExoPlayer.setVideoEffects

But it has lot of limitations which I mentioned here

we have following requirments 1) ability to handle each video separately which I think is currently in development 2) I tried to implement the picture in picture overly but there seems to be no Textureoverlay that can manage this 3) Exoplayer applies changes to all the videos which will require additional management which seems to be repletion of existing code 4) FinalShaderProgramWrapper is the prefect code that will satisfy various requirements for developers who want to manage various effects instead of writing their own logic which might be just a repletion of the code 5) creating an additional file just for a preview will take up precious disk space 6) if we can manage the PIP effect using just ExoPlayer.setVideoEffects it will be great for other requirements we will try to manage other things although handling individual video is much easier. 7) our main aim is to avoid repeating the same code for exoplayer that has already been implemented in the Transformer

droid-girl commented 11 months ago

@pawaom thank you for clarifying your requirements in such detail. The team is currently working on the new feature to allow editing preview before the export without the need to create an output file. It should cover all your requirements for the preview. To cover the PIP effect question, I will reply in more detail in the original question (806)

dway123 commented 11 months ago

Yes, we're working on a Player that should allow for multiple input videos (ex. PIP) to be previewed, as well as other player features, like seeking, pausing, etc.

Transformer is intended for file export, so I don't think we currently plan to support outputting to a GlSurfaceView instead of a file. (The current GlSurfaceView support was actually only intended for internal debugging for now, to show how far we got in an export)

pawaom commented 11 months ago

@droid-girl @dway123 thanks for the reply, at the moment we have decided for a hybrid solution, have the pip effect in glsurfaceview and rest of the things using ExoPlayer.setVideoEffects

Its great to know the multiple input videos (ex. PIP) is in development hopefully these features will be in focus 1) ability to handle the Audio of mulitple inputs simultaneously, since both or multiple videos might have audio an (audio on audio ) feature will be required 2) ability to handle effects on each video separately and in combination for example we can scale the "Anchor/Background video", rotate the overlay video individually and apply grayscale effect to all the videos simultaneously

droid-girl commented 11 months ago

@pawaom thank you for your input.

  1. We currently support 2 sequences: where 1 sequence is a sequence of videos and the second sequence is an audio track. The library does support audio mixing with a limitation that the second audio track is a looping track. The team is working on supporting more functionality
  2. this enhancement is on our roadmap