Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

PhotoMovie

> 编程语言
Open source

Using your photos to create cool videos.(高仿抖音照片电影功能)

694 stars0 likes2 views
WebsiteGitHub

About

中文简介

PhotoMovie can easily achieve the function of PhotoMovie like TikTok. The functions are shown below.

Filter

Transition

Gradle

add Maven

groovy
 allprojects {
		repositories {
			...
			maven { url 'https://www.jitpack.io' }
		}
	}

add implementation

groovy
dependencies {
    implementation 'com.github.yellowcath:PhotoMovie:1.6.4'
}

Changelog

1.6.0

  • Synchronous remix while recording video

Recording PhotoMovie with Music
Before:------------Record Video------------>------Mix Music------>End
Now: --------Record Video And Music------>End

1.6.1

  • Support to add watermark
java
GLMovieRenderer.setWaterMark(bitmap,dstRect,alpha);
GLMovieRenderer.setWaterMark(text,textSize,textColor,x,y);

1.6.2

  • Fixed memory leak when switching transfer animation in demo

1.6.3

  • Fixed crash of encoder "OMX.MTK.VIDEO.ENCODER.AVC"

1.6.4

  • Fixed: non-AAC format music recording without looping

Usage

For reference DemoPresenter

…

Extend the functionality

PhotoMovie uses a modular design, and each part can be customized and replaced.

Class Diagram

  • MovieSegment:Each MovieSegment has a specific length of time during which images are played in a specific way. For example

ScaleSegment will do scale animation. EndGaussianBlurSegment will do a gaussian blur animation from clear to blurry

  • PhotoMovie:PhotoMovie stands for the Movie itself,A complete PhotoMovie consists of a PhotoSource and a series of MovieSegment,images are allocated to MovieSegment through PhotoAllocator.

  • MovieLayer:MovieLayer provides the ability to render multilayer effects for MovieSegment , such as SubtitleLayer with subtitle demonstrations

  • IMovieFilter:MovieFilter provides filters for the entire PhotoMovie.

  • MovieRenderer:The MovieRenderer's function is to render the photo movie to the specified output interface, such as TextureView (GLTextureMovieRender), GLSurfaceView(GLSurfaceMovieRenderer)

  • PhotoMoviePlayer:PhotoMoviePlayer provides a MediaPlayer-like interface to play PhotoMovie,its progress is controlled by IMovieTimer.

Add PhotoMovie Type

Six types are currently built in

java
 public enum PhotoMovieType {
        THAW,
        SCALE,
        SCALE_TRANS,
        WINDOW,
        HORIZONTAL_TRANS,
        VERTICAL_TRANS
    }

Here is an example of how to extend the gradient effect of 微视

According to the analysis, the picture was placed in the center first, and then a weak zoom in animation was made throughout, and the change of transparency disappeared in the second half ,A more intuitive flow chart is shown below

So two different MovieSegment is required.

FitCenterScaleSegment for zooming in images

…

And then create the GradientTransferSegment,it's superclass contains both the prior and the next MovieSegment for implementing any transition animation.

…

Generate PhotoMovie Object

java
    private static PhotoMovie initGradientPhotoMovie(PhotoSource photoSource) {
        List segmentList = new ArrayList<>(photoSource.size());
        for (int i = 0; i Lut means [Lookup Table](https://en.wikipedia.org/wiki/Lookup_table)

For example

lut | filter
---|---
 | 
 | 

``` java
public class LutMovieFilter extends TwoTextureMovieFilter {

    public LutMovieFilter(Bitmap lutBitmap){
        super(loadShaderFromAssets("shader/two_vertex.glsl"),loadShaderFromAssets("shader/lut.glsl"));
        setBitmap(lutBitmap);
    }
}

Record

GLMovieRecorder provides the ability to record photo movies as mp4

See DemoPresenter saveVideo()

java
        GLMovieRecorder recorder = new GLMovieRecorder();
        recorder.configOutput(width, height(), bitrate,frameRate,iFrameInterval, outputPath);
        recorder.setDataSource(movieRenderer);
        recorder.startRecord(new GLMovieRecorder.OnRecordListener() {
            @Override
            public void onRecordFinish(boolean success) {
               ......
            }

            @Override
            public void onRecordProgress(int recordedDuration, int totalDuration) {
               ......
            }
        });

Background Music

Play

java
 mPhotoMoviePlayer.setMusic(context, mMusicUri);

Record

java
 glMovieRecorder.setMusic(audioPath);

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Java

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言