yasirkula/UnityNativeCamera

Video doesn't open in PC after File.Move / File.Copy / Sending in to the Server

WarriorWork opened this issue · 6 comments

Video doesn't open on PC after File.Move / File.Copy / Send into the Server:
It occurs sometimes and is not persistent, most of the time it doesn't work all right.
I get errors like this one
image

  • Unity version: 2020.3.15f2
  • Platform: Android / iOS
  • Device: Xioami 12, iPad Air
  • How did you download the plugin: through the Asset Store

Does the file have an extension?

Yeah of course .mp4
Ok I think I have some progress
Now on Android, it works on medium Quality (I assume that the Low Quality made the problem)
However, I tried the same on iOS and the video was saved in our server but has the same issue I mentioned in the top...

Does the file have an extension?

Can you play the video in VideoPlayer or via the example code's Handheld.PlayFullScreenMovie function on Android/iOS? This may be a codec issue. The video may be recorded in HEVC format. I'd try playing it with MPC-HC on PC since it supports lots of codecs.

Can you play the video in VideoPlayer or via the example code's Handheld.PlayFullScreenMovie function on Android/iOS? This may be a codec issue. The video may be recorded in HEVC format. I'd try playing it with MPC-HC on PC since it supports lots of codecs.

Yeah, it seems codecs issues! because when I run the video on the browser or via VLC and not via Media Player, it works!
So firstly thank you.
Additionally, if you have got any idea of how to solve it, Ill be happy to hear that...
The problem is when I transfer the video to the Server (via UnityWebRequest) it wouldn't open via Media Player :)
Thank you!

Can you play the video in VideoPlayer or via the example code's Handheld.PlayFullScreenMovie function on Android/iOS? This may be a codec issue. The video may be recorded in HEVC format. I'd try playing it with MPC-HC on PC since it supports lots of codecs.

Do you know if I can controll the codec by the NativeCamera plugin or in another way?
As I see the most popular codec is H.265... can I achieve that?

I couldn't find a way to explicitly specify the codec to use. As you've said, changing the quality may indirectly affect the codec. I'd expect this to be consistent on iOS devices but not on Android devices. I think you need either a native code on the device that converts the video from the recorded format to the desired format, or a code that does the same on the server.