FFMPEG学习----遍历所支持的封装格式

#include <stdio.h>

extern "C"
{
#include "libavformat/avformat.h"
};



int main(void)
{
	AVFormatContext	*pFormatCtx = NULL;
	AVInputFormat *pInputFormat = NULL;
	AVOutputFormat *pOnputFormat = NULL;
	
	av_register_all();
	
	pInputFormat = av_iformat_next(NULL);
	puts("-------------------------------Input--------------------------------");
	while(pInputFormat != NULL)
	{
		printf("%s ", pInputFormat->name);
		pInputFormat = pInputFormat->next;
	}
	puts("\n--------------------------------------------------------------------");
	
	pOnputFormat = av_oformat_next(NULL);
	puts("-------------------------------Output-------------------------------");
	while(pOnputFormat != NULL)
	{
		printf("%s ", pOnputFormat->name);
		pOnputFormat = pOnputFormat->next;
	}
	puts("\n--------------------------------------------------------------------");
	
	return 0;
}
/**
 * If f is NULL, returns the first registered input format,
 * if f is non-NULL, returns the next registered input format after f
 * or NULL if f is the last one.
 */


输出:

G:\Coding\FFMpeg\Proj\Console>cl /c /Iinclude tutorial.cpp
用于 x86 的 Microsoft (R) C/C++ 优化编译器 18.00.31101 版版权所有(C) Microsoft C
orporation。  保留所有权利。

tutorial.cpp

G:\Coding\FFMpeg\Proj\Console>link tutorial.obj lib\avformat.lib
Microsoft (R) Incremental Linker Version 12.00.31101.0
Copyright (C) Microsoft Corporation.  All rights reserved.


G:\Coding\FFMpeg\Proj\Console>tutorial
-------------------------------Input--------------------------------
aa aac ac3 acm act adf adp ads adx aea afc aiff aix amr anm apc ape apng aqtitle
 asf asf_o ass ast au avi avisynth avr avs bethsoftvid bfi bin bink bit bmv bfst
m brstm boa c93 caf cavsvideo cdg cdxl cine concat data daud dcstr dfa dirac dnx
hd dsf dsicin dss dts dtshd dv dvbsub dvbtxt dxa ea ea_cdata eac3 epaf ffm ffmet
adata filmstrip flac flic flv live_flv 4xm frm fsb g722 g723_1 g729 genh gif gsm
 gxf h261 h263 h264 hevc hls,applehttp hnm ico idcin idf iff ilbc image2 image2p
ipe alias_pix brender_pix ingenient ipmovie ircam iss iv8 ivf ivr jacosub jv lml
m4 loas lrc lvf lxf m4v matroska,webm mgsts microdvd mjpeg mlp mlv mm mmf mov,mp
4,m4a,3gp,3g2,mj2 mp3 mpc mpc8 mpeg mpegts mpegtsraw mpegvideo mpjpeg mpl2 mpsub
 msf msnwctcp mtv musx mv mvi mxf mxg nc nistsphere nsv nut nuv ogg oma paf alaw
 mulaw f64be f64le f32be f32le s32be s32le s24be s24le s16be s16le s8 u32be u32l
e u24be u24le u16be u16le u8 pjs pmp pva pvf qcp r3d rawvideo realtext redspark
rl2 rm roq rpl rsd rso rtp rtsp sami sap sbg sdp sdr2 film_cpk shn siff sln smk
smjpeg smush sol sox spdif srt psxstr stl subviewer1 subviewer sup svag swf tak
tedcaptions thp 3dostr tiertexseq tmv truehd tta txd tty v210 v210x vag vc1 vc1t
est vivo vmd vobsub voc vpk vplayer vqf w64 wav wc3movie webm_dash_manifest webv
tt wsaud wsvqa wtv wve wv xa xbin xmv xvag xwma yop yuv4mpegpipe bmp_pipe dds_pi
pe dpx_pipe exr_pipe j2k_pipe jpeg_pipe jpegls_pipe pcx_pipe pictor_pipe png_pip
e qdraw_pipe sgi_pipe sunrast_pipe tiff_pipe webp_pipe libgme libmodplug
--------------------------------------------------------------------
-------------------------------Output-------------------------------
a64 ac3 adts adx aiff amr apng asf ass ast asf_stream au avi avm2 bit caf cavsvi
deo crc dash data daud dirac dnxhd dts dv eac3 f4v ffm ffmetadata filmstrip flac
 flv framecrc framehash framemd5 g722 g723_1 gif gsm gxf h261 h263 h264 hash hds
 hevc hls ico ilbc image2 image2pipe ipod ircam ismv ivf jacosub latm lrc m4v md
5 matroska matroska microdvd mjpeg mlp mmf mov mp2 mp3 mp4 mpeg vcd mpeg1video d
vd svcd mpeg2video vob mpegts mpjpeg mxf mxf_d10 mxf_opatom null nut oga ogg oma
 opus alaw mulaw f64be f64le f32be f32le s32be s32le s24be s24le s16be s16le s8
u32be u32le u24be u24le u16be u16le u8 psp rawvideo rm roq rso rtp rtp_mpegts rt
sp sap segment stream_segment,ssegment singlejpeg smjpeg smoothstreaming sox spx
 spdif srt swf tee 3g2 3gp mkvtimestamp_v2 truehd uncodedframecrc vc1 vc1test vo
c w64 wav webm webm_dash_manifest webm_chunk webp webvtt wtv wv yuv4mpegpipe
--------------------------------------------------------------------

G:\Coding\FFMpeg\Proj\Console>


posted @ 2016-08-14 10:28  N3verL4nd  阅读(550)  评论(0编辑  收藏  举报