secondstory / ofxDSHapVideoPlayer

ofxDSHapVideoPlayer is a Hap video player addon for openFrameworks (Windows-only)
Other
37 stars 21 forks source link

Playback of ffmpeg encoded files #13

Open mpedge opened 6 years ago

mpedge commented 6 years ago

Hi,

I am having trouble playing .avi HAP files encoded with FFmpeg. Specifically, the line 194 of ofxDSHapVideoPlayer.cpp:

int sz = (*(uint8_t *)ptrBuffer) + ((*((uint8_t *)(ptrBuffer)+1)) << 8) + ((*((uint8_t *)(ptrBuffer)+2)) << 16);

always returns 0.

The FFmpeg command I use to create the file is: ffmpeg -i source.avi -vcodec hap -format hap output.avi

The frame always looks like this: ffmpeghaperror

If I encode HAP using Adobe then it all works and the aforementioned line returns the right size.

It seems like FFmpeg is not including a size information in the header?

Any ideas anyone?

mantissa commented 6 years ago

This looks like the command that is recommended by the Vivox folks (http://hap.video/using-hap.html). Unfortunately, I've chatted with a few people about this and haven't personally had any success generating files using FFmpeg. I'd recommend reaching out to the Renderheads or Vidvox folks directly to see if they have any tips.

bangnoise commented 6 years ago

Sections in a Hap frame can use a 4-byte or 8-byte header - the 8-byte version is indicated by the first three bytes being zero (as in this case). The Hap reference source provides a decoder which you could use to avoid having to reimplement one yourselves, otherwise this is detailed in the spec.

mantissa commented 6 years ago

Tom, thanks++ for pointing out what's missing from this Hap player. mpedge, it's going to take me a bit of time to make this fix. Let me know it's something that you'd like to tackle.

mpedge commented 6 years ago

Thanks, Tom, from me as well.

@mantissa : When I have the time, I am going to work on Cinder's block. When/if I manage to solve it, I'll let you know.

diemildefreude commented 1 year ago

Hey, @mantissa @mpedge I've been having the same problem as I want to write and play hap files live in oF using ofxFFmpegRecorder and ofxDSHapVideoPlayer respectively (posted about it here on the oF forums). Has there been any progress on this front?