Package net.pms.io

Examples of net.pms.io.OutputParams


        }
      }
      return fis;
    } else {
      // Pipe transcoding result
      OutputParams params = new OutputParams(configuration);
      params.aid = getMediaAudio();
      params.sid = media_subtitle;
      params.header = getHeaders();
      params.mediaRenderer = mediarenderer;
      timeRange.limit(getSplitRange());
View Full Code Here


      return speedInMbits;
    }

    private double doPing(int size) {
      // let's get that speed
      OutputParams op = new OutputParams(null);
      op.log = true;
      op.maxBufferSize = 1;
      SystemUtils sysUtil = PMS.get().getRegistry();
      final ProcessWrapperImpl pw = new ProcessWrapperImpl(sysUtil.getPingCommand(addr.getHostAddress(), 3, size), op, true, false);
      Runnable r = new Runnable() {
View Full Code Here

      PipeIPCProcess ffVideoPipe = new PipeIPCProcess(System.currentTimeMillis() + "ffmpegvideo", System.currentTimeMillis() + "videoout", false, true);

      cmdList.add(ffVideoPipe.getInputPipe());

      OutputParams ffparams = new OutputParams(configuration);
      ffparams.maxBufferSize = 1;
      ffparams.stdin = params.stdin;

      String[] cmdArrayDts = new String[cmdList.size()];
      cmdList.toArray(cmdArrayDts);

      cmdArrayDts = finalizeTranscoderArgs(
        filename,
        dlna,
        media,
        params,
        cmdArrayDts
      );

      ProcessWrapperImpl ffVideo = new ProcessWrapperImpl(cmdArrayDts, ffparams);

      ProcessWrapper ff_video_pipe_process = ffVideoPipe.getPipeProcess();
      pw.attachProcess(ff_video_pipe_process);
      ff_video_pipe_process.runInNewThread();
      ffVideoPipe.deleteLater();

      pw.attachProcess(ffVideo);
      ffVideo.runInNewThread();

      PipeIPCProcess ffAudioPipe = new PipeIPCProcess(System.currentTimeMillis() + "ffmpegaudio01", System.currentTimeMillis() + "audioout", false, true);
      StreamModifier sm = new StreamModifier();
      sm.setPcm(false);
      sm.setDtsEmbed(dtsRemux);
      sm.setSampleFrequency(48000);
      sm.setBitsPerSample(16);
      sm.setNbChannels(2);

      List<String> cmdListDTS = new ArrayList<>();
      cmdListDTS.add(executable());
      cmdListDTS.add("-y");
      cmdListDTS.add("-ss");

      if (params.timeseek > 0) {
        cmdListDTS.add(String.valueOf(params.timeseek));
      } else {
        cmdListDTS.add("0");
      }

      if (params.stdin == null) {
        cmdListDTS.add("-i");
      } else {
        cmdListDTS.add("-");
      }
      cmdListDTS.add(filename);

      if (params.timeseek > 0) {
        cmdListDTS.add("-copypriorss");
        cmdListDTS.add("0");
        cmdListDTS.add("-avoid_negative_ts");
        cmdListDTS.add("1");
      }

      cmdListDTS.add("-ac");
      cmdListDTS.add("2");

      cmdListDTS.add("-f");
      cmdListDTS.add("dts");

      cmdListDTS.add("-c:a");
      cmdListDTS.add("copy");

      cmdListDTS.add(ffAudioPipe.getInputPipe());

      String[] cmdArrayDTS = new String[cmdListDTS.size()];
      cmdListDTS.toArray(cmdArrayDTS);

      if (!params.mediaRenderer.isMuxDTSToMpeg()) { // No need to use the PCM trick when media renderer supports DTS
        ffAudioPipe.setModifier(sm);
      }

      OutputParams ffaudioparams = new OutputParams(configuration);
      ffaudioparams.maxBufferSize = 1;
      ffaudioparams.stdin = params.stdin;
      ProcessWrapperImpl ffAudio = new ProcessWrapperImpl(cmdArrayDTS, ffaudioparams);

      params.stdin = null;
View Full Code Here

      } else {
        logger.info("Renderer " + rendererName + " found on this address: " + ip);
      }

      // let's get that speed
      OutputParams op = new OutputParams(null);
      op.log = true;
      op.maxBufferSize = 1;
      SystemUtils sysUtil = PMS.get().getRegistry();
      final ProcessWrapperImpl pw = new ProcessWrapperImpl(sysUtil.getPingCommand(addr.getHostAddress(), 3, 64000), op,
          true, false);
View Full Code Here

          fakemedia.setWidth(1280);
          fakemedia.setHeight(720);
          audio.setSampleFrequency("48000");
          fakemedia.setFrameRate("23.976");
          fakemedia.getAudioTracksList().add(audio);
          String result[] = getSpecificCodecOptions(newCodecparam, fakemedia, new OutputParams(configuration), "dummy.mpg", "dummy.srt", false, true);

          if (result.length > 0 && result[0].startsWith("@@")) {
            String errorMessage = result[0].substring(2);
            JOptionPane.showMessageDialog(
              SwingUtilities.getWindowAncestor((Component) PMS.get().getFrame()),
View Full Code Here

        PipeIPCProcess ffVideoPipe = new PipeIPCProcess(System.currentTimeMillis() + "ffmpegvideo", System.currentTimeMillis() + "videoout", false, true);

        cmdList.add("-o");
        cmdList.add(ffVideoPipe.getInputPipe());

        OutputParams ffparams = new OutputParams(configuration);
        ffparams.maxBufferSize = 1;
        ffparams.stdin = params.stdin;

        String[] cmdArray = new String[cmdList.size()];
        cmdList.toArray(cmdArray);
        ProcessWrapperImpl ffVideo = new ProcessWrapperImpl(cmdArray, ffparams);

        ProcessWrapper ff_video_pipe_process = ffVideoPipe.getPipeProcess();
        pw.attachProcess(ff_video_pipe_process);
        ff_video_pipe_process.runInNewThread();
        ffVideoPipe.deleteLater();

        pw.attachProcess(ffVideo);
        ffVideo.runInNewThread();

        String aid = null;
        if (media != null && media.getAudioTracksList().size() > 1 && params.aid != null) {
          if (media.getContainer() != null && (media.getContainer().equals(FormatConfiguration.AVI) || media.getContainer().equals(FormatConfiguration.FLV))) {
            // TODO confirm (MP4s, OGMs and MOVs already tested: first aid is 0; AVIs: first aid is 1)
            // for AVIs, FLVs and MOVs mencoder starts audio tracks numbering from 1
            aid = "" + (params.aid.getId() + 1);
          } else {
            // everything else from 0
            aid = "" + params.aid.getId();
          }
        }

        PipeIPCProcess ffAudioPipe = new PipeIPCProcess(System.currentTimeMillis() + "ffmpegaudio01", System.currentTimeMillis() + "audioout", false, true);
        StreamModifier sm = new StreamModifier();
        sm.setPcm(pcm);
        sm.setDtsEmbed(dtsRemux);
        sm.setSampleFrequency(48000);
        sm.setBitsPerSample(16);

        String mixer = null;
        if (pcm && !dtsRemux) {
          mixer = getLPCMChannelMappingForMencoder(params.aid); // LPCM always outputs 5.1/7.1 for multichannel tracks. Downmix with player if needed!
        }

        sm.setNbChannels(channels);

        // it seems the -really-quiet prevents mencoder to stop the pipe output after some time...
        // -mc 0.1 make the DTS-HD extraction works better with latest mencoder builds, and makes no impact on the regular DTS one
        String ffmpegLPCMextract[] = new String[]{
          executable(),
          "-ss", "0",
          filename,
          "-really-quiet",
          "-msglevel", "statusline=2",
          "-channels", "" + channels,
          "-ovc", "copy",
          "-of", "rawaudio",
          "-mc", dtsRemux ? "0.1" : "0",
          "-noskip",
          (aid == null) ? "-quiet" : "-aid", (aid == null) ? "-quiet" : aid,
          "-oac", (ac3Remux || dtsRemux) ? "copy" : "pcm",
          (isNotBlank(mixer) && !channels_filter_present) ? "-af" : "-quiet", (isNotBlank(mixer) && !channels_filter_present) ? mixer : "-quiet",
          "-srate", "48000",
          "-o", ffAudioPipe.getInputPipe()
        };

        if (!params.mediaRenderer.isMuxDTSToMpeg()) { // no need to use the PCM trick when media renderer supports DTS
          ffAudioPipe.setModifier(sm);
        }

        if (media != null && media.getDvdtrack() > 0) {
          ffmpegLPCMextract[3] = "-dvd-device";
          ffmpegLPCMextract[4] = filename;
          ffmpegLPCMextract[5] = "dvd://" + media.getDvdtrack();
        } else if (params.stdin != null) {
          ffmpegLPCMextract[3] = "-";
        }

        if (filename.toLowerCase().endsWith(".evo")) {
          ffmpegLPCMextract[4] = "-psprobe";
          ffmpegLPCMextract[5] = "1000000";
        }

        if (params.timeseek > 0) {
          ffmpegLPCMextract[2] = "" + params.timeseek;
        }

        OutputParams ffaudioparams = new OutputParams(configuration);
        ffaudioparams.maxBufferSize = 1;
        ffaudioparams.stdin = params.stdin;
        ProcessWrapperImpl ffAudio = new ProcessWrapperImpl(ffmpegLPCMextract, ffaudioparams);

        params.stdin = null;
View Full Code Here

        }
      }
      return fis;
    } else {
      // pipe transcoding result
      OutputParams params = new OutputParams(configuration);
      params.aid = getMediaAudio();
      params.sid = getMediaSubtitle();
      params.mediaRenderer = mediarenderer;
      timeRange.limit(getSplitRange());
      params.timeseek = timeRange.getStartOrZero();
View Full Code Here

  }

  @Override
  public void parse(DLNAMediaInfo media, InputFile file, int type, RendererConfiguration renderer) {
    try {
      OutputParams params = new OutputParams(configuration);
      params.waitbeforestart = 1;
      params.minBufferSize = 1;
      params.maxBufferSize = 5;
      params.hidebuffer = true;
View Full Code Here

      "null",
      "-dvd-device",
      ProcessUtil.getShortFileNameIfWideChars(file.getAbsolutePath()),
      "dvd://1"
    };
    OutputParams params = new OutputParams(configuration);
    params.maxBufferSize = 1;
    params.log = true;
    final ProcessWrapperImpl pw = new ProcessWrapperImpl(cmd, params, true, false);

    Runnable r = new Runnable() {
View Full Code Here

      for (int i = 5; i <= 13; i++) {
        args[i] = "-an";
      }
    }

    OutputParams params = new OutputParams(configuration);
    params.maxBufferSize = 1;
    params.stdin = media.getPush();
    params.noexitcheck = true; // not serious if anything happens during the thumbnailer

    // true: consume stderr on behalf of the caller i.e. parse()
View Full Code Here

TOP

Related Classes of net.pms.io.OutputParams

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.