001/******************************************************************************* 002 * Copyright (c) 2024, 2026, Olivier Ayache. All rights reserved. 003 * 004 * This file is part of AVPKit. 005 * 006 * AVPKit is free software: you can redistribute it and/or modify 007 * it under the terms of the GNU Lesser General Public License as published by 008 * the Free Software Foundation, either version 3 of the License, or 009 * (at your option) any later version. 010 * 011 * AVPKit is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 014 * GNU Lesser General Public License for more details. 015 * 016 * You should have received a copy of the GNU Lesser General Public License 017 * along with AVPKit. If not, see <http://www.gnu.org/licenses/>. 018 *******************************************************************************/ 019package com.avpkit.core; 020 021import java.util.List; 022 023import com.avpkit.core.ICodec; 024import com.avpkit.core.IContainerFormat; 025import com.avpkit.core.ICodec.ID; 026 027/** 028 * Prints information about which codecs can be inserted into a container format. 029 * @author aclarke 030 * 031 * @since 3.3 032 */ 033public class GetSuppportedCodecs 034{ 035 036 /** 037 * Given the short name of a container, prints out information about 038 * it, including which codecs AVPKit can write (mux) into that container. 039 * @param args One string argument representing the short name of the format 040 */ 041 public static void main(String[] args) 042 { 043 if (args.length != 1) { 044 System.err.println("Usage: program_name container_short_name"); 045 return; 046 } 047 IContainerFormat format = IContainerFormat.make(); 048 format.setOutputFormat(args[0], null, null); 049 050 List<ID> codecs = format.getOutputCodecsSupported(); 051 052 System.out.println("Container Format: "+format); 053 System.out.println(); 054 System.out.println("Supported Codecs:"); 055 for(ID id : codecs) { 056 if (id != null) { 057 ICodec codec = ICodec.findEncodingCodec(id); 058 if (codec != null) { 059 System.out.println(codec); 060 } 061 } 062 } 063 } 064 065}