Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mathematician

macrumors member
Original poster
Oct 16, 2003
64
0
Hi.

Having a created a demo video for my application, I have a video in "portrait" orientation, i.e., the movie is 320 x 480 (w x h).

You can see the movie(s) here (for mobile Safari):
http://www.christian-fries.de/iphone/serialmail/demos
and here (for standard browsers):
http://www.christian-fries.de/iphone/serialmail
and here (You Tube)
http://www.youtube.com/watch?v=R7dWKhcrRV8

I realized several odd things which I could not resolve:

1) If I add the video to iTunes and sync it with iPhone, then iPhone plays in landscape orientation, adding huge black bars to the left and the right. Can this be changed?

2) If I post the video to YouTube it is also converted to landscape. I assume this cannot be changed since all YouTube videos have the same aspect ratio. However, the video quality is also degraded (compare the two above). Is it possible to have the video in better resolution? Should I upscale the video to HD by hand? If so: How can this be done?

3) If I create a webpage with dashcode (using the "video" element) the video starts in landscape mode, but if you rotate the iPod/iPhone back and forth then it rotates to portrait (contrary to whats happens in 1)). How can I achieve that the video starts right off in portrait orientation? See http://www.christian-fries.de/iphone/serialmail/demos for an example. Note however that on http://www.christian-fries.de/iphone/serialmail which uses the embed tag the video plays right off in portrait mode.

4) If I create a Cocoa app to play a movie using "MPMoviePlayerController" the movie plays always in landscape adding black bars to left and right - as in 1). Can I programmatically play the movie in portrait?

Best
Christian

PS: Sorry for packing four questions into one post.
 

mathematician

macrumors member
Original poster
Oct 16, 2003
64
0
Playing in portrait mode using MPMoviePlayerController

OK. I figured out how to solve "Nr. 4", playing in portrait mode using MPMoviePlayerController: This can be done by use of an (undocumented) feature of MPMoviePlayerController (namely setOrientation). See
http://blogs.oreilly.com/iphone/2008/11/the-joys-of-vertical-audio.html

I am still looking for a solution to the dashcode and the YouTube issue. The strange thinig with dashcode is that movies first play in landscape but they do rotate to back to portrait. Using Safari with an embed tag the movie play right off in portrait mode...
 

Small White Car

macrumors G4
Aug 29, 2006
10,966
1,463
Washington DC
2) If I post the video to YouTube it is also converted to landscape. I assume this cannot be changed since all YouTube videos have the same aspect ratio. However, the video quality is also degraded (compare the two above). Is it possible to have the video in better resolution? Should I upscale the video to HD by hand? If so: How can this be done?

Try this link.
http://www.youtube.com/watch?v=R7dWKhcrRV8&fmt=22

Putting &fmt=22 on the end forces the higher quality version to play.

That's for linking. For embedding, use the "Embed" code on the right side of the Youtube page but add this to the end of the Youtube address:
&ap=%2526fmt%3D22

It appears TWICE in the code, make sure you get them both.

If either of those don't work, replace the 22 at the end with 18. That's the slightly lower quality, but still higher than normal version. Sometimes the 22 version doesn't exist for all videos.

But after all that, yes, it's still kind of crummy looking. You need to try and make the video again as a 1280x720 file with your iPhone image centered in the middle and sized corectly. What editing program are you using? It should be possible with most.

Once you have that, use the '22' linking trick to make sure you're seeing the highest quality file available.
 

mathematician

macrumors member
Original poster
Oct 16, 2003
64
0
Thank you for tip with the fmt=22! As you mentioned, upscaling the movie to HD prior to uploading it to YouTube dramatically improved the video quality.

Importing the 320x480 into iMovie HD and saving it to 1280x720 (as MP4 with 5 Mbit/s) added black bars to the left and right and rescaled to movie to HD resolution. Uploading this "post-processed" movie to YouTube results in much better quality on YouTube (even for the standard definition). (Although YouTube advises that you should not transcode the movie or add the black bars). I believe the point is that once a movie is in 720 you tube uses a different algorithm compared to a movie beeing in 480.

Compare:


Uploading a 320x480 movie to YouTube:
http://www.youtube.com/watch?v=dzrnelV-05M
same in HD:
http://www.youtube.com/watch?v=dzrnelV-05M&fmt=22
Note: Both have poor quality.


Uploading the upscaled movie to YouTube
http://www.youtube.com/watch?v=s8ZswqidzYc
same in HD
http://www.youtube.com/watch?v=s8ZswqidzYc&fmt=22
Note: Quality is much better, although the original source was indeed the same. Also: standard definition quality is better than HD of the previous (320x480) example.
 

mathematician

macrumors member
Original poster
Oct 16, 2003
64
0
How to upload hight quality app demo video to YouTube

I have experimented a bit. Here are the results:

If you have a demo video of your iPhone app in 320x480 and which to upload it to YouTube, you should upscale it to HD. Open the video in QuickTime 7 Pro and export it as MP4 with Video Format H.264, 2000 kBit/sec, 1280x720 HD and check "Preserve aspect ratio using Letterbox".

Then upload the 1280x720 HD. The result will have much better video quality compared to what you get if you upload the 320x480 directly.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.