VP8 encoding on Android



  • 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:

    1. Any idea why Qt doesn't recognize the VP8 codec on Android 4.4?
    2. Does somebody had an experience encoding to WebM and would like to share it?
    3. 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.



  • 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:

    https://qt.gitorious.org/qt/qtmultimedia/source/108dda7a90bd0f0337358b0db47ae55acd16dea6:src/plugins/android/src/mediacapture/qandroidvideoencodersettingscontrol.cpp#L62

    I will continue posting here my updates on this topic.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.