VP8 encoding on Android
-
wrote on 8 Mar 2015, 12:57 last edited by marianofino 3 Aug 2015, 13:05
Hello everyone!
My ultimate goal is to record video from Android camera and save it as WebM (VP8/Vorbis). I am using Qt 5.4.
One of the issues found so far, is that Qt doesn't seem to recognize the VP8 codec on Android 4.4. When I output the available codecs, this is the list shown:
D/Qt (23133): Video codecs: D/Qt (23133): ========== D/Qt (23133): ../camera/video-source/src/main.cpp:18 (void debugCodecs()): "h263" D/Qt (23133): ../camera/video-source/src/main.cpp:18 (void debugCodecs()): "h264" D/Qt (23133): ../camera/video-source/src/main.cpp:18 (void debugCodecs()): "mpeg4_sp" D/Qt (23133): ../camera/video-source/src/main.cpp:21 (void debugCodecs()):
The official Android documentation mentions that Android 4.4 has a VP8 encoder (http://developer.android.com/guide/appendix/media-formats.html#core), but on the list shown above, it doesn't appear. A strange thing, is that the last result is empty, which makes me think that somehow Qt recognizes that there is one more codec, but it doesn't show the name.
This is the code I'm using to output the list of codecs:
QCamera camera; QMediaRecorder mediaRecorder(&camera); qDebug() << "\nVideo codecs:\n=========="; foreach (const QString &codecName, mediaRecorder.supportedVideoCodecs()) { qDebug() << codecName; }
My questions are:
- Any idea why Qt doesn't recognize the VP8 codec on Android 4.4?
- Does somebody had an experience encoding to WebM and would like to share it?
- Would you consider a good idea to bundle the codecs together with the app?
PS: Just to add more info to the issue, I reviewed the Qt Multimedia backend restrictions on Android (http://qt-project.org/wiki/Qt_Multimedia_Backends) but still, it should work.
-
wrote on 9 Mar 2015, 22:56 last edited by
After making some more research, I found that Qt doesn't read the system's codecs, but they are "hardcoded". Here is a link to the file which returns the available codecs in Android:
I will continue posting here my updates on this topic.
1/2