tags:

views:

114

answers:

1

I have often problems reading AVI file with my TV dvd player if they are not divx or xvid (DX50,i.e., is not readable).

I'd like to make a fast script to recognize the video codec of these files before burn it on cdrom/dvd.

The command :

ffmpeg -i file.avi

give the "container" of the video stream (mpeg4,mpeg2,etc), not the codec.

Any hint?

Thanks

+1  A: 

FFmpeg gives the codec too. Pull the Stream #0.0: Video line and you can see the codec. (Be aware that it could technically have a different stream number, like 0.1.) The below output uses the MS Video-1. This is different, like you desire, from the container which is denoted by Input #0, avi

E.g.:

FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --prefix=/opt/local --disable-vhook --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-avfilter-lavf --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libfaac --enable-libfaad --enable-libxvid --enable-libx264 --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/gcc-4.2 --arch=x86_64
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 0 / 52.20. 0
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    1. 4. 0 /  1. 4. 0
  libswscale     1. 7. 1 /  1. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Jan  8 2010 15:34:15, gcc: 4.2.1 (Apple Inc. build 5646) (dot 1)
Input #0, avi, from 'Movies/fvss_demo.avi':
  Duration: 00:02:00.30, start: 0.000000, bitrate: 719 kb/s
    Stream #0.0: Video: msvideo1, rgb555, 160x120, 10 tbr, 10 tbn, 10 tbc
    Stream #0.1: Audio: pcm_u8, 8000 Hz, mono, s16, 64 kb/s
At least one output file must be specified
manoa:~ stu$ 
Stu Thompson