yasirkula / UnityNativeCamera

A native Unity plugin to take pictures/record videos with device camera on Android & iOS
MIT License
592 stars 71 forks source link

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

Open WarriorWork opened 6 months ago

WarriorWork commented 6 months ago

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

yasirkula commented 6 months ago

Does the file have an extension?

WarriorWork commented 6 months ago

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?

yasirkula commented 6 months ago

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.

WarriorWork commented 5 months ago

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!

WarriorWork commented 5 months ago

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?

yasirkula commented 5 months ago

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.