AVPlayer - Benny Hill style speeded up video issue - iphone

I'm using AVPlayer to show a live stream. Works fine. Part of my app requires a modal view to appear over the video. Actually, it flips the video view to show the modal view. I want the video's audio to keep playing, which it does fine.
However, the problem is when I return to the video. The video's visuals speed up for a few seconds, Benny Hill style, to compensate for the period they were off the screen. Then the video starts playing normally. Is there a way to stop this speed up? If not, can I remove the visual element until the speeded up bit stops.

Related

Weird frames appear when using TextureView to play video in ListView

I managed to play multiple videos in one screen circularly, I added TextureViews to ListView with BaseAdapter which is very common and I created a IjkMediaPlayer (IjkMediaplay github)instance for each textureview. I have reused textureview in getView() callback of BaseAdapter, once getView() called, I stop the previous video and play the new video.
This works fine in most of time, but occasionally, TextureView will display some frames which is not belong to the current video, the frames display for very short time during the playback just like a flash.
With effort, I finally found where the strange frames come, they are from the video which is playing outside of the screen.
The weird frames will not appear if I push up the listview to make the outside textureview show up.
I have record a video to show the scene, in the video you will see 2 videos are playing circularly and a weird frame appear occasionally.
I assert that the weird frame(a white phone on the desk in the frame) is from the video below which is playing outside the screen.
click to download the video
Is this a bug of TextureView on Android, and how to avoid the weird playing?
Who can give me some advices?

Android: Custom video recording app and its quality

I followed the tutorial to create a basic video recorder using the button ("Capture" & "Stop")
Generally it works well but I noticed that if we tap too rapidly on the button to toggle between "Capture to Stop" or from "Stop to Capture", the app stop responding and crashes.
May I know the reason(s) why and how can we solve this issue?
My guess is that it takes time for the app to start the processes of Capture/Stop respectively, and by rapidly tapping the button, the respective processes are force to stop?
Also, I notice the quality of my video recorder is not as good as the default Camera App that comes with Android. (The custom video recorder seems to capture videos of darker and dimmer quality)
Can this issue be solve by adjusting the Camera parameters?
(For e.g. adjust the exposure compensation?)

How do I pause video at the exact moment I capture a photo?

I am using AVFoundation to display a Video in my UIView via an AVCaptureVideoPreviewOverlay.
I then use AVStillImageOutput's -captureStillImageAsynchronouslyFromConnection: to capture a still Image from the Video with the AVCaptureSessionPresetPhoto preset.
I am freezing the video using AVCaptureSession's -stopRunning in the -captureStillImageAsynchronouslyFromConnection completion block mentioned earlier. However, it's too late and the video has continued running while the still image is taken, so the freeze is a second or two later. When I display the image there is a jump.
How can I freeze the video at the exact moment the photo is taken?
Almost a year later...Your approach is all wrong. Instead of trying to pause the video at the precise moment that the image is captured why don't you pause the video and then capture that paused image. To a user it makes no difference, to a developer you don't have to worry about exact precision.
To reiterate my idea, if you pause a video and flash white visual and play a click the user will think you have just captured that frame regardless if you are or not. Actually, you could consider pausing video the same as capturing an image without saving it.

MPMoviePlayer or AVPlayer Frame advance

Is there a way to playback a video file frame by frame using either MPMoviePlayer or AVPlayer?
Or even another movie player that I do not know about?
Here is what I want to do. I want to load a video into a fullscreen player and move the content one frame at a time based on user interaction. This will need to be pretty solid as I would need to accurately control what frame the movie player was displaying at any one time.
Ideally I would love to know if it were possible to load a video and control the frame displayed using code.
I know that I could do this using a UIImageView animation but tests show that this uses FAR to much memory.
When using AVPlayer, you can use the - (void)stepByCount:(NSInteger)stepCount method of its current AVPlayerItem to step forward or backward.
AVPlayer *mPlayer = [AVPlayer playerWithURL:url];
[mPlayer.currentItem stepByCount:1];

Is MPMoviePlayerController capable of playing a small movie really without any kind of overlay?

I need to play a movie without any overlay from the player. No play/stop buttons, no time line, no start/end time, no progress bar, nothing. Just the plain naked movie in a subview. The movie may then be covered by my own graphics. The documentation does say it's possible to disable controls. However, something like "remaining time" or a progress bar is not neccessarily a "control". Who knows?
Set the controlStyle property of the MPMoviePlayerController to MPMovieControlStyleNone and nothing will be displayed except the video.