chents:Test chents$ clang -g -o mediainfo mediainfo.c `pkg-config --libs libavutil libavformat`
mediainfo.c:22:2: warning: implicit declaration of function 'av_format_close_input' is invalid in C99
[-Wimplicit-function-declaration]
av_format_close_input(&fmt_ctx);
^
1 warning generated.
Undefined symbols for architecture x86_64:
"_av_format_close_input", referenced from:
_main in mediainfo-c5c981.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
刚开始执行错误,报错在close_input
后来注释掉,在编译运行就好了
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './hhh.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : www.aliyun.com - Media Transcoding
Duration: 00:01:00.09, bitrate: N/A
Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none, 960x540, 984 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 12800 tbn (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, 2 channels, 96 kb/s (default)
Metadata:
handler_name : SoundHandler