解码器:跳过一个流

时间:2015-05-24 13:21:52

标签: gstreamer

我想用覆盆子pi上的Gstreamer对我的电视录制进行编码。灵感来自this post,以下代码适用于下载的mkv:

/usr/bin/gst-launch-1.0 -e filesrc location=/media/Seagate/complete/TV/Better\ Call\ Saul/Season\ 01/Better\ Call\ Saul\ -\ S01E10\ -\ Marco.mkv ! decodebin name=demux ! queue ! audioconvert ! audio/x-raw ! audiorate ! avenc_ac3 bitrate=320000 ! mux. mpegtsmux name=mux ! filesink location=/media/Seagate/pvr/Buitenhof_compressed.mkv demux. ! queue ! videoconvert ! deinterlace ! omxh264enc target-bitrate=2000000 control-rate=1 inline-header=true periodicty-idr=250 interval-intraframes=250 ! "video/x-h264,profile=high" ! h264parse ! mux.

使用过的文件具有这种结构(gst-discoverer输出):

Topology:
  container: Matroska
    audio: AC-3 (ATSC A/52)
    video: H.264

Properties:
  Duration: 0:49:18.048000000
  Seekable: yes
  Tags: 
      container format: Matroska
      audio codec: AC-3 audio
      language code: und
      video codec: H264
      minimum bitrate: 7288
      bitrate: 24263
      maximum bitrate: 9206

我的录音软件(TVHeadend)输出了这种格式:

Topology:
container: Matroska
    subtitles: application/x-subtitle-unknown
    subtitles: application/x-subtitle-unknown
    audio: MPEG-1 Layer 2 (MP2)
    audio: AC-3 (ATSC A/52)
    audio: MPEG-1 Layer 2 (MP2)
    video: H.264

Properties:
  Duration: 0:00:06.440000000
  Seekable: yes
  Tags: 
      title: Buitenhof
      extended comment: DATE_BROADCASTED=2015-05-24 10:05:00
      container format: Matroska
      audio codec: MPEG 1 Audio, Layer 2
      language code: nl
      nominal bitrate: 256000
      has crc: true
      channel mode: stereo
      video codec: H264
      minimum bitrate: 8972400
      bitrate: 16546750
      maximum bitrate: 22841600

如何告诉管道跳过字幕流并使用AC-3和H264流?我试过decodebin name=demux demux.audio_01无济于事。输出是

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Missing element: application/x-subtitle-unknown decoder
Missing element: application/x-subtitle-unknown decoder

将字幕包括在内也会很不错,但我当然可以没有它们。

1 个答案:

答案 0 :(得分:0)

流的顺序与问题无关。视频内存不足。对于一个完整的高清mkv,我需要将视频内存分割为128MB。

执行此操作的一种方法是运行sudo raspi-config对于我的raspbian版本,视频内存拆分位于高级菜单下。需要重新启动。

在此之后,我发布的命令