Log in or register to post comments

Playing a video with alpha channel in the VideoSample demo proje

July 22, 2013 - 11:31am #19

I've understood that many devs archived to make it work on android but what about iOs?

 

Ps. It's possible that was my problem about understand the replies (not very good in english)

 

Thanks!

Playing a video with alpha channel in the VideoSample demo proje

July 22, 2013 - 11:26am #18

What is it that you want to know? --  several devs have implemented this capability on their own, it's not part of the SDK.

Playing a video with alpha channel in the VideoSample demo proje

July 22, 2013 - 11:16am #17

Any update about this?

Playing a video with alpha channel in the VideoSample demo proje

July 22, 2013 - 11:15am #16

Any update about this?

Playing a video with alpha channel in the VideoSample demo proje

March 21, 2013 - 11:45am #15

Hi, on Android devices, you need at least Android 4.0 (ICS) to show video on texture (with or without alpha)

 

Playing a video with alpha channel in the VideoSample demo proje

March 21, 2013 - 9:34am #14

Hi, may i know is it possible to display this kind of video on galaxy ace 2 with android 2.3.3?

Using Handbrake

December 20, 2012 - 6:42am #13

I used the Handbrake software and chose my source video file.  Then I changed the output preset to the "iPhone/iPad/iPod" Preset in the right hand column of the Handbrake interface.  Then I named my output file and chose the destination to output it to (I usually just push it to the desktop and make sure it encoded properly before I copy it into my project.

You need to pass in a video file that will play natively on the target device.  To test this, try taking your encoded video from Handbrake and copying to your target device.  Then, try to play the video directly on the device (not through Unity but through the native video player on the device.)  If it works, it will work when Unity converts it.  If it doesn't work natively, your encode or compression settings are outside of the supported presets that your target device will support.  Therefore, when Unity takes that file and tries to process it, it will always result in an unusable/unplayable file that imports as a movie texture (which is not supported by Unity's mobile solution).

Hope this helps.

Cheers,

Vince

@vincekilian I'm facing the

December 20, 2012 - 6:32am #12

@vincekilian

I'm facing the same probelm you had in the last comment

But I can't solve it yet .. I tried to use HandBrake with the settings you said, but no success

Can you explain more.

Thanks in advance

Playing a video with alpha channel in the VideoSample demo proje

November 21, 2012 - 11:13am #11

Hello,alvaroem.Not at all for the shader,it's a pleasure if it can help someone.Well, i was forced to abandon to find how to do it because of some other job.But I succed to play a simple movie with alpha channel with Scaleform, but u'll need to correctly setup the sound as it's not imported with the movie. I'didn't really go on with the subject,but possibly in future with a client contract. Can you contact me if you'll find a good solution for ios?

Playing a video with alpha channel in the VideoSample demo proje

November 21, 2012 - 8:54am #10

First of all, @virt, thank you very much for your shader.

It works like a charm in Android ICS. Anyway, I had to modify it, because while using it with compressed video, the Alpha threshold can't be exact due to the pixel values being modified by the compression algorithm. I used a range of +/- 5% instead and everything is ok now.

The next step is to get the same effect in IOS (it is not working as you already stated), and I was wondering if you got any achievement in this sense, since you were already working on it several months ago.

Any help would be appreciated.

Thank you very much in advance.

 

Playing a video with alpha channel in the VideoSample demo proje

November 19, 2012 - 6:08am #9

Hey guys,

Any luck trying to make this work?

Cheers,

N

Playing a video with alpha channel in the VideoSampledemoproject

August 23, 2012 - 4:50am #8

Hello,DavidBeard!

It works on android, but i failed to find how to set up an rgba texture on ios.Can you tell me how to do that? I'm trying to use this shader(it works on android 4)

Shader "Custom/Alpha"{

Properties {  

_MainTex ("Base (RGB)", 2D) = "black" {}

_Color ("AlphaColor", Color) = (0,0,0,255) }

SubShader { Tags { "RenderType"="transparent" }

LOD 200 CGPROGRAM

#pragma surface surf Lambert alpha sampler2D _MainTex;

struct Input { float2 uv_MainTex; };

float4 _Color;

void surf (Input IN, inout SurfaceOutput o)

{

half4 c = tex2D (_MainTex, IN.uv_MainTex);

o.Albedo = c.rgb;

if(c.r == _Color.r && c.g == _Color.g && c.b == _Color.b)

o.Alpha = 0;

else

o.Alpha = 1;

// o.Albedo = 1; }

ENDCG

}

FallBack "Diffuse"

This could be pretty handy.

July 19, 2012 - 5:50pm #7

This could be pretty handy.  Video wouldn't necessarily have to be squared off anymore, and that opens up a lot of possibilities.

Playing a video with alpha channel

July 19, 2012 - 3:08pm #6

If you're interested in seeing official support for Alpha channel video transparency please post a request to the wishlist. Apparently this is something that is likely to be feasible, but hasn't been implemented on the current Video Playback sample.

The basic requirements, as conveyed to me , are to ..

-          Enable blending when rendering
-          Output the alpha values of the movie on the fragment shader.
-          And probably setup an RGBA texture on iOS (Android’s is done automatically).

Ignore my previous post

July 19, 2012 - 2:34pm #5

Apologies - please ignore my post below, I figured out how to get the videos in the correct format using Handbrake (free encoding software).

Choose the ipod/iphone preset to get an MPEG-4 container .M4V file ready for Unity.

Playing a video with alpha channel

July 19, 2012 - 12:27pm #4

I'm also having trouble encoding and importing my own video.  I'm using Adobe Media Encoder to encode my file using h.264, 640x360 res, in m4v file format with AAC audio.  For some reason it always imports my video as a movie texture (even the icon looks different than the VuforiaSizzle_1 & 2 examples when viewed in the project). I've successfully played videos in AR scenes before, but they were provided to me by our client.  I have not created and encoded my own Unity-compatible video file for playback on a mobile device through an AR-enabled app.

I already know the recommended specs for Android/iOS video playback and encode settings mentioned in the Unity documentation, but for some reason I cannot get my video file into the same .m4v container that was used to encode the VuforiaSizzle sample videos in the demo app.

Am I missing something here?  What software / encoder did you guys @ Qualcomm use to create the 2 videos in the Vuforia Video Playback Sample app?

Thanks!

Playing a video with alpha channel

July 19, 2012 - 8:19am #3

I'd also like to use this in a project.  I don't have a sample on hand of an alpha-enabled video file though.  I'd be curious to know if this is possible from the developers' POV.

I've seen posts on the Unity forums suggesting the use of 2 videos, one RGB version and one alpha-enabled version with a "Luminance as Alpha" setting.

Since my project will end up on mobile devices (for this project the iPad3 thankfully), I'd like to know the best practice way of using shaders on video textures.

 

Playing a video with alpha channel

July 17, 2012 - 2:00pm #2

I'm inquiring on this. Do you know of any examples of video w/ alpha channel transparency that I can test with?

Pages

Log in or register to post comments