Should ofAVFoundationPlayer be able to play an .h264 file?


#1

I have some .h264 files that I am trying to play on the Mac. These play fine on the RPi with the native ofVideoPlayer however on OS X they don’t seem to be recognized.

I’m thinking this is because AVFoundation wants MPEG4 (see around the 11 minute mark here ) but wanted to make sure I wasn’t missing something simple


#2

yes linux uses gstreamer which has lots of different demuxers for any weird format while avfoundation probably only suports mov or mp4 containers.

If you need to play those formats in osx you can always use ofxGStreamer but it needs the gstreamer sdk to be installed in the system


#3

I think ofAVFoundationPlayer can also play HLS streams. I had a small addon for this in the past before it was added in.

I did find this writeup for anyone looking to do something similar.


#4

Ended up getting it to work. It’s a pretty specific use case so I don’t think I’ll publish it as a supported ofxAddon but here is a working implementation in case someone needs it. It basically reads H264 data, sends to AVFoundation/VideoToolbox and sends out ofPixels