Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / AGK 2017.09.25 tiers 1 : failed to load video : unsupported codec

Author
Message
TDavid
11
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 6th Nov 2017 11:30
Hi.

I have trouble loading a video with the loadvideo() function. I get the error "failed to load video : unsupported codec at line 111" on windows 7.

Here's what mpc hc has to say about my video :

Video: MPEG4 Video (H264) 720x480 (16:9) 29.97fps 3752kbps [V: h264 main L3.0, yuv420p, 720x480, 3752 kb/s]
Audio: AAC 44100Hz mono 129kbps [A: Mono [eng] (aac lc, 44100 Hz, mono, 129 kb/s)]

Do you know what could be wrong ?
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 6th Nov 2017 23:36
Does the video play normally? (I mean through your video player of choice?) - If not it could be a codec issue.
Dybing
13
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 7th Nov 2017 00:23
I've found AppGameKit is *VERY* finicky with regards to supported video-formats on Win7. With the exception of .WMV which it'll gobble up without complaint. On Win10 mp4 files encoded with h.265 will also behave very nicely, though this format is not supported on Win7 straight out of the box. With h.264 it is a crap-shoot on both Win7 and Win10. Some play nice, others, not so much. This is regardless of how the file plays in a video-player.

Speaking of, all mp4 files encoded with h.264 encoding I've thrown at Android and iOS devices play perfectly - though on iOS there are trouble with keeping track of play-duration and setting a specific playback point that isn't the beginning. Using h.265 encoding (better quality, smaller size) will only work on Android 5.0 and later, and iOS11. For OSX, I have no idea, I just use that abomination to compile and distribute onto iOS...

Linux - well, video isn't supported. Though Paul have put it onto the todo-list. Unfortunately this means that I've spent quite a lot of time using Win10 lately developing the app I'm working on, as it is mainly centered around video.

But if you're stuck on Win7 - try repackaging your video files to .WMV.

For my project, my server-side video-repo is h.265 encoded - with some code on the AppGameKit client to detect Win7 and iOS and feed those h.264 videos encoded on the fly on the server from a h.265 file before transfer. Not a biggie for my application, as the videos are quite small (average ~150-200kb a piece). This works fine for now, but before release I'll have to keep two video-repos to save on CPU usage on the server. Storage is much cheaper than CPU use on just about any cloud host
TDavid
11
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 7th Nov 2017 09:15 Edited at: 7th Nov 2017 09:25
The video runs fine on my pc and my android device (a nexus 5x). It's a 35 seconds 1080p video recorded with my nexus 5x. I get the loading error both through the IDE on my PC and the android AppGameKit player. I transcoded it to 480p (mp4, h.264, aac) but it didn't work either. Did I miss something ? Is there anything to do to make loadvideo() work ?

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 14th Nov 2017 15:00
It might not be the video codec causing the problem, have you tried changing the audio codec to MP3? AppGameKit now relies on Windows Media Foundation to decode the video, it should have better support for h.264 on Windows 8 and 10, not sure about 7 but I haven't had any problems myself.
TDavid
11
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 14th Nov 2017 15:40
Thanks for your help Paul. I transcoded the sound to mp3. Same error. Here's what mpc-hc has to say about the file :

Video: MPEG4 Video (H264) 720x480 (16:9) 29.97fps 3752kbps [V: h264 main L3.0, yuv420p, 720x480, 3752 kb/s]
Audio: MP3 44100Hz mono 127kbps [A: Mono [eng] (mp3, 44100 Hz, mono, 127 kb/s)]
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 14th Nov 2017 16:13
All looks fine to me. I just double checked and we use Windows Media Foundation on Windows 8 and 10 only, it seems Windows 7 had some problems with it for some people, so Windows 7 is still using DirectShow. In this case you will need to make sure you have an h.264 codec for DirectShow installed.
TDavid
11
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 20th Nov 2017 12:37
The video loaded fine on windows 10 indeed. I expected the video to load fine on my android device's player regardless of the OS I'm coding with. I guess I know even less than I thought I did.
Dybing
13
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 23rd Nov 2017 13:30
With the release of Win10 Fall Creators Update - AppGameKit support for h265 just broke.

In my project, that means reverting back to h264 encoding - but depending on videofile, this may or not play correctly with AppGameKit *UNLESS* the video is encoded at a resolution that is divisible by 16 for some reason. So if you got a bunch of videos in all kinds of odd and even resolutions - to convert them, go get the 'HandBrake' video-converter (free, open source, available for Windows and Linux - possibly even MacOS though I've not bothered to remember), and change the modulus option from whatever it is to 16 and then hit the start encode button.

Login to post a reply

Server time is: 2024-11-24 06:00:44
Your offset time is: 2024-11-24 06:00:44