0
iOSの実行中のパイプラインからスナップショットを作成しようとしています。私はスナップショットを撮るためにボタンを使います。iOSでgstreamerで実行中のパイプラインからスナップショットを取得
私は、次のパイプライン
udpsrc auto-multicast=true address=224.1.1.1 port=5004"
+ " ! application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)\"Z0JAH6aAQAYZAA\\,aM4wpIAA\", payload=(int)96, ssrc=(uint)19088743, timestamp-offset=(uint)0, seqnum-offset=(uint)0"
+ " ! rtpjitterbuffer latency=400"
+ " ! rtph264depay ! avdec_h264 ! videoconvert"
+ " ! tee name=snapshot snapshot. ! queue ! valve name=snap drop=true ! jpegenc ! filesink name=filepath location=screenshot.jpg async=false snapshot. ! queue"
+ " ! autovideosink
だから私は、弁を処理するために、私のボタンに次のコードを使用してい:
GstElement *element = gst_bin_get_by_name (GST_BIN (pipeline), "snap");
if (strcmp("drop", "drop") == 0)
{
gboolean prop_val = FALSE;
// if the property value is true, then send an EOS.
if (strcmp("false", "true") == 0)
{
gst_element_send_event(element, gst_event_new_eos());
prop_val = TRUE;
} else {
prop_val = FALSE;
}
g_object_set (element, "drop", prop_val, NULL);
}
しかし、このコードで私が唯一のスクリーンショットを撮ることができます。画像のファイル名は設定できません。
ストリームをブロックせずにスクリーンショットを保存し、ボタンをクリックするたびにドキュメントフォルダにカスタム名でイメージを保存するにはどうすればよいですか?