最简单的基于FFMPEG的Helloworld程序

=====================================================

最简单的基于FFmpeg的视频播放器系列文章列表:

100行代码实现最简单的基于FFMPEG+SDL的视频播放器(SDL1.x)

最简单的基于FFMPEG+SDL的视频播放器 ver2 (采用SDL2.0)

最简单的基于FFmpeg的解码器-纯净版(不包含libavformat)

最简单的基于FFMPEG+SDL的视频播放器:拆分-解码器和播放器

最简单的基于FFMPEG的Helloworld程序

=====================================================



本文记录一个基于FFmpeg的HelloWorld程序。该程序可以打印出FFmpeg类库的基本信息。使用该程序通常可以验证FFmpeg是否正确的安装配置。


源代码

[cpp]  view plain  copy
  1. /** 
  2.  * 最简单的FFmpeg Helloworld程序 
  3.  * Simplest FFmpeg HelloWorld 
  4.  * 
  5.  * 雷霄骅 Lei Xiaohua 
  6.  * leixiaohua1020@126.com 
  7.  * 中国传媒大学/数字电视技术 
  8.  * Communication University of China / Digital TV Technology 
  9.  * http://blog.csdn.net/leixiaohua1020 
  10.  * 
  11.  *  
  12.  * 本程序是基于FFmpeg函数的最简单的程序。它可以打印出FFmpeg类库的下列信息: 
  13.  * Protocol:  FFmpeg类库支持的协议 
  14.  * AVFormat:  FFmpeg类库支持的封装格式 
  15.  * AVCodec:   FFmpeg类库支持的编解码器 
  16.  * AVFilter:  FFmpeg类库支持的滤镜 
  17.  * Configure: FFmpeg类库的配置信息 
  18.  *  
  19.  * This is the simplest program based on FFmpeg API. It can show following  
  20.  * informations about FFmpeg library: 
  21.  * Protocol:  Protocols supported by FFmpeg. 
  22.  * AVFormat:  Container format supported by FFmpeg. 
  23.  * AVCodec:   Encoder/Decoder supported by FFmpeg. 
  24.  * AVFilter:  Filters supported by FFmpeg. 
  25.  * Configure: configure information of FFmpeg. 
  26.  * 
  27.  */  
  28.   
  29. #include <stdio.h>  
  30.   
  31. #define __STDC_CONSTANT_MACROS  
  32.   
  33. #ifdef _WIN32  
  34. //Windows  
  35. extern "C"  
  36. {  
  37. #include "libavcodec/avcodec.h"  
  38. #include "libavformat/avformat.h"  
  39. #include "libavfilter/avfilter.h"  
  40. };  
  41. #else  
  42. //Linux...  
  43. #ifdef __cplusplus  
  44. extern "C"  
  45. {  
  46. #endif  
  47. #include <libavcodec/avcodec.h>  
  48. #include <libavformat/avformat.h>  
  49. #include <libavfilter/avfilter.h>  
  50. #ifdef __cplusplus  
  51. };  
  52. #endif  
  53. #endif  
  54.   
  55. //FIX  
  56. struct URLProtocol;  
  57. /** 
  58.  * Protocol Support Information 
  59.  */  
  60. char * urlprotocolinfo(){  
  61.       
  62.     char *info=(char *)malloc(40000);  
  63.     memset(info,0,40000);  
  64.   
  65.     av_register_all();  
  66.   
  67.     struct URLProtocol *pup = NULL;  
  68.     //Input  
  69.     struct URLProtocol **p_temp = &pup;  
  70.     avio_enum_protocols((void **)p_temp, 0);  
  71.     while ((*p_temp) != NULL){  
  72.         sprintf(info, "%s[In ][%10s]\n", info, avio_enum_protocols((void **)p_temp, 0));  
  73.     }  
  74.     pup = NULL;  
  75.     //Output  
  76.     avio_enum_protocols((void **)p_temp, 1);  
  77.     while ((*p_temp) != NULL){  
  78.         sprintf(info, "%s[Out][%10s]\n", info, avio_enum_protocols((void **)p_temp, 1));  
  79.     }  
  80.   
  81.     return info;  
  82. }  
  83.   
  84. /** 
  85.  * AVFormat Support Information 
  86.  */  
  87. char * avformatinfo(){  
  88.   
  89.     char *info=(char *)malloc(40000);  
  90.     memset(info,0,40000);  
  91.   
  92.     av_register_all();  
  93.   
  94.     AVInputFormat *if_temp = av_iformat_next(NULL);  
  95.     AVOutputFormat *of_temp = av_oformat_next(NULL);  
  96.     //Input  
  97.     while(if_temp!=NULL){  
  98.         sprintf(info, "%s[In ] %10s\n", info, if_temp->name);  
  99.         if_temp=if_temp->next;  
  100.     }  
  101.     //Output  
  102.     while (of_temp != NULL){  
  103.         sprintf(info, "%s[Out] %10s\n", info, of_temp->name);  
  104.         of_temp = of_temp->next;  
  105.     }  
  106.     return info;  
  107. }  
  108.   
  109. /** 
  110.  * AVCodec Support Information 
  111.  */  
  112. char * avcodecinfo()  
  113. {  
  114.     char *info=(char *)malloc(40000);  
  115.     memset(info,0,40000);  
  116.   
  117.     av_register_all();  
  118.   
  119.     AVCodec *c_temp = av_codec_next(NULL);  
  120.   
  121.     while(c_temp!=NULL){  
  122.         if (c_temp->decode!=NULL){  
  123.             sprintf(info, "%s[Dec]", info);  
  124.         }  
  125.         else{  
  126.             sprintf(info, "%s[Enc]", info);  
  127.         }  
  128.         switch (c_temp->type){  
  129.         case AVMEDIA_TYPE_VIDEO:  
  130.             sprintf(info, "%s[Video]", info);  
  131.             break;  
  132.         case AVMEDIA_TYPE_AUDIO:  
  133.             sprintf(info, "%s[Audio]", info);  
  134.             break;  
  135.         default:  
  136.             sprintf(info, "%s[Other]", info);  
  137.             break;  
  138.         }  
  139.   
  140.         sprintf(info, "%s %10s\n", info, c_temp->name);  
  141.   
  142.         c_temp=c_temp->next;  
  143.     }  
  144.     return info;  
  145. }  
  146.   
  147. /** 
  148.  * AVFilter Support Information 
  149.  */  
  150. char * avfilterinfo()  
  151. {  
  152.     char *info=(char *)malloc(40000);  
  153.     memset(info,0,40000);  
  154.   
  155.     avfilter_register_all();  
  156.   
  157.     AVFilter *f_temp = (AVFilter *)avfilter_next(NULL);  
  158.       
  159.     while (f_temp != NULL){  
  160.         sprintf(info, "%s[%15s]\n", info, f_temp->name);  
  161.         f_temp=f_temp->next;  
  162.     }  
  163.     return info;  
  164. }  
  165.   
  166. /** 
  167.  * Configuration Information 
  168.  */  
  169. char * configurationinfo()  
  170. {  
  171.     char *info=(char *)malloc(40000);  
  172.     memset(info,0,40000);  
  173.   
  174.     av_register_all();  
  175.   
  176.     sprintf(info, "%s\n", avcodec_configuration());  
  177.   
  178.     return info;  
  179. }  
  180.   
  181. int main(int argc, char* argv[])  
  182. {  
  183.     char *infostr=NULL;  
  184.     infostr=configurationinfo();  
  185.     printf("\n<<Configuration>>\n%s",infostr);  
  186.     free(infostr);  
  187.   
  188.     infostr=urlprotocolinfo();  
  189.     printf("\n<<URLProtocol>>\n%s",infostr);  
  190.     free(infostr);  
  191.   
  192.     infostr=avformatinfo();  
  193.     printf("\n<<AVFormat>>\n%s",infostr);  
  194.     free(infostr);  
  195.   
  196.     infostr=avcodecinfo();  
  197.     printf("\n<<AVCodec>>\n%s",infostr);  
  198.     free(infostr);  
  199.   
  200.     infostr=avfilterinfo();  
  201.     printf("\n<<AVFilter>>\n%s",infostr);  
  202.     free(infostr);  
  203.   
  204.     return 0;  
  205. }  



运行结果


Configure信息格式如下所示。

[plain]  view plain  copy
  1. --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib  

Protocol信息格式如下所示。

[plain]  view plain  copy
  1. [In ][     cache]  
  2. [In ][    concat]  
  3. [In ][    crypto]  
  4. [In ][      data]  
  5. [In ][      file]  
  6. [In ][       ftp]  
  7. [In ][    gopher]  
  8. [In ][       hls]  
  9. [In ][      http]  
  10. [In ][ httpproxy]  
  11. [In ][     https]  
  12. [In ][      mmsh]  
  13. [In ][      mmst]  
  14. [In ][      pipe]  
  15. [In ][       rtp]  
  16. [In ][      srtp]  
  17. [In ][   subfile]  
  18. [In ][       tcp]  
  19. [In ][       tls]  
  20. [In ][       udp]  
  21. [In ][      rtmp]  
  22. [In ][     rtmpe]  
  23. [In ][     rtmps]  
  24. [In ][     rtmpt]  
  25. [In ][    rtmpte]  
  26. [In ][    (null)]  
  27. [Out][       ftp]  
  28. [Out][    gopher]  
  29. [Out][      http]  
  30. [Out][ httpproxy]  
  31. [Out][     https]  
  32. [Out][       md5]  
  33. [Out][      pipe]  
  34. [Out][       rtp]  
  35. [Out][      srtp]  
  36. [Out][       tcp]  
  37. [Out][       tls]  
  38. [Out][       udp]  
  39. [Out][      rtmp]  
  40. [Out][     rtmpe]  
  41. [Out][     rtmps]  
  42. [Out][     rtmpt]  
  43. [Out][    rtmpte]  
  44. [Out][    (null)]  


AVFormat信息格式如下所示。

[plain]  view plain  copy
  1. [In ]        aac  
  2. [In ]        ac3  
  3. [In ]        act  
  4. [In ]        adf  
  5. [In ]        adp  
  6. [In ]        adx  
  7. [In ]        aea  
  8. [In ]        afc  
  9. [In ]       aiff  
  10. [In ]        amr  
  11. [In ]        anm  
  12. [In ]        apc  
  13. [In ]        ape  
  14. [In ]    aqtitle  
  15. [In ]        asf  
  16. [In ]        ass  
  17. [In ]        ast  
  18. [In ]         au  
  19. [In ]        avi  
  20. [In ]   avisynth  
  21. [In ]        avr  
  22. [In ]        avs  
  23. [In ] bethsoftvid  
  24. [In ]        bfi  
  25. [In ]        bin  
  26. [In ]       bink  
  27. [In ]        bit  
  28. [In ]        bmv  
  29. [In ]      brstm  
  30. [In ]        boa  
  31. [In ]        c93  
  32. [In ]        caf  
  33. [In ]  cavsvideo  
  34. [In ]        cdg  
  35. [In ]       cdxl  
  36. [In ]       cine  
  37. [In ]     concat  
  38. [In ]       data  
  39. [In ]       daud  
  40. [In ]        dfa  
  41. [In ]      dirac  
  42. [In ]      dnxhd  
  43. [In ]        dsf  
  44. [In ]     dsicin  
  45. [In ]        dts  
  46. [In ]      dtshd  
  47. [In ]         dv  
  48. [In ]        dxa  
  49. [In ]         ea  
  50. [In ]   ea_cdata  
  51. [In ]       eac3  
  52. [In ]       epaf  
  53. [In ]        ffm  
  54. [In ] ffmetadata  
  55. [In ]  filmstrip  
  56. [In ]       flac  
  57. [In ]       flic  
  58. [In ]        flv  
  59. [In ]        4xm  
  60. [In ]        frm  
  61. [In ]       g722  
  62. [In ]     g723_1  
  63. [In ]       g729  
  64. [In ]        gif  
  65. [In ]        gsm  
  66. [In ]        gxf  
  67. [In ]       h261  
  68. [In ]       h263  
  69. [In ]       h264  
  70. [In ]       hevc  
  71. [In ] hls,applehttp  
  72. [In ]        hnm  
  73. [In ]        ico  
  74. [In ]      idcin  
  75. [In ]        idf  
  76. [In ]        iff  
  77. [In ]       ilbc  
  78. [In ]     image2  
  79. [In ] image2pipe  
  80. [In ]  alias_pix  
  81. [In ] brender_pix  
  82. [In ]  ingenient  
  83. [In ]    ipmovie  
  84. [In ]      ircam  
  85. [In ]        iss  
  86. [In ]        iv8  
  87. [In ]        ivf  
  88. [In ]    jacosub  
  89. [In ]         jv  
  90. [In ]       latm  
  91. [In ]      lmlm4  
  92. [In ]       loas  
  93. [In ]        lvf  
  94. [In ]        lxf  
  95. [In ]        m4v  
  96. [In ] matroska,webm  
  97. [In ]      mgsts  
  98. [In ]   microdvd  
  99. [In ]      mjpeg  
  100. [In ]        mlp  
  101. [In ]        mlv  
  102. [In ]         mm  
  103. [In ]        mmf  
  104. [In ] mov,mp4,m4a,3gp,3g2,mj2  
  105. [In ]        mp3  
  106. [In ]        mpc  
  107. [In ]       mpc8  
  108. [In ]       mpeg  
  109. [In ]     mpegts  
  110. [In ]  mpegtsraw  
  111. [In ]  mpegvideo  
  112. [In ]       mpl2  
  113. [In ]      mpsub  
  114. [In ]   msnwctcp  
  115. [In ]        mtv  
  116. [In ]         mv  
  117. [In ]        mvi  
  118. [In ]        mxf  
  119. [In ]        mxg  
  120. [In ]         nc  
  121. [In ] nistsphere  
  122. [In ]        nsv  
  123. [In ]        nut  
  124. [In ]        nuv  
  125. [In ]        ogg  
  126. [In ]        oma  
  127. [In ]        paf  
  128. [In ]       alaw  
  129. [In ]      mulaw  
  130. [In ]      f64be  
  131. [In ]      f64le  
  132. [In ]      f32be  
  133. [In ]      f32le  
  134. [In ]      s32be  
  135. [In ]      s32le  
  136. [In ]      s24be  
  137. [In ]      s24le  
  138. [In ]      s16be  
  139. [In ]      s16le  
  140. [In ]         s8  
  141. [In ]      u32be  
  142. [In ]      u32le  
  143. [In ]      u24be  
  144. [In ]      u24le  
  145. [In ]      u16be  
  146. [In ]      u16le  
  147. [In ]         u8  
  148. [In ]        pjs  
  149. [In ]        pmp  
  150. [In ]        pva  
  151. [In ]        pvf  
  152. [In ]        qcp  
  153. [In ]        r3d  
  154. [In ]   rawvideo  
  155. [In ]   realtext  
  156. [In ]   redspark  
  157. [In ]        rl2  
  158. [In ]         rm  
  159. [In ]        roq  
  160. [In ]        rpl  
  161. [In ]        rsd  
  162. [In ]        rso  
  163. [In ]        rtp  
  164. [In ]       rtsp  
  165. [In ]       sami  
  166. [In ]        sap  
  167. [In ]        sbg  
  168. [In ]        sdp  
  169. [In ]       sdr2  
  170. [In ]   film_cpk  
  171. [In ]        shn  
  172. [In ]       siff  
  173. [In ]        smk  
  174. [In ]     smjpeg  
  175. [In ]      smush  
  176. [In ]        sol  
  177. [In ]        sox  
  178. [In ]      spdif  
  179. [In ]        srt  
  180. [In ]     psxstr  
  181. [In ] subviewer1  
  182. [In ]  subviewer  
  183. [In ]        swf  
  184. [In ]        tak  
  185. [In ] tedcaptions  
  186. [In ]        thp  
  187. [In ] tiertexseq  
  188. [In ]        tmv  
  189. [In ]     truehd  
  190. [In ]        tta  
  191. [In ]        txd  
  192. [In ]        tty  
  193. [In ]        vc1  
  194. [In ]    vc1test  
  195. [In ]       vivo  
  196. [In ]        vmd  
  197. [In ]     vobsub  
  198. [In ]        voc  
  199. [In ]    vplayer  
  200. [In ]        vqf  
  201. [In ]        w64  
  202. [In ]        wav  
  203. [In ]   wc3movie  
  204. [In ]     webvtt  
  205. [In ]      wsaud  
  206. [In ]      wsvqa  
  207. [In ]        wtv  
  208. [In ]         wv  
  209. [In ]         xa  
  210. [In ]       xbin  
  211. [In ]        xmv  
  212. [In ]       xwma  
  213. [In ]        yop  
  214. [In ] yuv4mpegpipe  
  215. [In ] libmodplug  
  216. [Out]        a64  
  217. [Out]        ac3  
  218. [Out]       adts  
  219. [Out]        adx  
  220. [Out]       aiff  
  221. [Out]        amr  
  222. [Out]        asf  
  223. [Out]        ass  
  224. [Out]        ast  
  225. [Out] asf_stream  
  226. [Out]         au  
  227. [Out]        avi  
  228. [Out]       avm2  
  229. [Out]        bit  
  230. [Out]        caf  
  231. [Out]  cavsvideo  
  232. [Out]        crc  
  233. [Out]       data  
  234. [Out]       daud  
  235. [Out]      dirac  
  236. [Out]      dnxhd  
  237. [Out]        dts  
  238. [Out]         dv  
  239. [Out]       eac3  
  240. [Out]        f4v  
  241. [Out]        ffm  
  242. [Out] ffmetadata  
  243. [Out]  filmstrip  
  244. [Out]       flac  
  245. [Out]        flv  
  246. [Out]   framecrc  
  247. [Out]   framemd5  
  248. [Out]       g722  
  249. [Out]     g723_1  
  250. [Out]        gif  
  251. [Out]        gxf  
  252. [Out]       h261  
  253. [Out]       h263  
  254. [Out]       h264  
  255. [Out]        hds  
  256. [Out]       hevc  
  257. [Out]        hls  
  258. [Out]        ico  
  259. [Out]       ilbc  
  260. [Out]     image2  
  261. [Out] image2pipe  
  262. [Out]       ipod  
  263. [Out]      ircam  
  264. [Out]       ismv  
  265. [Out]        ivf  
  266. [Out]    jacosub  
  267. [Out]       latm  
  268. [Out]        m4v  
  269. [Out]        md5  
  270. [Out]   matroska  
  271. [Out]   matroska  
  272. [Out]   microdvd  
  273. [Out]      mjpeg  
  274. [Out]        mlp  
  275. [Out]        mmf  
  276. [Out]        mov  
  277. [Out]        mp2  
  278. [Out]        mp3  
  279. [Out]        mp4  
  280. [Out]       mpeg  
  281. [Out]        vcd  
  282. [Out] mpeg1video  
  283. [Out]        dvd  
  284. [Out]       svcd  
  285. [Out] mpeg2video  
  286. [Out]        vob  
  287. [Out]     mpegts  
  288. [Out]     mpjpeg  
  289. [Out]        mxf  
  290. [Out]    mxf_d10  
  291. [Out]       null  
  292. [Out]        nut  
  293. [Out]        oga  
  294. [Out]        ogg  
  295. [Out]        oma  
  296. [Out]       opus  
  297. [Out]       alaw  
  298. [Out]      mulaw  
  299. [Out]      f64be  
  300. [Out]      f64le  
  301. [Out]      f32be  
  302. [Out]      f32le  
  303. [Out]      s32be  
  304. [Out]      s32le  
  305. [Out]      s24be  
  306. [Out]      s24le  
  307. [Out]      s16be  
  308. [Out]      s16le  
  309. [Out]         s8  
  310. [Out]      u32be  
  311. [Out]      u32le  
  312. [Out]      u24be  
  313. [Out]      u24le  
  314. [Out]      u16be  
  315. [Out]      u16le  
  316. [Out]         u8  
  317. [Out]        psp  
  318. [Out]   rawvideo  
  319. [Out]         rm  
  320. [Out]        roq  
  321. [Out]        rso  
  322. [Out]        rtp  
  323. [Out]       rtsp  
  324. [Out]        sap  
  325. [Out]    segment  
  326. [Out] stream_segment,ssegment  
  327. [Out]     smjpeg  
  328. [Out] smoothstreaming  
  329. [Out]        sox  
  330. [Out]      spdif  
  331. [Out]      speex  
  332. [Out]        srt  
  333. [Out]        swf  
  334. [Out]        tee  
  335. [Out]        3g2  
  336. [Out]        3gp  
  337. [Out] mkvtimestamp_v2  
  338. [Out]     truehd  
  339. [Out] uncodedframecrc  
  340. [Out]        vc1  
  341. [Out]    vc1test  
  342. [Out]        voc  
  343. [Out]        w64  
  344. [Out]        wav  
  345. [Out]       webm  
  346. [Out]     webvtt  
  347. [Out]        wtv  
  348. [Out]         wv  
  349. [Out] yuv4mpegpipe  


AVCodec信息格式如下所示。
[plain]  view plain  copy
  1. [Enc][Video]   a64multi  
  2. [Enc][Video]  a64multi5  
  3. [Dec][Video]       aasc  
  4. [Dec][Video]        aic  
  5. [Enc][Video]  alias_pix  
  6. [Dec][Video]  alias_pix  
  7. [Enc][Video]        amv  
  8. [Dec][Video]        amv  
  9. [Dec][Video]        anm  
  10. [Dec][Video]       ansi  
  11. [Enc][Video]       asv1  
  12. [Dec][Video]       asv1  
  13. [Enc][Video]       asv2  
  14. [Dec][Video]       asv2  
  15. [Dec][Video]       aura  
  16. [Dec][Video]      aura2  
  17. [Enc][Video]       avrp  
  18. [Dec][Video]       avrp  
  19. [Dec][Video]       avrn  
  20. [Dec][Video]        avs  
  21. [Enc][Video]       avui  
  22. [Dec][Video]       avui  
  23. [Enc][Video]       ayuv  
  24. [Dec][Video]       ayuv  
  25. [Dec][Video] bethsoftvid  
  26. [Dec][Video]        bfi  
  27. [Dec][Video]  binkvideo  
  28. [Enc][Video]        bmp  
  29. [Dec][Video]        bmp  
  30. [Dec][Video]  bmv_video  
  31. [Dec][Video] brender_pix  
  32. [Dec][Video]        c93  
  33. [Dec][Video]       cavs  
  34. [Dec][Video] cdgraphics  
  35. [Dec][Video]       cdxl  
  36. [Enc][Video]    cinepak  
  37. [Dec][Video]    cinepak  
  38. [Enc][Video]       cljr  
  39. [Dec][Video]       cljr  
  40. [Dec][Video]       cllc  
  41. [Enc][Audio] comfortnoise  
  42. [Dec][Audio] comfortnoise  
  43. [Dec][Video]       cpia  
  44. [Dec][Video]  camstudio  
  45. [Dec][Video]       cyuv  
  46. [Dec][Video]        dfa  
  47. [Dec][Video]      dirac  
  48. [Enc][Video]      dnxhd  
  49. [Dec][Video]      dnxhd  
  50. [Enc][Video]        dpx  
  51. [Dec][Video]        dpx  
  52. [Dec][Video] dsicinvideo  
  53. [Enc][Video]    dvvideo  
  54. [Dec][Video]    dvvideo  
  55. [Dec][Video]        dxa  
  56. [Dec][Video]     dxtory  
  57. [Dec][Video]      eacmv  
  58. [Dec][Video]      eamad  
  59. [Dec][Video]      eatgq  
  60. [Dec][Video]      eatgv  
  61. [Dec][Video]      eatqi  
  62. [Dec][Video]       8bps  
  63. [Dec][Audio]   8svx_exp  
  64. [Dec][Audio]   8svx_fib  
  65. [Dec][Video]  escape124  
  66. [Dec][Video]  escape130  
  67. [Dec][Video]        exr  
  68. [Enc][Video]       ffv1  
  69. [Dec][Video]       ffv1  
  70. [Enc][Video]    ffvhuff  
  71. [Dec][Video]    ffvhuff  
  72. [Dec][Video]        fic  
  73. [Enc][Video]    flashsv  
  74. [Dec][Video]    flashsv  
  75. [Enc][Video]   flashsv2  
  76. [Dec][Video]   flashsv2  
  77. [Dec][Video]       flic  
  78. [Enc][Video]        flv  
  79. [Dec][Video]        flv  
  80. [Dec][Video]        4xm  
  81. [Dec][Video]      fraps  
  82. [Dec][Video]       frwu  
  83. [Dec][Video]        g2m  
  84. [Enc][Video]        gif  
  85. [Dec][Video]        gif  
  86. [Enc][Video]       h261  
  87. [Dec][Video]       h261  
  88. [Enc][Video]       h263  
  89. [Dec][Video]       h263  
  90. [Dec][Video]      h263i  
  91. [Enc][Video]      h263p  
  92. [Dec][Video]      h263p  
  93. [Dec][Video]       h264  
  94. [Dec][Video]       hevc  
  95. [Dec][Video]  hnm4video  
  96. [Enc][Video]    huffyuv  
  97. [Dec][Video]    huffyuv  
  98. [Dec][Video] idcinvideo  
  99. [Dec][Video]        iff  
  100. [Dec][Video]        iff  
  101. [Dec][Video]     indeo2  
  102. [Dec][Video]     indeo3  
  103. [Dec][Video]     indeo4  
  104. [Dec][Video]     indeo5  
  105. [Dec][Video] interplayvideo  
  106. [Enc][Video]   jpeg2000  
  107. [Dec][Video]   jpeg2000  
  108. [Enc][Video]     jpegls  
  109. [Dec][Video]     jpegls  
  110. [Dec][Video]         jv  
  111. [Dec][Video]       kgv1  
  112. [Dec][Video]       kmvc  
  113. [Dec][Video]   lagarith  
  114. [Enc][Video]      ljpeg  
  115. [Dec][Video]       loco  
  116. [Dec][Video]       mdec  
  117. [Dec][Video]      mimic  
  118. [Enc][Video]      mjpeg  
  119. [Dec][Video]      mjpeg  
  120. [Dec][Video]     mjpegb  
  121. [Dec][Video]    mmvideo  
  122. [Dec][Video] motionpixels  
  123. [Enc][Video] mpeg1video  
  124. [Dec][Video] mpeg1video  
  125. [Enc][Video] mpeg2video  
  126. [Dec][Video] mpeg2video  
  127. [Enc][Video]      mpeg4  
  128. [Dec][Video]      mpeg4  
  129. [Dec][Video]  mpegvideo  
  130. [Dec][Video]       msa1  
  131. [Dec][Video]  msmpeg4v1  
  132. [Enc][Video]  msmpeg4v2  
  133. [Dec][Video]  msmpeg4v2  
  134. [Enc][Video]    msmpeg4  
  135. [Dec][Video]    msmpeg4  
  136. [Dec][Video]      msrle  
  137. [Dec][Video]       mss1  
  138. [Dec][Video]       mss2  
  139. [Enc][Video]   msvideo1  
  140. [Dec][Video]   msvideo1  
  141. [Dec][Video]       mszh  
  142. [Dec][Video]       mts2  
  143. [Dec][Video]       mvc1  
  144. [Dec][Video]       mvc2  
  145. [Dec][Video]      mxpeg  
  146. [Dec][Video]        nuv  
  147. [Dec][Video]  paf_video  
  148. [Enc][Video]        pam  
  149. [Dec][Video]        pam  
  150. [Enc][Video]        pbm  
  151. [Dec][Video]        pbm  
  152. [Enc][Video]        pcx  
  153. [Dec][Video]        pcx  
  154. [Enc][Video]        pgm  
  155. [Dec][Video]        pgm  
  156. [Enc][Video]     pgmyuv  
  157. [Dec][Video]     pgmyuv  
  158. [Dec][Video]     pictor  
  159. [Enc][Video]        png  
  160. [Dec][Video]        png  
  161. [Enc][Video]        ppm  
  162. [Dec][Video]        ppm  
  163. [Enc][Video]     prores  
  164. [Dec][Video]     prores  
  165. [Enc][Video]  prores_aw  
  166. [Enc][Video]  prores_ks  
  167. [Dec][Video] prores_lgpl  
  168. [Dec][Video]        ptx  
  169. [Dec][Video]      qdraw  
  170. [Dec][Video]       qpeg  
  171. [Enc][Video]      qtrle  
  172. [Dec][Video]      qtrle  
  173. [Enc][Video]       r10k  
  174. [Dec][Video]       r10k  
  175. [Enc][Video]       r210  
  176. [Dec][Video]       r210  
  177. [Enc][Video]   rawvideo  
  178. [Dec][Video]   rawvideo  
  179. [Dec][Video]        rl2  
  180. [Enc][Video]   roqvideo  
  181. [Dec][Video]   roqvideo  
  182. [Dec][Video]       rpza  
  183. [Enc][Video]       rv10  
  184. [Dec][Video]       rv10  
  185. [Enc][Video]       rv20  
  186. [Dec][Video]       rv20  
  187. [Dec][Video]       rv30  
  188. [Dec][Video]       rv40  
  189. [Enc][Audio]      s302m  
  190. [Dec][Audio]      s302m  
  191. [Dec][Video]       sanm  
  192. [Enc][Video]        sgi  
  193. [Dec][Video]        sgi  
  194. [Dec][Video]     sgirle  
  195. [Dec][Video]   smackvid  
  196. [Dec][Video]        smc  
  197. [Dec][Video]    smvjpeg  
  198. [Enc][Video]       snow  
  199. [Dec][Video]       snow  
  200. [Dec][Video]       sp5x  
  201. [Enc][Video]    sunrast  
  202. [Dec][Video]    sunrast  
  203. [Enc][Video]       svq1  
  204. [Dec][Video]       svq1  
  205. [Dec][Video]       svq3  
  206. [Enc][Video]      targa  
  207. [Dec][Video]      targa  
  208. [Dec][Video] targa_y216  
  209. [Dec][Video]     theora  
  210. [Dec][Video]        thp  
  211. [Dec][Video] tiertexseqvideo  
  212. [Enc][Video]       tiff  
  213. [Dec][Video]       tiff  
  214. [Dec][Video]        tmv  
  215. [Dec][Video] truemotion1  
  216. [Dec][Video] truemotion2  
  217. [Dec][Video]   camtasia  
  218. [Dec][Video]      tscc2  
  219. [Dec][Video]        txd  
  220. [Dec][Video] ultimotion  
  221. [Enc][Video]    utvideo  
  222. [Dec][Video]    utvideo  
  223. [Enc][Video]       v210  
  224. [Dec][Video]       v210  
  225. [Dec][Video]      v210x  
  226. [Enc][Video]       v308  
  227. [Dec][Video]       v308  
  228. [Enc][Video]       v408  
  229. [Dec][Video]       v408  
  230. [Enc][Video]       v410  
  231. [Dec][Video]       v410  
  232. [Dec][Video]         vb  
  233. [Dec][Video]       vble  
  234. [Dec][Video]        vc1  
  235. [Dec][Video]   vc1image  
  236. [Dec][Video]       vcr1  
  237. [Dec][Video]   vmdvideo  
  238. [Dec][Video]       vmnc  
  239. [Dec][Video]        vp3  
  240. [Dec][Video]        vp5  
  241. [Dec][Video]        vp6  
  242. [Dec][Video]       vp6a  
  243. [Dec][Video]       vp6f  
  244. [Dec][Video]        vp7  
  245. [Dec][Video]        vp8  
  246. [Dec][Video]        vp9  
  247. [Dec][Video]   vqavideo  
  248. [Dec][Video]       webp  
  249. [Enc][Video]       wmv1  
  250. [Dec][Video]       wmv1  
  251. [Enc][Video]       wmv2  
  252. [Dec][Video]       wmv2  
  253. [Dec][Video]       wmv3  
  254. [Dec][Video]  wmv3image  
  255. [Dec][Video]       wnv1  
  256. [Dec][Video]    xan_wc3  
  257. [Dec][Video]    xan_wc4  
  258. [Enc][Video]        xbm  
  259. [Dec][Video]        xbm  
  260. [Enc][Video]      xface  
  261. [Dec][Video]      xface  
  262. [Dec][Video]         xl  
  263. [Enc][Video]        xwd  
  264. [Dec][Video]        xwd  
  265. [Enc][Video]       y41p  
  266. [Dec][Video]       y41p  
  267. [Dec][Video]        yop  
  268. [Enc][Video]       yuv4  
  269. [Dec][Video]       yuv4  
  270. [Dec][Video]       012v  
  271. [Dec][Video]  zerocodec  
  272. [Enc][Video]       zlib  
  273. [Dec][Video]       zlib  
  274. [Enc][Video]       zmbv  
  275. [Dec][Video]       zmbv  
  276. [Enc][Audio]        aac  
  277. [Dec][Audio]        aac  
  278. [Dec][Audio]   aac_latm  
  279. [Enc][Audio]        ac3  
  280. [Dec][Audio]        ac3  
  281. [Enc][Audio]  ac3_fixed  
  282. [Dec][Audio]  ac3_fixed  
  283. [Enc][Audio]       alac  
  284. [Dec][Audio]       alac  
  285. [Dec][Audio]        als  
  286. [Dec][Audio]      amrnb  
  287. [Dec][Audio]      amrwb  
  288. [Dec][Audio]        ape  
  289. [Dec][Audio]     atrac1  
  290. [Dec][Audio]     atrac3  
  291. [Dec][Audio] atrac3plus  
  292. [Dec][Audio] binkaudio_dct  
  293. [Dec][Audio] binkaudio_rdft  
  294. [Dec][Audio]  bmv_audio  
  295. [Dec][Audio]       cook  
  296. [Enc][Audio]        dca  
  297. [Dec][Audio]        dca  
  298. [Dec][Audio]   dsd_lsbf  
  299. [Dec][Audio]   dsd_msbf  
  300. [Dec][Audio] dsd_lsbf_planar  
  301. [Dec][Audio] dsd_msbf_planar  
  302. [Dec][Audio] dsicinaudio  
  303. [Enc][Audio]       eac3  
  304. [Dec][Audio]       eac3  
  305. [Dec][Audio]       evrc  
  306. [Dec][Audio]  wavesynth  
  307. [Enc][Audio]       flac  
  308. [Dec][Audio]       flac  
  309. [Enc][Audio]     g723_1  
  310. [Dec][Audio]     g723_1  
  311. [Dec][Audio]       g729  
  312. [Dec][Audio]        gsm  
  313. [Dec][Audio]     gsm_ms  
  314. [Dec][Audio]        iac  
  315. [Dec][Audio]        imc  
  316. [Dec][Audio]      mace3  
  317. [Dec][Audio]      mace6  
  318. [Dec][Audio]  metasound  
  319. [Dec][Audio]        mlp  
  320. [Dec][Audio]        mp1  
  321. [Dec][Audio]   mp1float  
  322. [Enc][Audio]        mp2  
  323. [Dec][Audio]        mp2  
  324. [Dec][Audio]   mp2float  
  325. [Enc][Audio]   mp2fixed  
  326. [Dec][Audio]        mp3  
  327. [Dec][Audio]   mp3float  
  328. [Dec][Audio]     mp3adu  
  329. [Dec][Audio] mp3adufloat  
  330. [Dec][Audio]     mp3on4  
  331. [Dec][Audio] mp3on4float  
  332. [Dec][Audio]       mpc7  
  333. [Dec][Audio]       mpc8  
  334. [Enc][Audio] nellymoser  
  335. [Dec][Audio] nellymoser  
  336. [Dec][Audio]     on2avc  
  337. [Dec][Audio]  paf_audio  
  338. [Dec][Audio]      qcelp  
  339. [Dec][Audio]       qdm2  
  340. [Enc][Audio]   real_144  
  341. [Dec][Audio]   real_144  
  342. [Dec][Audio]   real_288  
  343. [Dec][Audio]       ralf  
  344. [Dec][Audio]    shorten  
  345. [Dec][Audio]       sipr  
  346. [Dec][Audio]   smackaud  
  347. [Enc][Audio]      sonic  
  348. [Dec][Audio]      sonic  
  349. [Enc][Audio]    sonicls  
  350. [Dec][Audio]        tak  
  351. [Dec][Audio]     truehd  
  352. [Dec][Audio] truespeech  
  353. [Enc][Audio]        tta  
  354. [Dec][Audio]        tta  
  355. [Dec][Audio]     twinvq  
  356. [Dec][Audio]   vmdaudio  
  357. [Enc][Audio]     vorbis  
  358. [Dec][Audio]     vorbis  
  359. [Enc][Audio]    wavpack  
  360. [Dec][Audio]    wavpack  
  361. [Dec][Audio] wmalossless  
  362. [Dec][Audio]     wmapro  
  363. [Enc][Audio]      wmav1  
  364. [Dec][Audio]      wmav1  
  365. [Enc][Audio]      wmav2  
  366. [Dec][Audio]      wmav2  
  367. [Dec][Audio]   wmavoice  
  368. [Dec][Audio]    ws_snd1  
  369. [Enc][Audio]   pcm_alaw  
  370. [Dec][Audio]   pcm_alaw  
  371. [Dec][Audio] pcm_bluray  
  372. [Dec][Audio]    pcm_dvd  
  373. [Enc][Audio]  pcm_f32be  
  374. [Dec][Audio]  pcm_f32be  
  375. [Enc][Audio]  pcm_f32le  
  376. [Dec][Audio]  pcm_f32le  
  377. [Enc][Audio]  pcm_f64be  
  378. [Dec][Audio]  pcm_f64be  
  379. [Enc][Audio]  pcm_f64le  
  380. [Dec][Audio]  pcm_f64le  
  381. [Dec][Audio]    pcm_lxf  
  382. [Enc][Audio]  pcm_mulaw  
  383. [Dec][Audio]  pcm_mulaw  
  384. [Enc][Audio]     pcm_s8  
  385. [Dec][Audio]     pcm_s8  
  386. [Enc][Audio] pcm_s8_planar  
  387. [Dec][Audio] pcm_s8_planar  
  388. [Enc][Audio]  pcm_s16be  
  389. [Dec][Audio]  pcm_s16be  
  390. [Enc][Audio] pcm_s16be_planar  
  391. [Dec][Audio] pcm_s16be_planar  
  392. [Enc][Audio]  pcm_s16le  
  393. [Dec][Audio]  pcm_s16le  
  394. [Enc][Audio] pcm_s16le_planar  
  395. [Dec][Audio] pcm_s16le_planar  
  396. [Enc][Audio]  pcm_s24be  
  397. [Dec][Audio]  pcm_s24be  
  398. [Enc][Audio] pcm_s24daud  
  399. [Dec][Audio] pcm_s24daud  
  400. [Enc][Audio]  pcm_s24le  
  401. [Dec][Audio]  pcm_s24le  
  402. [Enc][Audio] pcm_s24le_planar  
  403. [Dec][Audio] pcm_s24le_planar  
  404. [Enc][Audio]  pcm_s32be  
  405. [Dec][Audio]  pcm_s32be  
  406. [Enc][Audio]  pcm_s32le  
  407. [Dec][Audio]  pcm_s32le  
  408. [Enc][Audio] pcm_s32le_planar  
  409. [Dec][Audio] pcm_s32le_planar  
  410. [Enc][Audio]     pcm_u8  
  411. [Dec][Audio]     pcm_u8  
  412. [Enc][Audio]  pcm_u16be  
  413. [Dec][Audio]  pcm_u16be  
  414. [Enc][Audio]  pcm_u16le  
  415. [Dec][Audio]  pcm_u16le  
  416. [Enc][Audio]  pcm_u24be  
  417. [Dec][Audio]  pcm_u24be  
  418. [Enc][Audio]  pcm_u24le  
  419. [Dec][Audio]  pcm_u24le  
  420. [Enc][Audio]  pcm_u32be  
  421. [Dec][Audio]  pcm_u32be  
  422. [Enc][Audio]  pcm_u32le  
  423. [Dec][Audio]  pcm_u32le  
  424. [Dec][Audio]   pcm_zork  
  425. [Dec][Audio] interplay_dpcm  
  426. [Enc][Audio]   roq_dpcm  
  427. [Dec][Audio]   roq_dpcm  
  428. [Dec][Audio]   sol_dpcm  
  429. [Dec][Audio]   xan_dpcm  
  430. [Dec][Audio]  adpcm_4xm  
  431. [Enc][Audio]  adpcm_adx  
  432. [Dec][Audio]  adpcm_adx  
  433. [Dec][Audio]  adpcm_afc  
  434. [Dec][Audio]   adpcm_ct  
  435. [Dec][Audio]  adpcm_dtk  
  436. [Dec][Audio]   adpcm_ea  
  437. [Dec][Audio] adpcm_ea_maxis_xa  
  438. [Dec][Audio] adpcm_ea_r1  
  439. [Dec][Audio] adpcm_ea_r2  
  440. [Dec][Audio] adpcm_ea_r3  
  441. [Dec][Audio] adpcm_ea_xas  
  442. [Enc][Audio]       g722  
  443. [Dec][Audio]       g722  
  444. [Enc][Audio]       g726  
  445. [Dec][Audio]       g726  
  446. [Dec][Audio]     g726le  
  447. [Dec][Audio] adpcm_ima_amv  
  448. [Dec][Audio] adpcm_ima_apc  
  449. [Dec][Audio] adpcm_ima_dk3  
  450. [Dec][Audio] adpcm_ima_dk4  
  451. [Dec][Audio] adpcm_ima_ea_eacs  
  452. [Dec][Audio] adpcm_ima_ea_sead  
  453. [Dec][Audio] adpcm_ima_iss  
  454. [Dec][Audio] adpcm_ima_oki  
  455. [Enc][Audio] adpcm_ima_qt  
  456. [Dec][Audio] adpcm_ima_qt  
  457. [Dec][Audio] adpcm_ima_rad  
  458. [Dec][Audio] adpcm_ima_smjpeg  
  459. [Enc][Audio] adpcm_ima_wav  
  460. [Dec][Audio] adpcm_ima_wav  
  461. [Dec][Audio] adpcm_ima_ws  
  462. [Enc][Audio]   adpcm_ms  
  463. [Dec][Audio]   adpcm_ms  
  464. [Dec][Audio] adpcm_sbpro_2  
  465. [Dec][Audio] adpcm_sbpro_3  
  466. [Dec][Audio] adpcm_sbpro_4  
  467. [Enc][Audio]  adpcm_swf  
  468. [Dec][Audio]  adpcm_swf  
  469. [Dec][Audio]  adpcm_thp  
  470. [Dec][Audio] adpcm_vima  
  471. [Dec][Audio]   adpcm_xa  
  472. [Enc][Audio] adpcm_yamaha  
  473. [Dec][Audio] adpcm_yamaha  
  474. [Dec][Audio]       vima  
  475. [Enc][Other]        ssa  
  476. [Dec][Other]        ssa  
  477. [Enc][Other]        ass  
  478. [Dec][Other]        ass  
  479. [Enc][Other]     dvbsub  
  480. [Dec][Other]     dvbsub  
  481. [Enc][Other]     dvdsub  
  482. [Dec][Other]     dvdsub  
  483. [Dec][Other]    jacosub  
  484. [Dec][Other]   microdvd  
  485. [Enc][Other]   mov_text  
  486. [Dec][Other]   mov_text  
  487. [Dec][Other]       mpl2  
  488. [Dec][Other]     pgssub  
  489. [Dec][Other]        pjs  
  490. [Dec][Other]   realtext  
  491. [Dec][Other]       sami  
  492. [Enc][Other]        srt  
  493. [Dec][Other]        srt  
  494. [Enc][Other]     subrip  
  495. [Dec][Other]     subrip  
  496. [Dec][Other]  subviewer  
  497. [Dec][Other] subviewer1  
  498. [Dec][Other]       text  
  499. [Dec][Other]    vplayer  
  500. [Dec][Other]     webvtt  
  501. [Enc][Other]       xsub  
  502. [Dec][Other]       xsub  
  503. [Enc][Audio]     libgsm  
  504. [Dec][Audio]     libgsm  
  505. [Enc][Audio]  libgsm_ms  
  506. [Dec][Audio]  libgsm_ms  
  507. [Enc][Audio]    libilbc  
  508. [Dec][Audio]    libilbc  
  509. [Enc][Audio] libmp3lame  
  510. [Enc][Audio] libopencore_amrnb  
  511. [Dec][Audio] libopencore_amrnb  
  512. [Dec][Audio] libopencore_amrwb  
  513. [Enc][Video] libopenjpeg  
  514. [Dec][Video] libopenjpeg  
  515. [Enc][Audio]    libopus  
  516. [Dec][Audio]    libopus  
  517. [Enc][Video] libschroedinger  
  518. [Dec][Video] libschroedinger  
  519. [Enc][Audio]   libspeex  
  520. [Dec][Audio]   libspeex  
  521. [Enc][Video]  libtheora  
  522. [Enc][Audio] libtwolame  
  523. [Enc][Audio] libvo_aacenc  
  524. [Enc][Audio] libvo_amrwbenc  
  525. [Enc][Audio]  libvorbis  
  526. [Dec][Audio]  libvorbis  
  527. [Enc][Video]     libvpx  
  528. [Dec][Video]     libvpx  
  529. [Enc][Video] libvpx-vp9  
  530. [Dec][Video] libvpx-vp9  
  531. [Enc][Audio] libwavpack  
  532. [Enc][Video]    libx264  
  533. [Enc][Video] libx264rgb  
  534. [Enc][Video]    libx265  
  535. [Enc][Video]    libxavs  
  536. [Enc][Video]    libxvid  
  537. [Dec][Video]    bintext  
  538. [Dec][Video]       xbin  
  539. [Dec][Video]        idf  


下载


Simplest FFmpeg Player


项目主页

SourceForge:https://sourceforge.net/projects/simplestffmpegplayer/

Github:https://github.com/leixiaohua1020/simplest_ffmpeg_player

开源中国:http://git.oschina.net/leixiaohua1020/simplest_ffmpeg_player

CSDN下载地址:http://download.csdn.net/detail/leixiaohua1020/8924321


本程序实现了视频文件的解码和显示(支持HEVC,H.264,MPEG2等)。
是最简单的FFmpeg视频解码方面的教程。
通过学习本例子可以了解FFmpeg的解码流程。
项目包含6个工程:
simplest_ffmpeg_player:标准版,FFmpeg学习的开始。
simplest_ffmpeg_player_su:SU(SDL Update)版,加入了简单的SDL的Event。
simplest_ffmpeg_decoder:一个包含了封装格式处理功能的解码器。使用了libavcodec和libavformat。
simplest_ffmpeg_decoder_pure:一个纯净的解码器。只使用libavcodec(没有使用libavformat)。
simplest_video_play_sdl2:使用SDL2播放YUV的例子。
simplest_ffmpeg_helloworld:输出FFmpeg类库的信息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值