Comments (36)
follow this link for selection of video from gallery:
https://stackoverflow.com/questions/2507898/how-to-pick-an-image-from-gallery-sd-card-for-my-app/34348903#34348903
After selection do something like this: mMediaplayer.setDataSource(selected video path);
and then follow the same procedure.
from videffects.
I followed your link, but still unable to open video from gallery. :(
from videffects.
what is your os you are testing on?
from videffects.
Em testing on kitkat and lollipop
from videffects.
send me your code for this case.
email: [email protected]
from videffects.
Check your email
from videffects.
are you getting any exception?
from videffects.
Nop
from videffects.
if possible then send me the code of your particular fragment.
from videffects.
ok..check email
from videffects.
Any luck?
from videffects.
not received email yet
from videffects.
Just sent again
from videffects.
Received?
from videffects.
no.check email address please
from videffects.
[email protected]
is it ur email?
from videffects.
better check spam
from videffects.
yeah its spammed
from videffects.
Just waiting for your help.
from videffects.
This part is creating problem:
try {
AssetFileDescriptor afd = getAssets().openFd("sample.mp4");
mMediaPlayer.setDataSource(afd.getFileDescriptor(),
afd.getStartOffset(), afd.getLength());
} catch (Exception e) {
Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
}
mVideoView.init(mMediaPlayer,
new BrightnessEffect(0.0f));
from videffects.
Well what should i do in onCreate?
from videffects.
now it depends upon your requirements. Or if you want to test things then simple call
if (Build.VERSION.SDK_INT <= 19) {
Intent i = new Intent();
i.setType("video/*");
i.setAction(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
startActivityForResult(i, REQUEST_TAKE_GALLERY_VIDEO);
} else if (Build.VERSION.SDK_INT > 19) {
Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, REQUEST_TAKE_GALLERY_VIDEO);
}
in your onCreate and in onActivityResult do this part:
mVideoView.init(mMediaPlayer,
new YourEffect());
from videffects.
Let me tell you scenario.
When app i launch, there'll be sample video playing on the screen. User have to select video from gallery by click optionsMenu.
from videffects.
Alright, let me make some changes. Please be there for help. Thank you
from videffects.
in onActivityResult do this part:
mVideoView.setVideoPath(selectedVideoPath);
mVideoView.start();
from videffects.
mVideoView.setVideoPath(selectedVideoPath);
mVideoView.start();
Doesn't exist
from videffects.
mVideoView.init(mMediaPlayer,
new BrightnessEffect(0.0f));
When i do above code in onCreate, it throws this exception
java.lang.IllegalStateException
at android.media.MediaPlayer.prepare(Native Method)
at com.sherazkhilji.videffects.view.VideoSurfaceView$VideoRender.onSurfaceCreated(VideoSurfaceView.java:276)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1501)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
from videffects.
any luck?
from videffects.
dont initialize videoview in onCreate if asked you to do it in onActivityResults
try {
mMediaPlayer.setDataSource(selectedImagePath);
mVideoView.init(mMediaPlayer,new BrightnessEffect(0.0f));
} catch (IOException e) {
e.printStackTrace();
}
from videffects.
This is my onCreate
` mVideoView = (VideoSurfaceView) findViewById(R.id.mVideoSurfaceView);
mResources = getResources();
mMediaPlayer = new MediaPlayer();`
from videffects.
when i run app, it gives me NullPointerException
from videffects.
Exception
java.lang.NullPointerException
at com.sherazkhilji.videffects.view.VideoSurfaceView$VideoRender.onSurfaceCreated(VideoSurfaceView.java:207)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1501)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
from videffects.
share your fresh code now
from videffects.
Check email
from videffects.
any luck?
from videffects.
i would suggest you to first take a look at video view and media player documentation. Your problem will be resolved as its not related to this particular library.
from videffects.
Related Issues (20)
- How to save video? HOT 1
- CRASH | When trying to Save Video. HOT 6
- How can i save video with filter ? HOT 1
- Hi,Thanks for this open source library. I am looking for if you can add Old VHS effects in this.
- video aspect ratio issue HOT 2
- Save video on Sdcard after effect
- Saving effected video in sdcard . Effect issue .
- Saving effected video in sdcard . Effect issue channel mixer!
- After Video processing video is faster. how to fix that ? HOT 3
- glDrawArrays: glError 1282
- Save Video with effects : plan HOT 3
- How to create Color channel mixers for different filters ?
- how to add media controller in video surface view ?
- VideoSurfaceView shows as black on android 9
- how to save video without AssetFileDescriptor HOT 3
- how to apply effects because i found only 3 filters in this code.
- apply Effects as Filters?
- Applying denoising shaders
- apply filters to a single frame in code
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from videffects.