MPEG2-TS的Xuggler IContainerFormat字段

时间:2018-12-16 07:42:04

标签: java xuggler

我正在尝试使用Xuggler创建视频输出流,并使用示例代码成功地输出到该流:

    mediaWriter = ToolFactory.makeWriter(XugglerIO.map(outputStream));
    IContainerFormat containerFormat = IContainerFormat.make();
    containerFormat.setOutputFormat("ogg", null, "application/ogg");
    mediaWriter.getContainer().setFormat(containerFormat);

    // add the video stream
    mediaWriter.addVideoStream(0, 0, ICodec.ID.CODEC_ID_THEORA, size.width, size.height);

但是,我想使用MPEG-2 TS作为输出格式,而不是使用ogg输出格式。如果要在MPEG-2 TS中输出,setOutputFormat方法中的字段是什么?

1 个答案:

答案 0 :(得分:0)

我只是猜到偶然发现了它。其他想知道的人:

containerFormat.setOutputFormat("mpegts", null, "application/mpegts");