2014-01-30 17 views
1

我嘗試創建x264enc:如果我刪除線並不是所有的元素可以創建(x264enc或TIVidEnc1?)

int main (int argc, char *argv[]) { 
GstElement *pipeline, *src, *enc, *rtp, *sink; 
... 
... 

src = gst_element_factory_make ("videotestsrc", "src"); 
enc = gst_element_factory_make ("x264enc", "enc"); 
rtp = gst_element_factory_make ("rtph264pay", "rtp"); 
sink = gst_element_factory_make ("udpsink", "sink"); 

pipeline = gst_pipeline_new ("test-pipeline"); 

if (!pipeline || !src || !enc || !rtp || !sink ) { 
    g_printerr ("Not all elements could be created.\n"); 
    return -1; 
    } 
} 

enc = gst_element_factory_make ("x264enc", "enc"); 

程序會運行

和如果我運行命令

gst-inspect x264enc 

我得到的編碼信息,所以它存在..

我也試圖從「x264enc」到「TIVidEnc1」

任何想法改變..? 謝謝

回答

2

您可能沒有在您的系統上安裝x264enc編碼器。該編碼器不包含在gstreamer的基礎軟件包中,您需要手動下載並將其構建到您的系統上。下載後將其構建到醜陋的gstreamer庫上。 我不確定,但在Gstreamer更新的醜陋圖書館,它可能已包括在內。所以更新你的gstreamer也可以。

相關問題