[jitsi-dev] [libjitsi] Add a protocol / CaptureDevice that read an ivffile that contains vp8 frames (#11)


#1

Also add a custom MediaDevice for convenience.

IVF files can be created from webm with mkvtoolnix if you extract the
video track.
You can merge this Pull Request by running:

  git pull https://github.com/Haerezis/libjitsi ivffile

Or you can view, comment on it, or merge it online at:

  https://github.com/jitsi/libjitsi/pull/11

-- Commit Summary --

  * Add a protocol / CaptureDevice that read an ivffile that contains vp8

-- File Changes --

    A src/org/jitsi/impl/neomedia/jmfext/media/protocol/ivffile/DataSource.java (97)
    A src/org/jitsi/impl/neomedia/jmfext/media/protocol/ivffile/IVFFileReader.java (128)
    A src/org/jitsi/impl/neomedia/jmfext/media/protocol/ivffile/IVFHeader.java (204)
    A src/org/jitsi/impl/neomedia/jmfext/media/protocol/ivffile/IVFMediaDevice.java (52)
    A src/org/jitsi/impl/neomedia/jmfext/media/protocol/ivffile/IVFStream.java (117)

-- Patch Links --

https://github.com/jitsi/libjitsi/pull/11.patch
https://github.com/jitsi/libjitsi/pull/11.diff

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/11


#2

Thanks for the contribution!

As we discussed elsewhere, an IVF file doesn't have a well-defined "framerate" -- each frame has its own timestamp. The two fields in the IVF file header, "rate" and "scale" are used to specify the "timebase", which controls how the frames' timestamps are to be interpreted. A frame timestamp of "X" means "X * scale / rate" seconds.

ffmpeg, for example, produces IVF files with rate=90000, scale=1 (so timebase 1/90000) and we would like to be able to handle such files (to get one: ffmpeg -i file.webm -vcodec copy file.ivf )

So, I don't think using a framerate of "rate"/"scale" for the format of the DataSource makes sense. I think the format should have an unspecified framerate (Format.NOT_SPECIFIED).

In IVFStream, you save (scale/rate) * 1000 as an int, and use that as timebase. This limits the timebase to 1ms, and won't work for files with timebase 1/90000. In IVFStream you already have the IVFFileReader, and hence the IVFHeader, so you can use the exact rate and scale values.

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/11#issuecomment-49404492


#3

Rebased and merged. Thank you!

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/11#issuecomment-49452347


#4

Closed #11.

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/11#event-143171214