gpt4 book ai didi

linux - 如何使用 Gstreamer 创建索引视频文件

转载 作者:太空宇宙 更新时间:2023-11-04 10:58:33 25 4
gpt4 key购买 nike

我正在尝试使用 Gstreamer 在 Linux 中创建一个可搜索(索引)的视频文件。我的管道用于记录和保存数据,但我不知道如何索引数据,所以我可以使用 gst_element_seek_simple() [ http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+4%3A+Time+management]

我看过这个帖子:Gstreamer video output position tracking and seeking并验证我正在使用 -e 在管道上发送 EOS。

这是我的管道和输出。我正在尝试将其同时显示到我的嵌入式系统屏幕并保存到 M4V 文件。

# gst-launch-0.10 -e v4l2src ! \
tee name=t !
queue !
video/x-raw-yuv,width=320,height=240 !
videoflip method=clockwise !
ffmpegcolorspace !
fbdevsink t. !
queue !
ffmpegcolorspace !
ffenc_mpeg4 !
filesink location=output.m4v

这是输出:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not get parameters on device '/dev/video0'
Additional debug info:
v4l2src_calls.c(235): gst_v4l2src_set_capture (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: Inappropriate ioctl for device
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...

(gst-launch-0.10:534): GLib-CRITICAL **: Source ID 62 was not found when attempting to remove it
EOS on shutdown enabled -- Forcing EOS on the pipeline
Waiting for EOS...
Got EOS from element "pipeline0".
EOS received - stopping pipeline...
Execution ended after 10057977251 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

这是 gst-discover 在我的新文件上的输出:

beaglebone:# gst-discoverer-0.10 output.m4v 
Analyzing file:///output.m4v
Done discovering file:///output.m4v

Topology:
video: MPEG-4 Video

Properties:
Duration: 0:00:00.000000000
Seekable: no

谢谢

最佳答案

您需要以可搜索/索引格式存储结果。为此,您可以将 mpeg4 视频放入 mp4 或 matroska 等容器中。使用 "!mp4mux !filesink"或 "!matroskamux !filesink"将其放入那些应该使其可搜索的格式中。

旁注:gstreamer 0.10 已过时且无人维护超过 2 年,请升级到 1.0。 http://gstreamer.freedesktop.org/是官方 gstreamer 网站,您可以在那里找到 1.x 版本的发布。 gstreamer.com 网站是一个与官方项目无关的项目,如果您阅读 gstreamer.com 中的文本,您会发现您应该使用官方存储库和安装程序。

关于linux - 如何使用 Gstreamer 创建索引视频文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27909021/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com