yellowcath / photomovie Goto Github PK
View Code? Open in Web Editor NEWUsing your photos to create cool videos.(高仿抖音照片电影功能)
License: Apache License 2.0
Using your photos to create cool videos.(高仿抖音照片电影功能)
License: Apache License 2.0
Hey,
I'm getting following exception while creating the video.
I am able to select photos and audios, but when I press 'next' button it shows 'saving video..' for few milli seconds and crashes.
10-03 10:04:29.086 24152-24193/com.hw.photomovie E/AndroidRuntime: FATAL EXCEPTION: GLMovieRecorder
Process: com.hw.photomovie, PID: 24152
java.lang.RuntimeException: MediaMuxer creation failed
at record.GLMovieRecorder.prepareEncoder(GLMovieRecorder.java:229)
at record.GLMovieRecorder.startRecordImpl(GLMovieRecorder.java:98)
at record.GLMovieRecorder$1$1.run(GLMovieRecorder.java:76)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: java.io.FileNotFoundException: /storage/emulated/0/Movies/photo_movie_2018_10_03_10_04_28.mp4: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:455)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:128)
at android.media.MediaMuxer.<init>(MediaMuxer.java:145)
at record.GLMovieRecorder.prepareEncoder(GLMovieRecorder.java:227)
at record.GLMovieRecorder.startRecordImpl(GLMovieRecorder.java:98)
at record.GLMovieRecorder$1$1.run(GLMovieRecorder.java:76)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:187)
at libcore.io.IoBridge.open(IoBridge.java:441)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:128)
at android.media.MediaMuxer.<init>(MediaMuxer.java:145)
at record.GLMovieRecorder.prepareEncoder(GLMovieRecorder.java:227)
at record.GLMovieRecorder.startRecordImpl(GLMovieRecorder.java:98)
at record.GLMovieRecorder$1$1.run(GLMovieRecorder.java:76)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.os.HandlerThread.run(HandlerThread.java:61)
i got error
java.lang.IllegalStateException
at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:2637)
at record.GLMovieRecorder.drainEncoderApi21(GLMovieRecorder.java:410)
at record.GLMovieRecorder.drainEncoder(GLMovieRecorder.java:284)
at record.GLMovieRecorder.startRecordImpl(GLMovieRecorder.java:121)
at record.GLMovieRecorder$1$1.run(GLMovieRecorder.java:76)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:187)
at android.os.HandlerThread.run(HandlerThread.java:65)
Updated Code throwing error
java.lang.IllegalStateException
at android.media.MediaCodec.native_stop(Native Method)
at android.media.MediaCodec.stop(MediaCodec.java:2072)
at com.hw.photomovie.record.GLMovieRecorder.releaseEncoder(GLMovieRecorder.java:275)
at com.hw.photomovie.record.GLMovieRecorder.startRecordImpl(GLMovieRecorder.java:167)
at com.hw.photomovie.record.GLMovieRecorder$1$1.run(GLMovieRecorder.java:87)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:187)
at android.os.HandlerThread.run(HandlerThread.java:65)
app working fine in all device i have tested but getting error in Realme 1 device which has color os v5.0 with android version 8.1.0
2018-11-01 14:57:17.240 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.259 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.290 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.308 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.340 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.359 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.391 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.425 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.458 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.491 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.509 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.541 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.574 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.608 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.643 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.675 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.708 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.712 3253-3253/? E/VoiceAssistantService: VoiceRecognitionEngineBase : onSpeechUninit destroyService and needLaunchIfly = true
2018-11-01 14:57:17.742 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.775 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.808 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.827 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.858 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.892 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:17.925 25828-25828/com.hw.photomovie E/MediaPlayer: start called in state 0, mPlayer(0x0)
2018-11-01 14:57:18.180 1669-2057/? E/InputDispatcher: channel '5538979 com.hw.photomovie/com.hw.photomovie.sample.DemoActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2018-11-01 14:57:18.436 532-532/? E/lowmemorykiller: Error opening /proc/24704/oom_score_adj; errno=2
2018-11-01 14:57:18.467 532-532/? E/lowmemorykiller: Error opening /proc/24704/oom_score_adj; errno=2
2018-11-01 14:57:18.522 3253-3253/? E/SpeechServiceUtil: android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:833)
at com.iflytek.business.speech.ISpeechService$Stub$Proxy.stopSpeak(ISpeechService.java:553)
at com.iflytek.business.speech.SpeechServiceUtil.stopSpeak(SpeechServiceUtil.java:616)
at com.smartisanos.voice.engine.XunfeiRecognizerEngine.destroyService(XunfeiRecognizerEngine.java:1186)
at com.smartisanos.voice.engine.XunfeiRecognizerEngine$1.onSpeechUninit(XunfeiRecognizerEngine.java:181)
at com.iflytek.business.speech.SpeechServiceUtil$2.handleMessage(SpeechServiceUtil.java:71)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:159)
at android.app.ActivityThread.main(ActivityThread.java:6364)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1096)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:883)
i tried to change public ScaleType scaleType = ScaleType.FIT_XY; variable in Bitmap Info but still i can not set Scaletype for Window effect. i want to set Imgae ScaleType to Fit_Center
Process: com.jycj.juyuanmeihui, PID: 19647
android.media.MediaCodec$CodecException: Error 0xfffffc0e
at android.media.MediaCodec.native_configure(Native Method)
at android.media.MediaCodec.configure(MediaCodec.java:1967)
at android.media.MediaCodec.configure(MediaCodec.java:1896)
at com.hw.photomovie.record.GLMovieRecorder.prepareEncoder(GLMovieRecorder.java:272)
at com.hw.photomovie.record.GLMovieRecorder.startRecordImpl(GLMovieRecorder.java:112)
at com.hw.photomovie.record.GLMovieRecorder$1$1.run(GLMovieRecorder.java:90)
at android.os.Handler.handleCallback(Handler.java:907)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:216)
at android.os.HandlerThread.run(HandlerThread.java:65)
I felt curious and I found GLSL Sandbox Gallery.
I don't know anything about GLSL, so, could you tell me how I can use those Glsl into your library?
thank you
will there be an update, I posted the project in google play users say about the error saving the video android 9.
if that i can pay.
大佬 有没有滤镜设置level的方法
非常感谢大佬的工作,效果看起来很赞!但是现在要想体验必须编译成安卓app,不知道有没有非安卓的版本,可以通过直接运行二进制文件完成图片的处理?
How to record audio from specific position?
Looks cool,
i would like to know how video getting generated ?
2018-12-12 17:40:19.058 573-7801/? E/MtkOmxVenc: [0xefb1e000] [ERROR] cannot init encode driver
--------- beginning of crash
2018-12-12 17:40:19.059 7613-7796/? E/AndroidRuntime: FATAL EXCEPTION: GLMovieRecorder
Process: com.hw.photomovie, PID: 7613
java.lang.IllegalStateException
at android.media.MediaCodec.native_stop(Native Method)
at android.media.MediaCodec.stop(MediaCodec.java:2020)
at com.hw.photomovie.record.GLMovieRecorder.releaseEncoder(GLMovieRecorder.java:275)
at com.hw.photomovie.record.GLMovieRecorder.startRecordImpl(GLMovieRecorder.java:167)
at com.hw.photomovie.record.GLMovieRecorder$1$1.run(GLMovieRecorder.java:87)
at android.os.Handler.handleCallback(Handler.java:836)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:232)
at android.os.HandlerThread.run(HandlerThread.java:61)
2018-12-12 17:40:19.059 7613-7798/? E/ACodec: [OMX.MTK.VIDEO.ENCODER.AVC] ERROR(0x80001005)
I want to increase the time of every photos, which were imported in the app for making video. how do I do that?
Error 0xfffffc0e
android.media.MediaCodec.native_configure (MediaCodec.java)
android.media.MediaCodec.configure (MediaCodec.java:1896)
com.hw.photomovie.record.GLMovieRecorder.prepareEncoder (GLMovieRecorder.java:259)
com.hw.photomovie.record.GLMovieRecorder.startRecordImpl (GLMovieRecorder.java:112)
com.hw.photomovie.record.GLMovieRecorder$1$1.run (GLMovieRecorder.java:90)
android.os.Handler.handleCallback (Handler.java:907)
android.os.HandlerThread.run (HandlerThread.java:65)```
Any ideas how we can prevent this ?
请教郭大,为什么切换 BlackWhite Watercolour Snow 这三个滤镜的时候 播放非常卡顿 这个如何解决呢?
顺便说一下 郭大 是我见过 开源作者 最贴心的一位,没有之一。
Do this has fade in/out option for video transition?
设置background无效
运行demo也是翻转了
Hey,
In readme, I came across movieLayer which allows to add subtitles, but didn't find any example.
Can you please share any sample code? I just need to show the app name (text) at the corner of output video.
How to Set Seekbar on video time durrecation and time currnt time on playing video
图片如何按照宽度或者高度进行缩放,即满足宽度或者高度铺满而不是全部拉伸或者剪裁?
拉取依赖库的时候 1.6.3就没问题,1.6.4出错,
Failed to resolve: com.github.yellowcath:PhotoMovie:1.6.4
How to set background music using raw folder .mp3 file..........music get in playing video but cannot recorded in final video
Can anyone knows how to add multiple music files, if first song is short and completed then starts 2nd songs and then continue
赞,感谢分享非常不错的工作。想在python上使用视频生成的核心能力,主要是图片滤镜、图片之间的转场动画效果等~ 不知道这个好不好转换,感谢回答分享~
关注了楼主,真的好强,我是深圳字节跳动的hr广欣,最近我们也有在招多媒体开发岗位,感兴趣聊下吗,互联网圈子多认识个hr多个机会哟,我微信156922066
通过远程依赖进来的 如何设置转场时间,不下载源码的情况下
添加音乐后保存视频失败
How to stop recording once GLMovieRecorder startRecording
I want to play and record video in white background
Images selected from camera roll are rotated 180 degree automatically and there is no way to fix that.
I want to add more than one watermark in my project , but library isn't allowing me to do so .. When I call addwatermark() again previous watermark gets disappears . Please tell how can i achieve this .
Not a bug but a question / feature request
Is there a way to save a video without rendering it on the screen ?
能否像小米照片电影设置当前图片(高斯模糊后的效果)作为背景
at com.hw.photomovie.segment.layer.GaussianBlurLayer.allocPhotos (GaussianBlurLayer.java)
or .drawFrame (GaussianBlurLayer.java)
or .getRequiredPhotoNum (GaussianBlurLayer.java)
or .setViewprot (GaussianBlurLayer.java)
at com.hw.photomovie.segment.AbsLayerSegment.allocPhotoToLayers (AbsLayerSegment.java)
at com.hw.photomovie.segment.AbsLayerSegment.onDataPrepared (AbsLayerSegment.java)
at com.hw.photomovie.segment.MulitBitmapSegment.checkAllLoaded (MulitBitmapSegment.java)
at com.hw.photomovie.segment.MulitBitmapSegment.allocPhotos (MulitBitmapSegment.java)
or .onDataLoaded (MulitBitmapSegment.java)
or .onDownloaded (MulitBitmapSegment.java)
or .onError (MulitBitmapSegment.java)
or .setViewport (MulitBitmapSegment.java)
at com.hw.photomovie.model.SimplePhotoData.access$000 (SimplePhotoData.java)
or .access$100 (SimplePhotoData.java)
or .loadBitmap (SimplePhotoData.java)
or .prepareData (SimplePhotoData.java)
or .scaleBitmap (SimplePhotoData.java)
at com.hw.photomovie.segment.MulitBitmapSegment.onPrepare (MulitBitmapSegment.java)
at com.hw.photomovie.segment.MovieSegment.prepare (MovieSegment.java)
at com.hw.photomovie.PhotoMoviePlayer.restartImpl (PhotoMoviePlayer.java)
at com.hw.photomovie.PhotoMoviePlayer.access$500 (PhotoMoviePlayer.java)
or .onMovieUpdate (PhotoMoviePlayer.java)
or .stop (PhotoMoviePlayer.java)
at com.hw.photomovie.PhotoMoviePlayer$3$1.run (PhotoMoviePlayer.java)
Hey,
In current implementation total duration is photoMovie is fixed to the number of photos (Pasting the factory code below).
Can it be possible we assign the total duration of PhotoMovie and each photo display time is calculated based on total duration of PhotoMovie? In my need, I need to play the full song.
private static PhotoMovie generateHorizontalTransPhotoMovie(PhotoSource photoSource) {
List<MovieSegment> segmentList = new ArrayList<MovieSegment>();
for (int i = 0; i < photoSource.size(); i++) {
segmentList.add(new FitCenterSegment(1000).setBackgroundColor(0xFF323232));
segmentList.add(new MoveTransitionSegment(MoveTransitionSegment.DIRECTION_HORIZON, 800));
}
segmentList.remove(segmentList.size() - 1);
PhotoMovie photoMovie = new PhotoMovie(photoSource, segmentList);
return photoMovie;
}
感谢
Hey,
I added the 9 photos (size 80-100kb) in photo movie demo app and no music. Generated output movie (horizontal trans) has a size of 7Mb (video duration 15 seconds).
Output movie picture quality is not very important for me, but the output file size should be small. Can there anything be done to reduce the output movie file.
Initially, thanks for your library.
The video compiled WITH AUDIO by her, is not being displayed in browser.
The only difference I found in the file produced by this and library, and by the transcoder library that has similar functions (but that is displayed in chrome) is that the files generated by Transcode have GOP M= 1, N= 90 and Photomovie: M= 1, N= 30, in addition, MediaUtils does not have the property "Duration_FirstFrame". Those were the only two differences that I could find in the files, and that can point to a possible solution.
It is also important to remember that some audio files, usually with the lowest bitrate, can be played, but no audio files with a bitrate above 126kb/s are played.
1.今天看了看源码有点不太理解
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.