How to change video source in Amazon kinesis_video_gstreamer_sample_app.cpp?

和自甴很熟 提交于 2020-01-15 09:43:13

问题


I am running kinesis_video_gstreamer_sample_app.cpp on MacOS and it streams to AWS Kinesis from FaceTime (iSight) camera. How can I switch the video source to a USB Webcam? Thanks :)


回答1:


Ok, I figured it out finally, modify the file kinesis_video_gstreamer_sample_app.cpp as follows.

Change:

if (data.encoder) {
    data.source = gst_element_factory_make("autovideosrc", "source");

To:

if (data.encoder) {
    data.source = gst_element_factory_make("avfvideosrc", "source");
    g_object_set(G_OBJECT(data.source), "do-timestamp", TRUE, "device-index", 1, NULL);


来源:https://stackoverflow.com/questions/50352759/how-to-change-video-source-in-amazon-kinesis-video-gstreamer-sample-app-cpp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!