How can I format a movie to play through MPMoviePlayerViewController on the iPad? - objective-c

I've been struggling to make video on the iPad work. I'm using an MPMoviePlayerViewController and it plays fine in the simulator. I've tried several different converters, including ones dedicated to producing iPad-formatted video, but none of the videos play on the device. The MPMoviePlayerViewController loads and the controls appear.
For most of the videos, the spinning progress indicator never goes away. For a few, the video loads but when I press play the video immediately pauses. I know that the video is there because I can scan through and see various frames.
I know the code works because it plays a different movie file perfectly. I just have no idea what I'm doing wrong that's preventing my movie from playing. Does anyone know a good step-by-step process of getting an iPad-formatted video from any .mov or .mp4?
Thanks,
Luke

Also, just for future reference, import target video into iTunes, then highlight it and from the Advanced menu choose "Create iPod or iPhone Version" or "Create iPad or AppleTV Version" depending on your target device.
This guarantees that the right codecs are used and the right bitflags set on the video file.

Fixed - the one that loaded but couldn't play eventually worked. Why? Who knows.

Related

Playing a muted video without interrupting background music

My design calls for a video playing in the background of my login screen, exactly like 6snap has.
I would like to avoid the default behavior of stopping the user's music when the video starts to play. My video does not have sound.
I'm using:
<MediaElement Source="MyVideo.mp4" />
I tried setting IsMuted=true which didn't help. Does anyone have an idea how 6snap managed it?
Edit: currently trying the animated gif route. Using the ImageTools 3rd party library and having converted my MP4, it works fine. My 9 second 640x1136 3MB video became a 41MB GIF, so I have to reduce the quality drastically. Still trying to find a better way if possible.
You won't be able to do that with Background Audio and MediaElement, hence as MSDN says:
When a MediaElement control plays audio or video content, any background sounds or media already playing are halted. The app launches the playback experience when the user taps the control. Only one MediaElement control can operate at a time.
It's no matter you have no sound - when you start to play all background sounds/media are halted.
I'm not sure how the App you have mentioned achieved that, but maybe you can try with DirectX/XNA - thought I've not tried this and don't know if that would help.

Looking for a working example to add srt subtitles to video in xcode

Any one please help me… my app is based on showing subtitles under video…I did little bit in that by using Movie Player project from developer.apple, I can play and pause the subtitle while play and pause the video. I have a problem with how to synchronize the video with subtitle such as forward, backward, slider,entering full screen. I looking for an example like synchronize .srt file with MPMoviePlayerController in Xcode and also other..Please discuss your idea in that with me... Thank you

How to save video overlay iphone xcode

I have created an overlay to an MPMoviePlayerController using the following code, which essentially adds a subtitle in my iphone xcode project:
[_mpMoviePlayerController.view addSubview:lblOverlayView];
I want to now be able to save the video (and eventually facebook, but I don't NEED help with that, just the saving would be fine) with the subtitles. It is playing a preloaded video, and the dynamic part is the subtitle, which is whatever text the user enters (which becomes the value of lblOverlayView. If you have any other ways of adding text that can very over the top of a preexxisting/preloaded video and then saving/emailing/facebooking it, that would also be great! Just some way of doing it!!
Any help I can get will be hugely appreciated.

Simple AVFoundation troubleshooting Situation

I have an app that has some video editing tools. I mix photos and videos and I am running into an odd issue. When i arrange a video composition with a video, then a photo, then back to the video it plays fine until the transition back to the video at which point it freezes! I still hear the audio, and if i seek around the video starts playing again. I dont know how I can error check this! Anyone have any ideas?
The fix more my situation, I created a 1 second clip of blackness and injected that into my composition at the photo spot and now it works fine

start video record on view load in ios

I've looked through the Apple documentation but have seen no mention of how to do this, nevermind if it's even possible or not. I'd like to make it so that an iPhone/iPad begins video recording automatically when a certain view is loaded, and stops and saves when the view is dismissed. Is there any way that I can do this or am I just going to have to use the normal UI for video recording?
Use AVCaptureSession
https://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVCaptureSession_Class/Reference/Reference.html#//apple_ref/occ/cl/AVCaptureSession