Run 3d video on unity3d - unity3d

One of my client want to run 3d video on Unity3d, I have two question
What is format of 3d videos.
Is this possible that we can run 3d video on iPhone and Android as well if it supported?
Thanks in advance.

If you meant playing a video on a texture in a 3D scene, then Unity3D as a MovieTexture class you can use. Sadly, it requires a Pro license and doesn't work on iOs or Android :(

add this code where you want to play a vedio:
Handheld.PlayFullScreenMovie("MovieFileName.mp4",Color.black,FullScreenMovieControlMode.CancelOnInput,FullScreenMovieScalingMode.AspectFit);
then put your movie file in Assets/StreamingAssets, movie file means:
.mov, .mp4, .mpv, and .3gp and using one of the following compression standards:
H.264 Baseline Profile Level 3.0 video, up to 640 x 480 at 30 fps. Note that B frames are not supported in the Baseline profile. MPEG-4 Part 2 video (Simple Profile).
details in: http://docs.unity3d.com/Documentation/ScriptReference/Handheld.PlayFullScreenMovie.html

Related

Recording vr motion video

I want to record a vr motion video of my house using aframe so that I can show the demo view of the the house.What are the js files need to be included?How can I do it?
I assume you just want to record 360º video — if so, a 360º camera is the place to start. See: http://thewirecutter.com/reviews/best-360-degree-camera/
You may want to test things out on your device (Gear VR, Cardboard, Vive, whatever) before investing in a camera. Video playback in A-Frame may have some issues on mobile devices particularly.
Example: https://aframe.io/examples/showcase/videosphere/
hi kumar yes you use without using 360 camera by using normal mobile phone but to place that video you have to use latest version of unity that support not only 360 video format but also plane so where you can put that video as an medium.
or if you are using unity 4.6 to unity 5.3 then use have to use some packages like easy video texture in this package you have different options for placing video
https://github.com/maazirfan/Easy-Movie-Texture-for-Unity
and use where ever you want vr/gear vr / htc vive .

Is it possible to generate video at 60 fps and play it back at 60 fps?

For a high-performance scientific purpose we need to render video and play it at 60fps on the device. I assume the usual frame rate of H.264 video is lower than that.
Is this possible, or is the framerate fixed? If so, what is the maximum frame rate we can get when playing H.264 video in fullscreen on the device?
Technical specifications will vary from iOS device to iOS device, so you'll need to check for the hardware you'll actually run this on. For the iPad 2, currently the most powerful of the iOS devices, Apple's technical specifications for video list the following:
Video formats supported: H.264 video up to 720p, 30 frames per second,
Main Profile level 3.1 with AAC-LC audio up to 160 Kbps, 48kHz, stereo
audio in .m4v, .mp4, and .mov file formats; MPEG-4 video, up to 2.5
Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with
AAC-LC audio up to 160 Kbps per channel, 48kHz, stereo audio in .m4v,
.mp4, and .mov file formats; Motion JPEG (M-JPEG) up to 35 Mbps, 1280
by 720 pixels, 30 frames per second, audio in ulaw, PCM stereo audio
in .avi file format
It would appear that fullscreen H.264 playback at 60 FPS is not supported on even the robust hardware of the iPad 2.
However, you can indeed render content to the screen at 60 FPS. I do this all the time in both Core Animation heavy applications and ones that use OpenGL ES. If you can generate your content in-application fast enough to display at this rate, you could render it to the screen at 60 FPS, then encode every other frame to video.
Given that video encoding is a reasonably expensive operation, and it sounds like you want to run some kind of simulation here as well, I'm guessing that you won't be able to render each frame at 60 FPS for display to the screen on current hardware simply due to the load you'll put on the system.
Yes, it is possible to encode video as a series of images and then display the images very quickly on screen. The upper limit of the video hardware and the time to decode the images and blit the images into the video card are the bottleneck in this process. As long as your image decoding logic is not too slow, it should be possible to push video data to the graphics card at 60FPS.
You could try to implement this yourself with a series of PNG images, but I think you will find that decoding the PNG image will not be fast enough to get 60 FPS playback. You can find some free example code that implements that approach with PNG images in my answer to this question
If you cannot get the performance you need, then take a look at my AVAnimator library for iOS, as it already fully solves this problem using memory mapped frames that can be sent directly to the video card from mapped memory.

Graphical Audio player in iOS

Is there a library or built in graphical player to represent a playing audio file in iOS.
I dont want a full screen player, but a small inline player that can be embedded into a UIView.
Does this exist in iOS?
Apple has a good example of this, avTouch. I have successfully adapted parts of their code to display audio levels in the past.
avTouch

Applying Effect to iPhone Camera Preview "Video" Using OpenGL

My goal is to write a custom camera view controller that:
Can take photos in all four interface orientations with both the back and, when available, front camera.
Properly rotates and scales the preview "video" as well as the full resolution photo.
Allows a (simple) effect to be applied to BOTH the preview "video" and full resolution photo.
My previous effort is documented in this question. My latest attempt was to modify Apple's sample GLVideoFrame (from WWDC 2010). However, I have not been able to get the iPhone 4 to display the preview "video" properly when the session preset is AVCaptureSessionPresetPhoto.
Has anyone tried this or know why the example doesn't work with this preset?
Apple's example uses a preset with 640x480 video dimensions and a default texture size of 1280x720. The iPhone 4 back camera delivers only 852x640 when the preset is AVCaptureSessionPresetPhoto.
iOS device camera video/photo dimensions when preset is AVCaptureSessionPresetPhoto:
iPhone 4 back: video is 852x640 & photos are 2592x1936
iPhone 4 front: video & photos are 640x480
iPod Touch 4G back: video & photos are 960x720
iPod Touch 4G front: video & photos are 640x480
iPhone 3GS: video is 512x384 & photos are 2048x1536
Update
I got the same garbled video result when switching Brad Larson's ColorTracking example (blog post) to use the AVCaptureSessionPresetPhoto.
The issue is that AVCaptureSessionPresetPhoto is now context-aware and runs in different resolutions based on whether you are displaying video or still image captures.
The live preview is different for this mode because it pads the rows with extra bytes. I'm guessing this is some sort of hardware optimization.
In any case, you can see how I solved the problem here:
iOS CVImageBuffer distorted from AVCaptureSessionDataOutput with AVCaptureSessionPresetPhoto
The AVCaptureSessionPresetPhoto is for taking pictures, not capturing live feed. You can read about it here: http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/03_MediaCapture.html
(My belief is that this is actually two different cams or sensors, as they behave very differently, and there's a couple of seconds delay just for switching between the Photo and, say, 640x480).
You can't even use both presets at the same time, and switching between them is a headache as well - How to get both the video output and full photo resolution image in AVFoundation Framework
HTH, although not what you wanted to hear...
Oded.

Embed video for play on iPhone?

Does anyone have any experience embedding .m4v movie files into webpages for playback on the iPhone?
I'm trying to create a site optimized for the iPhone, and it includes a video, but I just can't get the video to play - all I get is the grey play arrow with a line through it.
The markup I'm trying to use for embedding it is this:
<embed width="199" height="159" type="video/x-m4v" href="http://www.samplesite.com/motion/mymovie.m4v" src="http://www.samplesite.com/motion/mymovie.jpg"/>
<embed> is old school
use HTML5's <video>
iPhone supports it
<video width="199" height="159" src="http://www.example.com/mymovie.m4v" />
You got the gray play arrow with a line through it, it probably means that the MPMoviePlayerController class can't play the movie.
This class only supports H.264 Baseline Profile Level 3.0 video (up to 640 x 480 at 30 fps) and MPEG-4 Part 2 video (Simple Profile), and there's a possibility that your movie file doesn't match this requirement.
HTH