using FFMPEG commands , can i get the default values of any media file, like resolution, audio codec, video codec..etc
like for eg. if i enter the outp开发者_如何学Cut extension '.avi' , i should get the default audio codec used , default video codec used , etc... Is there a command for this ?
I presume you mean the libavcodec API that the ffmpeg project make available?
void avcodec_get_context_defaults(AVCodecContext *s);
is probably the function you want. If you mean the ffmpeg binary, that would be a better question for superuser.
Just take a stab here; you would need to declare a codec context and retrieve it from the video stream.
Did you try ffmpeg -i [FILE_NAME]
? The Stream #0.0 line will give you the file metadata information. See sample below:
$ ffmpeg -i file.asf
FFmpeg version SVN-r18725, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --enable-libmp3lame --disable-mmx --enable-nonfree
libavutil 50. 3. 0 / 50. 3. 0
libavcodec 52.28. 0 / 52.28. 0
libavformat 52.32. 0 / 52.32. 0
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0. 7. 1 / 0. 7. 1
built on May 1 2009 10:33:46, gcc: 4.3.2
Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 14.99 (15000/1001)
Input #0, asf, from 'ZAMYjD41wOjJzpJK2Lk8.asf':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0.0: Video: mpeg4, yuv420p, 640x480, 14.99 tbr, 1k tbn, 1k tbc
At least one output file must be specified
精彩评论