Why can I play one movie in MPMoviePlayer but not an other movie? - mpmovieplayer

I have implemented a MPMoviePlayer in my app and when I try it with a sample video in .mov format it works well. But when I change movie-clip to a .mP4 or m4v it does not work, the app crashes (I have tried with a bunch of different movie-files. What can be wrong? Does anyone else have this problem?

I don't know if this answers your question, but I did a quick search on supported file formats.
Another S.O. Answer:
Supported Formats
This class supports any movie or audio files that already play correctly on an iPod or iPhone. This includes both streamed content and fixed-length files. For movie files, this typically means files with the extensions .mov, .mp4,.mpv, and .3gp and using one of the following compression standards:
1. H.264 Baseline Profile Level 3.0 video, up to 640 x 480 at 30 fps. (The Baseline profile does not support B frames.)
2. MPEG-4 Part 2 video (Simple Profile)
If you use this class to play audio files, it displays a white screen with a QuickTime logo while the audio plays. For audio files, this class supports AAC-LC audio at up to 48 kHz, and MP3 (MPEG-1 Audio Layer 3) up to 48 kHz, stereo audio.
So that would be my guess why :)
Coulndt you just convert to MOV ?
Edit:
Link to SO answer where quote is taken from:
Link

Related

Html5 player only sound no picture

I have a few video files with mpeg4 format, these are not playing properly in the HTML5 player. There is sound but no picture.
Link apscservices.com/kishen_test.html
The file is working in offline players like vlc and wmp.
MP4 files can contain video and audio in a variety of formats with different profiles. However what is commonly supported in an MP4 file for HTML5 video is H.264 video (also known as MPEG-4 Part 10 or MPEG-4 AVC) High Profile or lower (i.e. no more than bit depth 8, with 4:2:0 chroma subsampling), and AAC-LC or MP3 audio. If you are using a supported audio format but an unsupported video format then you may hear sound but see no picture.
In your case you are using MPEG-4 Part 2 video, which is not commonly supported by browsers, with AAC-LC audio.

Unable to load app preview in iTunes connect

Has anyone been able to load an app preview video in iTunes connect? I receive an error every time, saying "Your file could not be loaded. Please try again."
Any workaround to this, that you're aware of?
I'm here to save the day. The root of the issue is that itunesconnect does not like the format of the file saved by quicktime, or pretty much any format for that matter.
I was able to find just 1 file format that worked. You will need a free program called HandBrake
Use this program to convert the file you are trying to upload with the options I have highlighted in this screenshot:
(Optional) If your video has no sound, go to the audio tab in HandBrake and remove the track, like so:
Note, when you are doing multiple conversions in a row, sometimes the output size gets screwed up, keep an eye on that (it might be a bug in handbrake).
That's it! Upload the file created by HandBrake and it works! Consider donating to the developer of HandBrake for an awesome app.
Edit: Quote from comments:
For those who are struggling (like I was) to make a video 1080p
(1920x1080), don't forget to go to the Picture tab and: change the
Anamorphic setting to "Off", change the Modulus setting to "8" and
last but not least change the Cropping setting to "Custom" and set the
Top, Bottom, Right, Left to "0" – gaskbr Aug 18
Edit 2: You have to set the audio right also, looks like Apple don't accept files without audio channels anymore. Set the codec to AAC, 44.1 (or 48 kHz), bitrate 256.
I have confirmed that it is because of the low upstream speed of certain ADSL, I have to buy a 3G hotspot to upload my preview video.
iMovie10.0.6 can export 'App Preview.mp4' directly, no need to convert by HandBrake.
Apple has answered me that 'Please be advised that we cannot guarantee a successful delivery if you are on a slow internet connection.'.
But I think Apple should improve their upload service like Google does.
I was having the same issue and Handbrake wasn't helping.
Then I found this:
https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Appendices/Properties.html#//apple_ref/doc/uid/TP40011225-CH26-SW14
I put together my app preview video in After Effects. So when I rendered the movie out I matched the App Preview Specifications seen in the link above and my app previews finally uploaded properly.
I had the same problem and found out that I had to strictly follow the video specifications defined here: https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Appendices/Properties.html#//apple_ref/doc/uid/TP40011225-CH26-SW14
My level was set to 5.1, audio bitrate was at 192 kbps and at 48 kHz. So I could upload the video but it showed this error message. With the correct settings every thing works fine!
I think the relevant change I made was setting the level from 5.1 to 4.0.
Some specifications you might consider for H.264 videos:
- CBR between 10 and 12 Mbps.
- Max Level 4.0.
- Audio at 256 kbps AAC with 44.1 kHz.
- Max 30 fps.
- Max 500 Mb.
- Min 15 sec, max 30 sec.
Messing about with Handbrake etc. was tedious so I made an app specifically for converting videos for iTunes Connect.
https://itunes.apple.com/gb/app/preview-video-converter/id1137451860?mt=12
Sometimes the error has nothing to do with your video or format. It's THEIR server.
I had a video that uploaded fine one day and got the ERROR : "Your app video preview is in the wrong format." I did everything I could to tweak, check, change, re-export etc etc to fix it - thinking that it was me. It wasn't.
They have server issues and give an error when there's nothing wrong on your end.
HOW IT WORKED FOR ME
Logout of iTunes Connect
Relax
Go to sleep
Wake up in the morning, relogin to iTC and try again. IT WORKS! With the exact same video file in the exact same format!!!
My steps were to upload the new video. Once I see the play button in Safari, I played the video all the way through. Closed that popup. Save. Then submit. I did get that message that says it could take 24 hrs for video to process but I did not get the format error.
Good luck. Hope this helps someone.
To know more precisely why a video is being rejected, open the developer console, and look at the code. Although Apple doesn't show the problem in the interface, the code reveals why a video was rejected.
In our case, it looked like this:
errorCodes: Array (5)
0"MOV_H264_LEVEL_TOO_HIGH"
1"MOV_AUDIO_IS_MISSING"
2"MOV_AUDIO_CODEC_NOT_ACCEPTABLE"
3"MOV_INVALID_AUDIO_FORMAT"
4"MOV_AUDIO_TRACKS_DURATION_TOO_SHORT"
Array Prototype
localizedMessage: "The H264 Level is too high. Please refer to Apple's documentation for appropriate formats."
nonLocalizedMessage: "H264 Level is too high. Please refer to Apple's documentation for appropriate levels."
statusCode: 400
suggestionCode: "MOV_RESAVE_LOWER_LEVEL"
Use iMovie and create an App Preview project, then export it as an App Preview video.
If you are starting with mp4 videos created by ScreenCastOmatic, these steps work almost perfect:
http://daimtech.wordpress.com/2014/09/26/how-to-create-and-submit-a-preview-video-for-app-store-apps-using-mavericks-and-ios-8/
The one missing step is the audio needs to be in stereo form. Use ffmpeg with -strict 2 -ac 2 for the output file to create stereo aac, like so:
ffmpeg -i Preview.mp4 -strict -2 -vf scale=1136:640 **-ac 2** output.mp4
Adding this because I finally was able to capture a video from the Simulator and convert it to properly upload on the App Store.
First, to capture the video:
xcrun simctl io booted recordVideo myvideo.mp4 --codec h264 --force
Then, to convert it:
ffmpeg -I myvideo.mp4 -vf scale=1600:1200,setsar=1:1 -c:v libx264 -crf 1 -profile:v high -level:v 4.0 -r 30 -c:a copy rescaledvideo.mp4
The above rescales to iPad size, makes sure the H.264 level is acceptable, and sets the frame rate to 30fps. Apple also requires an audio track. Since the simulator doesn't have one you can add one like this:
ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -I rescaledvideo.mp4 -shortest -c:v copy -c:a aac rescaledvideo+audio.mp4
I wrote a script here to capture and convert iOS simulator videos:
https://github.com/kkieffer/appPreview
You can do it online using this site
http://video.online-convert.com/convert-to-mp4
and set the following
vid bitrate : 10240
frame rate: 30
audio quality: 256
My problem was that my video was too short. Apparently, a 15 second video won't do it. So I just recorded a longer video.
I used Apple's built in screen recorder available in iOS 11.X. No video formatting needed.
Absolute nightmare 😱 This is what I did.
I recorded the app using my device and quicktime which gave me a portrait video, then created an 'app preview project' using iMovie, and exported it as an 'app preview project'. The device I had that day was an iPhone 6.
The resulting dimensions from iMovie were 750 x 1334 px but iTunes Connect was asking for 1080 x 1920 px which was surprising given what the documentation from apple was saying and also that its all just supposed to work iMovie 🤷‍♂️.
so then I used this site to convert my video to a .mov file and set the screen size to 1080 x 1920 (portrait (reverse for landscape)) set the audio codec to mp3 and video to mp4 (all of this was after trial and error)
finally I converted the .mov file to .MP4
Finally was able to upload to iTunes connect and it worked 🎉
😉✌️
Just had the same issue. I resolved it by exporting the original video to mp4. It didnt worked by converting with HandBrake.
I couldn't get it to work with Handbrake either, but I did get it to work (finally) with Quicktime 7. I don't even know if Apple sells iTunes 7 anymore, but it has more export options than the newer version of Quicktime do. I think iMovie might give you similar export options.
I started with a Quicktime movie (mov) file recorded from my Mac in Yosemite using the iPhone as a video source.
In Quicktime 7 I went to File -> Export and chose Movie to Quicktime Movie, and used the following settings for audio and video.
Adding this here incase it helps someone else.
I was also having trouble with this and didn't think the Handbrake method was required for me because I was using Adobe CC (After Effects > Adobe Media Encoder), so I was able to specifically choose all the correct settings according to the Apple Guidelines.
But in my case the issue wasn't the format, but possibly the length it took to upload / upstream bandwidth (an undocumented timeout?).
Tried it at home with crappy Australian cable 40mb mp4 file at 60kb/s, took about 20minutes to fully upload, and kept showing that error after it, with various formats.
Switched to my office internet which uses fibre, it uploaded in 5 seconds successfully, no format change required.
Like some of the other answers here, the Apple specifications helped a lot: https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Appendices/Properties.html#//apple_ref/doc/uid/TP40011225-CH26-SW14
A slow internet connection could be the problem.
I also got the error message "Your file could not be loaded. Please try again." while uploading the app preview video.
I could solve the problem by switching from wifi with 160 kBit/s upload to my companies internet connection with Ethernet and 12 Mbit/s upload.
Sometimes there are issues on the iTunes Connect server and you have to wait a little bit before trying to submit again. Usually when you upload a video and then save it, you'll get this message on top of the video:
Processing app video. This process could take up to 24 hours.
Sometimes when I save videos that I know should work, I don't get this and I get the message mentioned in the OP. Try coming back to it later and it will probably work (assuming you've followed all of Apple's guidelines).
If you have used QuickTime to make a screen recording, try changing the frame rate to 30fps using ffmpeg:
https://stackoverflow.com/a/28939013/1588248
I try with Apple guide to create new movie.
I small tip that when you drop video to ItunesConnect and click save button together with it, don't wait. Then you have processing screen appear. Wait from here.
That's my way, hope this help!
My solution is just to change screenshot Japanese name to English name then it works.
FWIW, here are the ScreenFlow 5 settings I used successfully to upload my app preview:
Web - High: Customized
H.264 Video:
Framerate: 30fps
Datarate: 1200 kbits/sec
Profile: Main
Keyframe Rate: Automatic
AAC Audio:
Sample rate: 44.1kHz
Datarate: 256 kbits/sec
Channels: Stereo
The important bit seemed to be not to uncheck the AAC Audio.
Using the unsupported file name characters was the issue in my case – I had to remove "space bars" from my video's file name.
I use ffmpeg to modify videos so they are accepted in iTunes connect (modify as you need):
# Reduce frame rate from 60 to 30
ffmpeg -y -r 30 -i input.mp4 -strict -2 output-almost.mp4
ffmpeg -y -i output-almost.mp4 -filter:v "setpts=0.5*PTS" -strict -2 output.mp4
rm -f output-almost.mp4
# Trim video
# From second 10, take 30 seconds
ffmpeg -i input.mp4 -strict -2 -ss 10 -t 30 -async 1 output.mp4
# Set codec, bitrate, etc....
ffmpeg -i input.mp4 -c:v libx264 -profile:v baseline -level 4.0 -pix_fmt yuv420p -c:a aac -ac 2 -b:a 256k -b:v 10M -movflags faststart -strict -2 output.mp4
Also, sometimes when I press "save" in iTunes connect, after I uploaded the video, I get an error. But, then I change the tab to see another screenshots size, then I go back, press save again, and... it's saved without any error (awesome Apple...)
Some other advice:
Record video using a Simulator.
Add silent mp3 (get here) audio track using OnlineConverter
Use HandBreak as described above but also remember to set the resolution as required (depends on device).

HTML5 IE 9 .mov

I have a problem about html5 video playing on IE 9
I'm using .mov to play the video.
Some of videos play but some is not play.
Example:
I clicked video1.mov and it play.
I clicked video2.mov and it is not play.
Is there a problem about the codec of the video?
What should I do?
Thanks.
EDIT:
Check this image.
http://i.stack.imgur.com/iXwCK.png
Left Side Image - That video is play.
Right Side Image - That video is not play.
May be it is because of the codec. I think it requires video encoding with the H.264 codec and audio encoding with the ACC codec.
Did you download these files separately or encoded them massively together?
If you downloaded them separately, it may because of different encoding codecs.

Code to play AVI file in xcode

I am creating an iPhone application, which can play many media formats. I am not able to play AVI file format, where as I am able to play other formats (for e.g. MP3, MP4, MOV etc). When I try to play AVI, it shows black screen and display is hidden. Any suggestions on what I can do to fix this issue?
Take a look at this tutorial on playing video with ffmpeg and SDL, both available for the iPhone.
An ffmpeg and SDL Tutorial or How to Write a Video Player in Less Than 1000 Lines
It's written in C, but consider it pseudocode, and adapt it in Objective C accordingly.
.avi is a container format, not a specific audio/video codec. Depending on the contents of the .avi container, it may or may not be possible to decode the video on an iOS device (due to hardware limitations). If it is possible to decode the video in real time, you may have some luck using the libav (aka ffmpeg) library to decode it.

Can I play flash video file on iPad?

I want to make simple project which play flash video file from online.
I've searched some articles and read carefully.
But I can't understand, how to play flash video files on iPad by Code.
So I need help from you.
Please.
Simply put, without being jailbroken, No you cannot.
The closest thing to being able to view flash in iOS is Frash, and I am not even sure if it is actively being developed or supported any more.
You can always check out the open source project for Frash. by Comex.
All IOS devices don´t support Flash player, but is be possible to use a Javascript or HTML5 player for video.
No, iWhatever's currently do not and to the best of my surfing knowledge, have no intention of supporting flash format due to some argument between apple and adobe.
At the end of the day, the Flash video format is a container for a movie that’s been compressed by some codec. If you can get to the source file, you know the format of the container, you know the codec that was used to encode the video, and you know how to write code to convert that into audio streams and video frames, then yes, you can play Flash videos on the iPad.
So, to recap:
Get the Flash video file.
Get to the encoded video data in the Flash file.
Decode the video and convert it, either into raw audio and video or to another format that the iPad can play.
Play the result of #3.
Needless to say, this is quite the endeavor. It’s better to download the movies to your desktop and convert them there before loading them into your application.
Yes you can! The question is whether or not you can play the video itself not whether or not ipads support flash player.
the answer is this.. new versions of "flash video" have a f4v file extension. These videos are basically a h.264 mp4 files. You "may" be able to play it in an ipad simply by renaming it to .mp4
If that doesn't work then use a utility like Miro to convert your "flash video" to a format that your ipad will accept. http://www.mirovideoconverter.com/