我正在尝试打开mp4视频并将其解码并将其发送到appsink。然后从appsrc接收它并将其保存在mp4文件中。
我确定我设置了错误的上限。
const gchar *video_caps =
"video/x-raw,width=1280,height=720,framerate=25/1";
管道的前半部分:
string = g_strdup_printf ("filesrc location=\"%s\" ! decodebin name=dec ! queue ! videoconvert ! appsink caps=\"%s\" name=testsink",
in_filename, video_caps);
下半场:
string = g_strdup_printf ("appsrc name=testsource caps=\"%s\" !x264enc ! mp4mux! filesink location=\"%s\"",
video_caps,out_filename);
我应该设置什么上限才能使其正常工作?
我遇到错误:Received error in sink(appsrc module) Error: Internal data stream error.
答案 0 :(得分:0)
为了进行正确的大写协商,您必须在大写中特别提及appsink和appsrc的数据类型。必须根据先前的元素输出设置大写。
在问题中,decodebin
的输出数据为YUV I420
格式。
如果在到达appsrc之前对数据进行了调制或更改,则必须为appsrc设置正确的上限。
const gchar * appsink_video_caps = "video/x-raw,format=I420,width=1280,height=720,framerate=25/1";
const gchar * appsrc_video_caps = "video/x-raw,format=I420,width=1280,height=720,framerate=25/1";