简体   繁体   English

是否有命令行命令可以在一行中为 gstreamer 管道测试 appsrc 和 appsink?

[英]Is there command line command to test appsrc and appsink in a single line for gstreamer pipeline?

What I am trying to code我要编码的内容

  1. Getting buffer from a h264 encoded mp4 file从 h264 编码的 mp4 文件中获取缓冲区
  2. Passing the buffer to an appsink将缓冲区传递给应用程序接收器
  3. Then separately in another pipeline, the appsrc would read in the buffer然后分别在另一个管道中,appsrc 将在缓冲区中读取
  4. The buffer would be h264parse and then send out through rtp using GstRTSPServer缓冲区将是 h264parse,然后使用 GstRTSPServer 通过 rtp 发送出去

Would want to simulate this for a CLI pipeline to make sure the video caps is working:想要为 CLI 管道模拟这一点,以确保视频上限正常工作:

My attempts as follows: gst-launch-1.0 filesrc location=video.mp4.我的尝试如下:gst-launch-1.0 filesrc location=video.mp4。 appsink name=mysink.应用程序名称 = mysink。 appsrc name=mysrc.应用程序名称 = mysrc。 video/x-h264 width=720 height=480 framerate=30/1 !视频/x-h264 宽度=720 高度=480 帧率=30/1 ! h264parse config-interval=1 ! h264parse 配置间隔=1 ! rtph264pay name=pay0 pt=96 ! rtph264pay 名称=pay0 pt=96 ! udpsink host=192.168.xx port=1234 udpsink 主机=192.168.xx 端口=1234

But this doesnt really works and I not too sure this is how appsrc and appsink is used但这并没有真正起作用,我不太确定这就是 appsrc 和 appsink 的使用方式

Can some one enlighten me有人可以启发我吗

EDIT: The file i am trying to play has the following property编辑:我要播放的文件具有以下属性

General Complete name: video3.mp4 Format: AVC Format/Info: Advanced Video Codec File size: 45.4 MiB一般完整名称:video3.mp4 格式:AVC 格式/信息:高级视频编解码器文件大小:45.4 MiB

Video
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Baseline@L2.2
Format settings, CABAC                   : No
Format settings, ReFrames                : 1 frame
Format settings, GOP                     : M=1, N=30
Width                                    : 720 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 3:2
Frame rate                               : 30.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive

Thanks谢谢

You won't be able to do this with appsink and appsrc , as these are explicitly meant to be used by an application to handle the input/output buffers.您将无法使用appsinkappsrc执行此操作,因为它们明确意味着应用程序使用它们来处理输入/输出缓冲区。

That being said, if what you really want is to test the caps on both sides, just connect them together.话虽如此,如果您真正想要的是测试两侧的盖子,只需将它们连接在一起即可。 They both advertise "ANY" caps, which means they won't really influence the caps negotiation.他们都宣传“任何”上限,这意味着他们不会真正影响上限谈判。

gst-launch-1.0 filesrc location=video.mp4 ! \
    "video/x-h264, width=720, height=480, framerate=30/1" ! \
    h264parse config-interval=1 ! \
    rtph264pay name=pay0 pt=96 ! \
    udpsink host=192.168.x.x port=1234

You'll get an error also, since MP4 is not the same as H264: the former is a container format, while the latter is a video codec.你也会得到一个错误,因为 MP4 与 H264 不同:前者是一种容器格式,而后者是一种视频编解码器。 In your case, the MP4 file will probably contain an H.264 video: in that case, it should work by putting a qtdemux element after the filesrc .在您的情况下,MP4 文件可能包含 H.264 视频:在这种情况下,它应该通过在 filesrc 之后放置一个qtdemux元素来filesrc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM