Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playback of ffmpeg encoded files #13

Open
mpedge opened this issue Aug 28, 2018 · 5 comments
Open

Playback of ffmpeg encoded files #13

mpedge opened this issue Aug 28, 2018 · 5 comments

Comments

@mpedge
Copy link

mpedge commented Aug 28, 2018

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
Copy link
Contributor

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
Copy link

bangnoise commented Sep 4, 2018

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
Copy link
Contributor

mantissa commented Sep 5, 2018

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
Copy link
Author

mpedge commented Sep 5, 2018

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
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants