public DemuxerTrackMeta getTrackVideoMeta() { if (videoInputTrack == null) return null; return videoInputTrack.getMeta(); }
private static Codec detectVideoDecoder(DemuxerTrack track) throws IOException { DemuxerTrackMeta meta = track.getMeta(); if (meta != null) { Codec codec = meta.getCodec(); if (codec != null) return codec; } Packet packet = track.nextFrame(); if (packet == null) return null; return JCodecUtil.detectDecoder(packet.getData()); }
@Override public Packet inputAudioPacket() throws IOException { if (audioInputTrack == null) return null; Packet audioPkt = audioInputTrack.nextFrame(); if (audioDecoder == null && audioPkt != null) { audioDecoder = createAudioDecoder(audioPkt.getData()); if (audioDecoder != null) audioCodecMeta = audioDecoder.getCodecMeta(audioPkt.getData()); } return audioPkt; }
private Packet getNextVideoPacket() throws IOException { if (videoInputTrack == null) return null; Packet nextFrame = videoInputTrack.nextFrame(); // if (nextFrame != null) // Logger.debug(String.format("Input frame: pts=%d, duration=%d", // nextFrame.getPts(), nextFrame.getDuration())); if (videoDecoder == null) { videoDecoder = createVideoDecoder(inputVideoCodec.v2, downscale, nextFrame.getData(), null); if (videoDecoder != null) { videoCodecMeta = videoDecoder.getCodecMeta(nextFrame.getData()); } } return nextFrame; }
public DemuxerTrackMeta getAudioMeta() { if (audioInputTrack == null) return null; return audioInputTrack.getMeta(); }