Giter VIP home page Giter VIP logo

unityplugin-avprovideo's Introduction

unityplugin-avprovideo's People

Contributors

andrewrh avatar chris-rh avatar kahnivore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unityplugin-avprovideo's Issues

Minor bug in HLSStream class

Description
Hello,

we are currently using the AVPro Video plugin for a Unity project. In this project we are using .m3u8 playlists to stream video content. While fetching all streams from the playlist, I noticed that there is a minor bug when reading the width and especially the height from the playlist.

In our case we have multiple video streams with different resolutions, for example 3840 x 2160. When reading this information from the playlist, the resulting Stream object contains the width and height properties, whereat the width property is correct (3840) but the height property is not. For this example it has the value 216 instead of 2160. Since this is the case for each video stream we have in the playlist, we currently use a workaround by multiplying the value by 10 to get the correct value for the height.

The problem occurs in the HLSStream.cs file in line 138 (latest version from the Asset Store). In this line the length of the actual resolution string is calculated. For example when having the resolution of 3840x2160 in the playlist, this line should calculate a length of 9 because there are 9 characters. In the current version the result of this calculation is only 8 and furthermore the last character is cut when applying these information to the width and the height. The result is, that we get the correct value for the width but an incorrect one for the height. It is reproducible with other resolutions we have in the playlist, for example 1920x1080, 1280x720, etc.

Setup

  • Unity version: 2018.3.5f1
  • AVPro Video version: 1.9.12
  • Operating System: mac OS 10.14.3 (probably happens on all supported devices)
  • Video Specs: happens on multiple resolutions (see above), irrespective of frame rate, codec, etc.

How to reproduce

  • Try to open any .m3u8 playlist file by calling HLSStream hlsStream = new HLSStream("uri");
  • Iterate through GetAllStreams(), for example: foreach (Stream stream in hlsStream.GetAllStreams()) { }
  • In this loop check the width and height of each stream object

In our case the playlist file looks like this:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=5720000,RESOLUTION=3840x2160
chunklist_w910779299_b5720000_slDE.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=3320000,RESOLUTION=1920x1080
chunklist_w910779299_b3320000_slDE.m3u8

Crash in Android phone with Exoplayer

--------- beginning of crash

03-10 17:08:07.771 4322-4322/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.fmssb.csi, PID: 4322
java.util.NoSuchElementException
at java.util.ArrayDeque.removeFirst(ArrayDeque.java:264)
at com.google.android.exoplayer2.ExoPlayerImpl.updatePlaybackInfo(ExoPlayerImpl.java:682)
at com.google.android.exoplayer2.ExoPlayerImpl.handlePlaybackInfo(ExoPlayerImpl.java:622)
at com.google.android.exoplayer2.ExoPlayerImpl.handleEvent(ExoPlayerImpl.java:567)
at com.google.android.exoplayer2.ExoPlayerImpl$1.handleMessage(ExoPlayerImpl.java:109)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:7002)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)

Crashed happen when start to play video

  • Unity version: 2018.3.6f1
  • AVPro Video version: 1.9.12
  • Operating system version: android 8.1.0
  • Device model: Galaxy Tab s4
  • Video specs : 1280 560 , 29 frame , mp4 , 13 mb

OSXMediaPlayer functions not being called on Mac

I'm working on a phone app that uses AVPro to stream Vimeo videos. I have it working in Android/Windows, but when I transfer the project to a Mac, none of the interface controls (pause, seek, etc) are being called. For example, I'm using the "OnPauseButton()" method in VCR to pause a video, and the call to "PlayingPlayer.Control.Pause" is reached, but the Pause method in OSXMediaPlayer is not being called, even though PlayingPlayer.Control.getType() returns "OSXMediaPlayer".

Do you have any idea what could be causing this?

  • Unity version: 2018.3.9f1
  • AVPro Video version: Not sure, trial downloaded 11/28/2018
  • Operating system version: MacOS Mojave 10.14.3
  • Device model:
  • Video specs (resolution, frame-rate, codec, file size): n/a

Android OOM after switching videos many times

Describe the bug
OOM after switching videos many times

Your Setup (please complete the following information):

  • Unity version: 2017.4.17f1
  • AVPro Video version: 1.9.8
  • Operating system version: Android 6.0.1
  • Device model: Pico Goblin 1
  • Video specs (resolution, frame-rate, codec, file size):
    • Duration: 00:01:49.01, start: 0.000000, bitrate: 2154 kb/s
    • Stream #0:0(und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv, progressive), 2160x2160 [SAR 1:1 DAR 1:1], 2016 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 29.97 tbc (default)
    • Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)

To Reproduce
Note, we are using two instances of AVPro, which alternate playback of videos. With each video playback, memory utilization increases until an OOM crash. See the log message below indicating a file is opened but not closed at:
com.RenderHeads.AVProVideo.AVProVideoMediaPlayer.OpenVideoFromFileInternal(AVProVideoMediaPlayer.java:259)

Logs

01-25 14:05:10.713 12771-12781/com.picovr.vrlauncher I/art: Background partial concurrent mark sweep GC freed 12031(744KB) AllocSpace objects, 18(292KB) LOS objects, 39% free, 2MB/4MB, paused 660us total 265.592ms
01-25 14:05:10.787 12771-12779/com.picovr.vrlauncher E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
    java.lang.Throwable: Explicit termination method 'close' not called
        at dalvik.system.CloseGuard.open(CloseGuard.java:180)
        at java.io.FileInputStream.<init>(FileInputStream.java:78)
        at java.io.FileInputStream.<init>(FileInputStream.java:103)
        at com.RenderHeads.AVProVideo.AVProVideoMediaPlayer.OpenVideoFromFileInternal(AVProVideoMediaPlayer.java:259)
        at com.RenderHeads.AVProVideo.AVProVideoPlayer.OpenVideoFromFile(AVProVideoPlayer.java:645)
        at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
        at com.unity3d.player.UnityPlayer.c(Unknown Source)
        at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
        at android.os.MessageQueue.next(MessageQueue.java:392)
        at android.os.Looper.loop(Looper.java:135)
        at com.unity3d.player.UnityPlayer$e.run(Unknown Source)

Screenshots
If applicable, add screenshots to help explain your problem.

Videos
If applicable, add a copy of your video or the URL

[BUG]

Describe the bug
A clear and concise description of what the bug is.

Your Setup (please complete the following information):

  • Unity version:
  • AVPro Video version:
  • Operating system version:
  • Device model:
  • Video specs (resolution, frame-rate, codec, file size):

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Logs
If applicable, add error logs to help explain your problem.

Screenshots
If applicable, add screenshots to help explain your problem.

Videos
If applicable, add a copy of your video or the URL

HLS .TS not playing

Describe the bug
Showing only white Screen.

Your Setup (please complete the following information):

  • 18.3.6:
  • AVPro Video version:
  • Win10 64Bit:
  • PC Win10 64Bit:
  • Video specs (resolution, frame-rate, codec, file size):

To Reproduce
1.
2.
3.

Logs
If applicable, add error logs to help explain your problem.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Videos
If applicable, add a copy of your video or the URL

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Instead email the link to us [email protected]

Rewind and Play when video is paused on end frame is rewinding but not playing

Describe the bug
The video is paused on the final frame and I want a button that rewinds to the start and automatically starts playing. If the video is already playing (i.e. in the middle) then this works fine but if it is at the end (i.e. paused on the final frame) the video rewinds to the beginning but doesn't play.

I've tried using:
MediaPlayer.Rewind(); MediaPlayer.Play();

Then I thought it was probably because seeking wasn't finished before calling Play(), so I tried calling Rewind() and then waiting for seeking to finish then calling Play() but it still doesn't reliably play. Even using the MediaPlayer Event for seeking finished then calling Play() doesn't seem to work 100% of the time.

Your Setup (please complete the following information):

  • Unity version: 2018.3.5f1 in the Editor and built to iPhone it's behaving the same.
  • AVPro Video version: 1.9.8
  • Operating system version: Mac Mojave (multiple versions)
  • Device model: Mac Editor and iOS 12 builds
  • Video specs (resolution, frame-rate, codec, file size): mp4 24fps h264 on files even as small as 2MB

To Reproduce**

  1. Play a video with looping turned off
  2. When it reaches the end (is paused on final frame) try and rewind to the start and play

IOSurface mem allocation remains after playing video

I find that on ios we still have some mem allocated by AVPro when we are definitely not playing any video.
The first screenshot is what I found with xcode instrument after playing a 1min in game video, the next is what I found after playing a logo video(around 10 seconds), all two are mp4 format.

I don’t have much experience with iossurface but it seems to me that AVPro is holding some rendertarget internally even after the video is done? Can I have those released to save some mem?
The way we play video is to have an Object with a MediaPlayer Component on it, and destroy it when it is done.
1
2

after 4-5 seconds when video starts playing

Hi, I'm building an application on iOS.
I am streaming a video from my own server(http).
I want to implement progressive streaming, so that after 4-5 seconds when video starts playing once it plays continuously. The internet is good.

There is some form of fine-grain control over how much of the video buffers before playback?

I will really appreciate the help.

Black screen on single Android device

Describe the bug
I'm testing AVPro integration for one of our mobile AR apps, I'm using the trial version. If QA passes we'll acquire the iOS and Android licenses.

Our QA team was testing the app for a few hours, when all of a sudden no videos displayed anymore on that specific device. They load, audio plays, but the display surface is black (we're using the Display UGUI component). Other Android devices still work, only that specific one consistenly fails, despite reinstallation.

No errors are registered on the console.

Your Setup (please complete the following information):

  • Unity version: 2018.2.14f1
  • AVPro Video version: 1.9.12
  • Operating system version: Android 8.0.0
  • Device model: Samsung Galaxy S7
  • Video specs (resolution, frame-rate, codec, file size): [email protected], MP4 AVC1 [email protected], 70~80MB)

To Reproduce
Steps to reproduce the behavior:

  1. Set up a MediaPlayer and a Display UGUI that loads MP4 videos
  2. Build to Android
  3. Use it for 3 to 4 hours
  4. Observe that any new video plays have their screen black, while the audio plays normally

Logs
None!

Screenshots
screenshot_20190130-105821_sebrae ambiente virtual

Videos
https://player.vimeo.com/external/246530089.hd.mp4?s=09bf3bcde56e5bc8e63445070936a03f3dea3c17&profile_id=174
Happens on other videos with similar parameters.

(iOS) the video start 2 sec after audio

Hello
I am using the AVPro test version (1.9.8)
I am using AVPro to play a video processed by FFmpeg
the video is obtained from the device gallery and then processed by FFmpeg
The code used for video processing is:
-i imputFile -preset ultrafast -vf scale='min(540,iw)':'min(348,ih)' outputFile.mp4
any idea why the first 2 seconds do not show in iOS?
it happened on an iPhone 6

Note: in android this does not happen

can you help us

Android 9 has issues with video streaming

we are facing a problem with the AVPro Player that has come up in the forums as well: Mpeg dash video streaming doesn't work for Android 9.

• This happens with all Android 9 devices (Huawai p20, Google Pixel 2, OnePlus 5T)
• with an older version of AvPro the problem occured
• with the AvPro Version 1.9.10 from January we are still experiencing the problem
• we are using Unity 2018.2.17f1
• no other Android devices besides the Android 9 ones show the error.
• no iOS devices with HLS streaming show the error

The videos we are using are MPEG-DASH files encoded on the azure media services.

Can you help us out with this issue?

Looping video lag and Playlist component with videoapi "Mediaplayer" on Android - Pico Goblin

Describe the bug
We are currently using this plugin for a tight deadline project and have run into some issues regarding video performance over a certain amount of time specifically when looping the video. Over a few loops, there is a lag at the end of the video before it loops again and this happens after a few runs. We noticed changing the Android videoapi from Exoplayer to Mediaplayer helps but we can't get this to work with your Playlist component. Any help?

Your Setup (please complete the following information):

  • Unity version: 2018.3.0.f2
  • AVPro Video version: 1.9.12
  • Operating system version: Android 6.0.1
  • Device model: Pico Goblin
  • Video specs (resolution, frame-rate, codec, file size): 2048X2048 stereo, 30, H264, 40mb

To Reproduce

  1. Load looping video in Headset, After few runs of looping video it starts to lag.

Exoplayer loading failed at random

Describe the bug
I have a bit of a problem with the exoplayer on android.
The Player works perfectly for a while but at some point it randomly stops playing the movie.
This problem persists until I restart the phone. Restarting the app does not solve the problem.

Your Setup (please complete the following information):

  • Unity 2018.2.21f1:
  • AVPro Video version: v.1.9.12
  • Operating system version:
  • Device model: Samsung Galaxy S6 SM-G920F
  • Video specs (resolution, frame-rate, codec, file size): 2880x2880 + spatial audio with facebook audio 360

To Reproduce

  1. Left the phone in standby over a couple of hours without playing anything
  2. tried to play the same movie clip it already played hundreds of times before

Logs
AndroidPlayer([email protected])</i> [AVProVideo] Error: Loading failed. File not found, codec not supported, video resolution too high or insufficient system resources.

03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal: Playback error.
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal: com.google.android.exoplayer2.ExoPlaybackException
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.throwDecoderInitError(MediaCodecRenderer.java:450)
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:437)
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:929)
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:506)
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:566)
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:518)
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:301)
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         at android.os.Handler.dispatchMessage(Handler.java:98)
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         at android.os.Looper.loop(Looper.java:154)
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         at android.os.HandlerThread.run(HandlerThread.java:61)
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal: Caused by: com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.Exynos.avc.dec, Format(1, null, video/avc, -1, null, [2880, 2880, -1.0], [-1, -1])
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         ... 9 more
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal: Caused by: java.lang.IllegalArgumentException
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         at android.media.MediaCodec.native_configure(Native Method)
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         at android.media.MediaCodec.configure(MediaCodec.java:1882)
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.configureCodec(MediaCodecVideoRenderer.java:453)
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:427)
03-31 21:20:11.526  5827  6767 E ExoPlayerImplInternal:         ... 8 more

DisplayUGUI under a Mask has distored colors on iOS

Describe the bug
The bug happens only on iOS devices or iOS simulators. This is not reproducible in the editor.

If a DisplayUGUI is a child of a Mask component, its colors will be heavily distorded.
(Rect2DMask however are safe)

Your Setup :

  • Unity version: 2018.3.3f1, 2018.3.9f1, 2018.3.12f1
  • AVPro Video version: 1.9.12
  • Operating system version: iOS 12.2
  • Device model: IphoneXs (both a real one and a simulated one)

To Reproduce

  • Create a new scene.
  • Add a Mask, Image, and MediaPlayer components to the canvas root.
  • Add a child to the canvas, attach a DisplayUGUI component to the child.
  • Assign the media player to the DisplayUGUI. Set the media player to autoplay.
  • Build the scene onto an iOS device or iOS simulator. Run the app.

Screenshots
On the left, the DispalyUGUI as it should appear. On the right, the DisplayUGUI under a Mask component.
Sans titre2

Videos
This is reproduced with the examples videos provided with AvPro.

Expose API Method to change min buffer size

We want to stream high speed videos (120 fps & 240 fps) from a server, but as we noticed while debugging: the plugin will always buffer 5 seconds regardless of the frame rate. For a 120 fps and 240 fps 5s is a lot of data to process, which causes slow buffering times. We only allow a max playbackrate of 0.5X for 120 fps videos and 0.25X for 240 fps video.

A parameter to change the min buffer size (to start/continue playing) in code would be useful. We have 3 video types we are using in our app:
30 fps: min buffer can stay at 5s (max playbackrate is 1X)
120 fps: min buffer should be half, so 2.5s (max playbackrate is 0.5X)
240 fps: min buffer should be quarter, so 1.25s (max playbackrate is 0.25X)

Unity version: 2018.2.20
AVPro version: 1.9.12

Sync animation to video

I am trying to sync an animation or timeline to a video, but it is jittering due to inconsistent frame reads.

I need a way to ensure an animation stays frame locked to the video that is playing. Playable director has allows DSP control, so that could be one way to keep it locked.

We have attempted to drive an animator by getting the current milliseconds and converting it to a frame number, but that seems to be inconsistent. It will be off by a frame for long enough to see it jump.

AVPro HTTP Progressive Streaming not accurate buffering range

Describe the bug
A clear and concise description of what the bug is.

Problem: Buffer range not accurate

I opened 02_Demo_imGui and switched to like http://some.com/mss.mp4. AVPro will try to buffer. If you seek to the buffered time point, sometimes it cant play at all. Web player like youtube is more accurate, i mean if you seek to the buffered range, it can play immediately. But with avpro, if you get some buffered range like 10secs, you cant play freely in the range.

Your Setup (please complete the following information):

  • Unity version: 2017.4.15f1
  • AVPro Video version: 1.9.4
  • Operating system version: Windows 10 x64
  • Device model:
  • Video specs (resolution, frame-rate, codec, file size):

To Reproduce

  1. Open your demo scene 02_Demo_imGui
  2. Play stream: http://some.com/mss.mp4
  3. When you find some buffered time available, try to seek between the time range and you can run into the problem above

Logs
If applicable, add error logs to help explain your problem.
No err.

Screenshots
If applicable, add screenshots to help explain your problem.

Videos
If applicable, add a copy of your video or the URL
some mp4 onlie video will be ok.
or you can test with some long and high bitrate mp4 videos by http progressive streaming

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Instead email the link to us [email protected]

Now no more needs for buffer range. You can do more tests to verify the problem.

Support for WebRTC so that we can play a stream received over WebSocket

We don't currently find support documented for playing video streams over WebSocket (WebRTC). We are currently streaming video over Wowza which offers ultra-low latency using websockets, or a HLS fallback which has a prohibitively greater delay for our purpose. Can you tell us if Websocket support exists in the current version of AVPro or is in the roadmap? Any assistance in finding this feature, or otherwise optimizing HLS playback is appreciated. Thanks.

Not playing 4K 360 streaming videos on Android

Description
I have about 7-8 spheres with 360 4K videos in my project. It's fine works on PC but on Android sometimes these videos are not loading therefore not playing but sometimes it works fine.

I created a test project to catch this bug. I placed 6 spheres with these videos on a scene. It works fine on PC but on Android two videos are not playing.I brought the logs on the PC and on the Android. I think a problem is insufficient system resources.

I'm going to play ten 8K videos at the same time on AV Pro Video Media Player in two months but it doesn't work with 4K videos...

My Setup

  • Unity version: 2018.3.0f2
  • AVPro Video version: 1.9.6
  • Operating system version: Windows 10 x64
  • Test device: Samsung Galaxy G6
  • Video resolutiuon: 4K

To Reproduce
Steps to reproduce the behavior:

  1. Download archive with test project
  2. Open Project -> Play -> All works fine
  3. Find .apk file in MediaPlayerIssues -> Builds or make you own build and install on Android
  4. See two videos will not be played

Corrupted Video Output

Any video export setting that is set, ends up creating a video file that is unplayable on my Windows 10 computer. Maybe it has something to do with the free version, as I am trying to decide whether or not to purchase.

  • Unity version: 2018.3.3f1
  • AVPro Video version: Most recent (free version)
  • Operating system version: Windows 10

image

Use Secondary GPU for Media Foundation Decoding

I am a user of the Whirligig VR video player - best VR player on Windows, in my opinion. Its developer said he uses this plugin to drive the video playback. It works 100% alright for the usual case of one GPU, using the Media Foundation path.

If the user has a secondary GPU, currently it is ignored. Would it be technically feasible to adjust this plugin so that it tried to use all decoding engines available? (Not at the same time, but, if one failed, it could try the next one). I don't know if MF would accommodate that.

In some tests using DirectShow with LAV Filters, using the decoding engine on a secondary GPU seems to work, but the performance was very bad for high resolution videos (> 5500 x 5500), while using that GPU directly with MF had flawless performance. For 2D videos, DirectShow and LAV Filters work alright, and even FFmpeg can be used to encode and decode using the secondary GPU, leaving the main one free for other tasks.

The main benefit of implementing that change would be convenience for the user, as it would not need to manually change HDMI cables of the VR headset and monitor to another GPU every time he needed to watch something (and change it back once done). The target audience would mostly be users of AMD cards that are powerful for 3D engine, but have weak decoding engines, and that used a cheap NVIDIA card for decoding. Probably not a very large group, so it would be totally understandable if this feature were passed over for more pressing ones.

I have read talks about viewport tech, in which a video would be broken down in multiple smaller videos and the player would select some of them to decode and display, depending on the direction the user was facing. So maybe in the future using multiple decoding engines in parallel may prove to be a very interesting option too.

The First frame of video should be shown before playing.

Bug on Android (can't test on iOS yet)

  1. Open the 04_Demo_uGUI test scene
  2. Set the Media Players "Auto Play" option to unticked
  3. Make sure your Player Settings has "Multithreaded Rendering" is enabled

Run on Android
Expected Results:

  • The First frame of the video should be shown.

Actual Results:

  • Just a Black texture.
  1. Switch Player Settings has "Multithreaded Rendering" to disabled

New Results:

  • The First frame of the video should is shown.

  • Unity version: Unity 2018.3.9f1 (64-bit)

  • AVPro Video version: AVPro: Version 1.9.12 - 18 January 2019

  • Operating system version: Android

  • Device model: Samsung S8+

  • Video specs (resolution, frame-rate, codec, file size): Any

Video artefacts with Unlit OES shader (Android)

I am playing normal videos (not 360) in VR, and I get some weird artefacts. Please see the video below.
This only happens on Android (Gear VR), but not on Oculus Go. It happens with all videos. I also play 360 videos and they are fine. This seems to happen only when using OES. If I just disable OES, and use a non-OES shader, it works just fine.

https://we.tl/t-nPoxHZKOBo

The video is displayed on a mesh (Quad). I tried other meshes (plane, cube) but the results are similar (or worse).

  • Unity version: 2018.3.0f2
  • AVPro Video version: 1.9.10
  • Operating system version: Android (Gear VR)
  • Device model: Samsung S6

Save streamed video (fragments) to local storage

Is your feature request related to a problem? Please describe.
As far as I am aware there is no current method exposed that allows for saving streamed video(fragments) to local storage so it can be replayed from local storage at a later time, without having to be streamed again.

Describe the solution you'd like
Have a method exposed (or overloaded) that allows for saving streamed data to a local path.
I would imagine something like:

//The original OpenVideoFromFile method overloaded with a destination
public bool OpenVideoFromFile(FileLocation location, string path, bool autoPlay = true, string destination = "")

That is called like this

MediaPlayer.OpenVideoFromFile(MediaPlayer.FileLocation.AbsolutePathOrURL, "http://192.168.0.1:8080/foobar.m3u8, true, Application.PersistentDataPath + "/Downloads/");

Preferred this would be done on a seperate thread so it doesn't block the stream. However I can imagine this may be a problem for some devices, so this should probably be optional.

Writing to file can be done using the standard FileStream class.

Describe alternatives you've considered
Currently I am redirecting all video requests through a HttpListener so I can catch and create a copy of the streamed data to be used for local storage, before sending the stream back to AVPro/mediaplayer using the HttpListener.Response.

Buffering events not called on Android

The events

  • MediaPlayerEvent.EventType.StartedBuffering
  • MediaPlayerEvent.EventType.FinishedBuffering

Seem to not be called on Android devices when using either MediaPlayer or ExoPlayer. No error or warning is displayed either.

If this isn't implemented yet it would be nice to see it in AVPro video 2.0.

Playing videos using HLS streams.

edit:
It appears that the buffering events on Android are not called when a playback first starts. When playback stops (e.g when MediaPlayerEvent.EventType.Stalled event was raised) it will trigger the MediaPlayerEvent.EventType.StartedBuffering event.

This behaviour seems to differ from the editor where MediaPlayerEvent.EventType.StartedBuffering is raised when playback starts for the first time, and MediaPlayerEvent.EventType.FinishedBuffering is raised when all fragments have been downloaded. And the same events being raised after a video has stalled.

Using AVPro 1.9.12

In Android, call CloseVideo() then next time video not play

Describe the bug
In Android, call CloseVideo() then next time video not play. (only sound play)

Using ApplyToTextureWidgetNGUI, I found that "_mediaPlayer.TextureProducer.GetTexture()" return null in TryUpdateTexture().

That's why I call CloseVideo(), Some android devices can play only 1 video at once. (If no CloseVideo() then crash occurs.)

Your Setup (please complete the following information):

  • Unity version: 2018.2.20f1
  • AVPro Video version: 1.9.12
  • Operating system version: Android
  • Device model: Any
  • Video specs (resolution, frame-rate, codec, file size): Any

To Reproduce
Steps to reproduce the behavior:

  1. On OnDisable(), Call CloseVideo()
  2. On OnEnable(), Call OpenVideoFromFile()

Logs
If applicable, add error logs to help explain your problem.

Screenshots
If applicable, add screenshots to help explain your problem.

Videos
If applicable, add a copy of your video or the URL

multiple displays for a panorama

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Skybox inverted

I am trying to use a 360 video for a skybox but it keeps showing up upside down. I have a Skybox/Panoramic material, latlong layout, 360 image type. I have looked at the ApplyToMaterial script and tried inverting the y scale, but it has no effect.

HLS Streaming Resolution Starts at lowest on Android, IOS AVPRO

Describe the bug
We are currently working on an application that uses Unity and AVPRO. Specifically we have HLS Streams that we are viewing using AVPRO. We have our HLS master file set up to handle different resolutions and bandwidth, and AVPRO is able to switch between them. The problem we are running into is that AVPRO always starts with the lowest resolution possible regardless of the connection of the user and it takes about 10 seconds into the video before it starts increasing. When we load a new video the process starts all over again, and it starts at the lowest resolution for a while before updating. As a result, our client's app always shows an unclear video until it slowly steps up to an appropriate resolution. As you can imagine the client is unwilling to accept that, which is delaying our ability to launch.

We tried changing the order of the #EXT-X-STREAM-INF lines in the metadata as we are unsure in what order they are processed. We also tried specifying different values for #EXT-X-VERSION.

We have been looking inside the code, on forums, and the documentation, but we have not found a solution. Is there a way to indicate AVPRO which resolution to start with and if there is not, could we have it remember what was the last resolution used so it doesn't have to start from scratch every time.

Your Setup (please complete the following information):

  • Unity version: 2018.2.0f1
  • AVPro Video version: 1.9.12
  • Operating system version: Multiple Android OS
  • Device model: Multiple Android devices
  • Video specs (resolution, frame-rate, codec, file size): HLS Stream

We have seen this response in a forum: https://forum.unity.com/threads/released-avpro-video-complete-video-playback-solution.385611/page-59#post-3938638

It says that the problem does not occur in Android, but we are currently facing the same issues on Android devices.

Hard crash in 2019

When trying the demo scene in Unity 2019 using HDRP I am getting a hard crash.
The end of the Editor Log says the following
(Filename: Assets/AVProVideo/Scripts/Internal/Interfaces.cs Line: 605)
Unsupported D3D format 0x58
(Filename: C:\buildslave\unity\build\Runtime/GfxDevice/d3d11/TranslateD3D11.cpp Line: 252)

  • Assertion at ..\mono\metadata\threads.c:1792, condition `internal' not met

180 Stereo (L/R) with transparency (T/B) not working on Oculus Go..

Not able to get 180 Video in sphere with Stereo (L/R) and Transparency (T/B) working on the Oculus GO, Seems to work in the editor, although still some issue, e.g. seemed part of the 180 is replicated,

Link to the video we crafted for testing is below in link section

Unity 2018.2.10, and your latest avpro release (1.9.12).
Using your 180 demo scene, but changing the Stereo and transparency settings in the player

Videos
If applicable, add a copy of your video or the URL
https://rg-drop-bucket.s3.us-west-2.amazonaws.com/Outgoing/out.mp4?AWSAccessKeyId=AKIAJYMY3I5B4GYELG5A&Expires=1584856650&Signature=KQTUNIXmpx5vw6WjFsJlmykyu1Q%3D

Bitrate and Quality control when using the H264 codec

Dear RenderHeads Support,

we are working with AVPro Movie Capture for quite some time now but for a new project we need to get a .mp4 movie not .avi anymore.
Previously we were using the x264 codec (https://sourceforge.net/projects/x264vfw/) so we could control the quality and the size of the movie pretty easily but the plugin does not allow use to switch to mp4.

Using the Microsoft H264 and mp4, there is no control on the quality and the bitrate, which does not work for us as the move is way too big with default settings.

1 - is there a possibility to change the bitrate and the quality with Media Foundation h264 in the very close future?
2 - is there an alternative to get mp4 with x264vfw ?

Thank you for your help and time !

video always plays automatically in Android player

In the Android player, the video always starts automatically, disregarding the value of the autoPlay parameter in MediaPlayer.OpenVideoFromFile

  • Unity version: 2018.3.12f1
  • AVPro Video version: 1.9.12 (from the Asset Store) using exoplayer
  • Operating system version: Android 9
  • Device model: Pixel 3
  • Video specs: 1080w x 1920h, 30fps, h.264 4.3 MB

Steps: (Android player)

  1. call mediaPlayer.OpenVideoFromFile(MediaPlayer.FileLocation.AbsolutePathOrURL, path, false)
    EXPECTED: the video should not start playing
    ACTUAL: the video starts playing automatically
    Troubleshooting:
    mediaPlayer.Control.IsPlaying() returns true
    mediaPlayer.m_AutoStart is false

Progressive transmission problem in iOS

Describe the bug
Sometimes with the same video
-Show the first frame of the video but it is freeze
-The video is shown but it is not heard
-The video is heard but not shown
-Sometimes AVPro works correctly

Details
-We have the videos uploaded to our server, the videos are provided as resources (we do not use Streaming in the server)
-The video is played during the augmented reality of Vuforia
-During playback, we record a video of what is shown on the screen
-For the video recording we use (NatCorder)
-For the recording of the audio we use the native microphone of Unity
-We do not compile with (Metal) in PlayerSettings
-We are using the following function of AVPro (mediaPlayer.Control.SetPlayWithoutBuffering(true);)
-We use FFmpeg to process the video before uploading to the server
->For video processing with FFmpeg we use the following command line
(-i input.mp4 -preset ultrafast -vf scale='min(320,iw)':'min(400,ih)' output.mp4)
-In Android, so far we don't have these problems

Note: We have activated Multithreaded Rendering

  • Vuforia:7.2.23
  • Unity version: 2018.2.8f1
  • AVPro Video version: 1.9.10
  • Operating system version: IOS (9 and above)
  • Device model:
  • Video sample (https://mega.nz/#!t9V3EIZK!u-DTZmqEogca7vWuNCqY44GF9k8c9vpgrYh7moJGutk)
  • Video specs (~320x400 , fps: 30, codec : H264 - MPEG-4 AVC (part 10) (avc1) , (5 ~ 10) mb):
  • Audio specs (64 kb/s , Códec: MPEG Audio layer 1/2 (mp4a), 48000 Hz, Mono)

the logs do not show relevant information

UWP ARM64 build

Describe the solution you'd like
There are already builds for UWP x86, x64 and ARM platforms. With Unity 2019 there is an option of UWP ARM64. DLL for this platform is missing. Is it possible to build the plugin for UWP ARM64 as well?

The event could not be triggered

20190124172303

Switch video multiple times .
“FirstFrameReady” event was not triggered.
And the player doesn't work.

  • Unity version: Unity 2017.4.3f1 (64-bit)
  • AVPro Video version: AVPro Video 1.9.8
  • Operating system version: win10

Memory leaks in iOS

Describe the bug
Video playing consumes over 100 MB for very little video (51 KB).
And that memory never released.

But using internal Unity VideoPlayer, memory released after closing video.

Your Setup (please complete the following information):

  • Unity version: 2018.3.11f1, 2018.2.21f1
  • AVPro Video version: 1.9.12
  • Operating system version: 12.2
  • Device model: iPad Mini 2
  • Video specs (resolution, frame-rate, codec, file size): Any

To Reproduce

  1. Play video.
  2. CloseVideo and Dispose MediaPlayer.

Logs
If applicable, add error logs to help explain your problem.

Screenshots
If applicable, add screenshots to help explain your problem.

Videos
If applicable, add a copy of your video or the URL

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Instead email the link to us [email protected]

Failed to create player

Describe the bug
Using AVPro Video for splash scene.
Quit app and restart app quickly then "Failed to create player".

Your Setup (please complete the following information):

  • Unity version: 2018.3.11f1
  • AVPro Video version: 1.9.12
  • Operating system version: Android 8.1.0
  • Device model: Redmi Note 5
  • Video specs (resolution, frame-rate, codec, file size): Any

To Reproduce

  1. Quit app using Application.Quit()
  2. Re-start app quickly

Logs

[AVProVideo] Failed to create player instance 
UnityEngine.Logger:Log(LogType, Object)
RenderHeads.Media.AVProVideo.AndroidMediaPlayer:.ctor(Boolean, Boolean, VideoApi, Boolean, Audio360ChannelMode, Boolean)
RenderHeads.Media.AVProVideo.MediaPlayer:CreatePlatformMediaPlayer()
RenderHeads.Media.AVProVideo.MediaPlayer:Initialise()
RenderHeads.Media.AVProVideo.MediaPlayer:Start()

[AVProVideo] Initialising AVPro Video (script v1.9.12 plugin v1.9.10) on Adreno (TM) 509/OpenGL ES 3.2 V@269.0 (GIT@a1355e2, I141a912644) (Date:04/18/18) (MT True) on Android 
UnityEngine.Logger:Log(LogType, Object)
RenderHeads.Media.AVProVideo.MediaPlayer:Initialise()
RenderHeads.Media.AVProVideo.MediaPlayer:Start()

[AVProVideo] Opening jar:file:///data/app/com.test.app-jOTKGt8J8Fpxlbv1qx4j1Q==/base.apk!/assets/video/downloaded_from_google_play.mp4 (offset 0) 
UnityEngine.Debug:Log(Object, Object)
RenderHeads.Media.AVProVideo.MediaPlayer:OpenVideoFromFile()
<PlayCoroutine>d__8:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

[AVProVideo] m_Video is null! 
UnityEngine.Logger:Log(LogType, Object)
RenderHeads.Media.AVProVideo.AndroidMediaPlayer:OpenVideoFromFile(String, Int64, String, UInt32, UInt32, Int32)
RenderHeads.Media.AVProVideo.MediaPlayer:OpenVideoFromFile()
<PlayCoroutine>d__8:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

[AVProVideo] Failed to open jar:file:///data/app/com.test.app-jOTKGt8J8Fpxlbv1qx4j1Q==/base.apk!/assets/video/downloaded_from_google_play.mp4 
UnityEngine.Debug:LogError(Object, Object)
RenderHeads.Media.AVProVideo.MediaPlayer:OpenVideoFromFile()
<PlayCoroutine>d__8:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Instead email the link to us [email protected]

Same clock source for multiple videos

One important feature for our application is video clock synchronization in order to create a user-editable video timeline (very simple but similar to Adobe Première or any other video editing software).

What we need to accomplish (with just a couple of calls (setClock()) in DirectShow on Windows) is that different media on different player will share the same clock while playing, that is not just for starting them at the same time, they can also be started later like in a timeline, but to ensure their advancement is handled by the same clock.

It seems Unity VideoPlayer has some support for it:
https://docs.unity3d.com/ScriptReference/Video.VideoPlayer-externalReferenceTime.html
https://docs.unity3d.com/ScriptReference/Video.VideoPlayer-timeSource.html

Can we expect such a function in your asset too?
Or are there interfaces to use in order to code the sync ourselves?

Video not play on iOS, PC!

I have a video that AVPro can play without issues on Android, Mac but does not work on PC, iOS! I cannot share the video, but here are some info that might help

Video Codec: H.264
Resolution : 2160x2160
Bitrate: 12031kbps

I suspect the bitrate might be the culprit.

Tested using latest version of AVPro 1.9.10

[HIGH PRIORITY] Fails to initialize on ARM64 with IL2CPP

On Android... throws the following error when running on ARM64 with IL2CPP which is a requirement from Google Play store starting from 1 August 2019 all releases must be compliant with the Play 64-bit requirement.

05-01 11:33:12.901 14728 14801 E Unity : AndroidJavaException: java.lang.NoClassDefFoundError: com.RenderHeads.AVProVideo.AVProMobileVideo
05-01 11:33:12.901 14728 14801 E Unity : java.lang.NoClassDefFoundError: com.RenderHeads.AVProVideo.AVProMobileVideo
05-01 11:33:12.901 14728 14801 E Unity : at java.lang.Class.classForName(Native Method)
05-01 11:33:12.901 14728 14801 E Unity : at java.lang.Class.forName(Class.java:453)
05-01 11:33:12.901 14728 14801 E Unity : at java.lang.Class.forName(Class.java:378)
05-01 11:33:12.901 14728 14801 E Unity : at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
05-01 11:33:12.901 14728 14801 E Unity : at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
05-01 11:33:12.901 14728 14801 E Unity : at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
05-01 11:33:12.901 14728 14801 E Unity : at android.os.MessageQueue.next(MessageQueue.java:395)
05-01 11:33:12.901 14728 14801 E Unity : at android.os.Looper.loop(Looper.java:181)
05-01 11:33:12.901 14728 14801 E Unity : at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)
05-01 11:33:12.901 14728 14801 E Unity : Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.LighthouseGamesStudio.ChallengeStars-m8qVikusn872Di8r-NwmyA==/base.apk"],nativeLibraryDirectories=[/data/app/com.LighthouseGamesStudio.ChallengeStars-m8qVikusn872Di8r-NwmyA==/lib/arm64, /data/app

TextureProducer returns a black texture in ExoPlayer

Bug description
I need to switch my 360 videos without having black frames in the middle, to do so I am saving a texture from the TextureProducer and showing it on a mesh during the time the new video is loading. It works quite well in the Unity Edito, on iOS (VR Cardboard mode) and it works on Android using Media Player but it does not work using ExoPlayer on Oculus Go (Android 7.1.2). Using ExoPlayer the shown texture is black (but not null).

My setup:

  • Unity version: 2017.4.24f1
  • AVPro Video version: 1.9.12
  • Operating system version: Android 7.1.2 (Oculus Go)
  • Device model: Oculus Go
  • Video specs (resolution, frame-rate, codec, file size):
    resolution: 3840x1922
    frame-rate: 29.970030
    codec: H264 - MPEG-4 AVC
    file size: it happens with several files having size ranging from 5 to 25MB.

To Reproduce

  1. Load a 360 video and show it on a sphere (VR mode)

  2. Run the following code to switch to another video
    // Get a reference to the current frame as Texture2D. Texture2D currentFrame = (Texture2D)mediaPlayer.TextureProducer.GetTexture(); // Blit the pixels on texture to the RenderTexture Graphics.Blit(currentFrame, TransitionRenderTexture); // Set the Texture on the Transition Screen Mesh Renderer Material transitionScreenMeshRenderer.material.SetTexture("_MainTex", TransitionRenderTexture);

  3. The render texture is black

How to decrease the video switching and decode & display lag

I am using AVProVideo for my project to display 360 videos on Unity Editor on windows platform. After every Mouse click, I am switching the videos and I have observed the time taken from changing the video file path to the first frame of the video becoming ready to play is almost 40 ms.
I want to get it by less than 16 ms. Is there any way or configuration to increase the number of threads or using direct GPU acceleration to decrease the video switching and playing time?

FYI, I have a 4096*2048 360 video which contains only one I frame. I will be happy to answer you if u have any further questions. Any help on this regard will be highly helpful.

AVPro video error

Dear renderheads,

Unfortunately, we have a strange problem in one of our apps using AVPro for video playback.

We have an idleMode in our app, where 5 different videos are constantly and randomly shown, but sometimes (3-4 hours after starting the app), we have a strange error and no video is played anymore.
Attached you can find the snippet from our log where the error occurs. Unfortunately we didn’t log the error code so far, which we implemented now. But since there is only "loading fail" and "decode fail", maybe you already have an idea what might be the problem? As soon as there is a user input (see at the end of the log), normally one of the main videos should be played – but we get an error instantly. The only solution is to restart the app. Until the error occured, the videos were played without any problems for 65 times (see „video count“). Sometimes the app runs the whole day without any problems (around 600 plays).
LogErrors.txt

Our Setup:

  • Unity version: 2018.3.5f1
  • AVPro Video version: 1.9.12
  • Operating system version: Windows 10
  • Video specs (resolution, frame-rate, codec, file size): 2160x2160px, h264 - MPEG-4AVC (part10) (avc1), 25fps, ~20-70mb

Do you have any idea, what we can do/test?

Best regards,
Chris

Gibberish Korean subtitle

Describe the bug

  • Go to demo subtitle scene (11_Demo_Subtitles.unity)
  • Load a korean SRT subtitle file
  • Subtitle text sometimes show correct korean words, the rest are gibberish texts.

Setup:

  • Unity version: 2018.3.5f1
  • AVPro Video version: 1.9.12
  • Operating system version: Android

Screenshots
Capture

Subtitle file
KOR.zip

Any help is greatly appreciated. Opening the file via Microsoft Word is fine, texts are correctly shown . I have tried using various Korean font, setting font import setting in Unity to Dynamic/Unicode - no dice.

AVProWindowsMedia for H264 encoded videos

I am using the AVPro MediaPlayer to play my own H.264 encoded 360 video stream in Unity on Windows Platform. But while playing that video files it's showing me the following errors.

Errors :
[AVProWindowsMedia] Movie failed to load - do you have the required codecs installed?
[AVProWindowsMedia] For MP4 files you need an MP4 splitter such as Haali Media Splitter or GDCL.
[AVProWindowsMedia] For HIGH profile H.264 videos you need to install an external H.264 decoder.

Can u please tell me what are additional things I have to install and add to make the H.264 encoded videos work with AVPro?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.