I have problem with rotate video in Android. I used TextureView to rotate the video but it didn't work fine. It show black screen on device Android 4.2.2. Any body have idea for rotate video? such as use SurfaceView. Please help me.
Thanks.
A Video in Android can be rotated by using the following code:
videoView.setRotation(90f);
videoView.setVideoURI(videoUri);
videoView.start();
I used the above code to rotate a video for my app
Related
I'm working on a camera application that has to capture video in mirror effect. I used texture view to show video preview with mirror effect. Now video preview showing mirror effect but after video being captured and saved it don't have mirror effect.
I used MediaRecorder to save video file.
I Google this problem but didn't find any solution.
I want to save video with mirror effect as shown in camera preview.
thanks in advance.
I have solved this problem by flipping the video.
when the video is completed I'm storing the original video temporary and then applying the flip effect and got the mirror effect in video.
Flip video library
When playing back videos on the Samsung Galaxy S4 the video does not recognize the orientation metadata. It always plays on landscape.
The app also records the video and plays correctly on all other devices while streaming. The S4 plays it fine only if the video is stored in the device but it won't work for streaming.
Using MediaPlayer and SurfaceView on a Fragment, not a VideoView.
Have tried to disable Air View, Air Gesture, Smart Stay, Smart Scroll and Auto Rotate without luck.
Also even stored the orientation hint along with the video to rotate manually the element in the layout, but the SurfaceView when rotated using lockCanvas doesn't work and when rotating its parent element goes black and only plays the audio.
Any suggestions I can try to get this bug fixed? Have you experiencing the same when using the S4? Any help on this will be greatly appreciated. Thanks!
I asked this question a few months back and haven't heard anything. I would love to know as well.
https://stackoverflow.com/questions/17950072/galaxy-s4-media-player-ignores-rotation-metadata
Edit: This also occurs on the Galaxy Note 3.
Found a workaround for this issue. Try using a TextureView instead a SurfaceView, before playing the video, get the rotation info with MetadataRetriever and adjust the TextureView as needed. It worked on this side.
See the details here:
Streaming Video Playback Orientation Issue # Samsung Developers Forum
hi guys i have been trying to record a video with front camera and the playing it back using the videoview and mediacontroller. But facing the orientation problem, as i record the video with camera orientation set to 90 degree(PORTRAIT) but when the recorded video is played it doesnot play in PORTRAIT mode instead it plays in landscape mode. Also have tried setting the media recorder object's setOrientationHint method to 180 degree. Still with no success. Hope someone could have faced or solved this issue and hoping for better responses. Thanks in advance. If needed i can post my code snippets too.
rotate videoview to 90 degree.
I Don't know here is the right place but How can I capture screen while playing video in an android device especially android 2.3.1.
When I Capture screen, just see play pause buttons and a black screen instead of video content.
Thanx
It can be achieved if you play your video on surface texture. To play video on that surface texture would be needing bitmap(which will run in thread). you can then capture the bitmap on touch event for surface texture and convert it to jpeg in your desired folder.
According to this thread, it doesn't seems to be possible (I had the same problem).
The only solution I found was to play the video on a Galaxy tab 10.1 and to use the screenshot function of the tablet, but it require to have a Galaxy tab 10.1 :/
Jokahero
I've coded up apps using VideoView and MediaPlayer and both had the same behavior. I'm currently using the code example here. The problem I'm having is that the video doesn't play back continuously. The slider in the MediaController is moving but the picture doesn't change. If I manually drag the slider the picture will change like it should.
I'm using an mp4 file loaded from the sdcard with a SDK 2.3.1 emulator device.
Any help is appreciated.
You usually cannot test video playback applications on the Android emulator, as it is too slow, except on very powerful host PCs. Please test video playback applications on an Android device.