[MEncoder-users] Is it possible to make Mencoder encode video file DAR(Display Aspect Ratio) same as ffmpeg does?

littlebat dashing.meng at gmail.com
Wed Dec 12 10:53:09 CET 2012


Hi,

I have read all parameters in mencoder to deal with DAR of result
encoded file, but it seems can't set the result video's DAR correctly
as ffmpeg does. The result file encoded by mencoder has two different
DAR(detected by ffmpeg -i), but the file encoded by ffmpeg has only one
DAR value.(also detected by ffmpeg -i).

So:
1, Is it possible to make Mencoder encode video file DAR (Display
Aspect Ratio) same as ffmpeg does? How to do that?

2, What is the difference between the DAR in "[]" and outside "[]" in
"ffmpeg -i " information? such as:
Stream #0.0: Video: mpeg4, yuv420p, 176x144 [PAR 12:11 DAR 4:3],
PAR 1:1 DAR 11:9, 10 fps, 10 tbr, 1k tbn, 10 tbc (default) Stream


 Below is my command line:
1, Mencoder
mencoder \
  -noconfig all \
  -ovc lavc \
  -oac pcm \
  -lavcopts vcodec=mpeg4:vbitrate=256:aspect=4/3 \
  -vf harddup,scale=176:144 \
  -of lavf \
  -ofps 10 \
  -lavfopts format=mkv \
  -o "m.mkv" \
  "108.flv" -ss 0 -endpos 10

ffmpeg -i m.mkv information:
Input #0, matroska,webm, from 'm.mkv':
  Metadata:
    ENCODER         : Lavf53.2.0
  Duration: 00:00:10.10, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: mpeg4, yuv420p, 176x144 [PAR 12:11 DAR 4:3],
PAR 1:1 DAR 11:9, 10 fps, 10 tbr, 1k tbn, 10 tbc (default) Stream #0.1:
Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s (default)

2, Ffmpeg
ffmpeg -y \
  -i "108.flv" \
  -ss 0 -t 10 \
  -vcodec mpeg4 -b 256k -r 10 -s 176x144 -aspect 4:3 \
  -acodec pcm_s16le \
  -f matroska \
  "f.mkv"

 ffmpeg -i f.mkv information:
Input #0, matroska,webm, from 'f.mkv':
  Metadata:
    DURATION        : 240
    STARTTIME       : 0
    TOTALDURATION   : 240
    WIDTH           : 640
    HEIGHT          : 480
    VIDEODATARATE   : 1020
    AUDIODATARATE   : 129
    TOTALDATARATE   : 1158
    FRAMERATE       : 30
    BYTELENGTH      : 34667397
    CANSEEKONTIME   : true
    SOURCEDATA      : BADC23162MH1331261156003464
    PURL            : 
    PMSG            : 
    ENCODER         : Lavf53.2.0
  Duration: 00:00:10.10, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: mpeg4, yuv420p, 176x144 [PAR 12:11 DAR 4:3], 10
fps, 10 tbr, 1k tbn, 10 tbc (default) Stream #0.1: Audio: pcm_s16le,
44100 Hz, 2 channels, s16, 1411 kb/s (default) 

You can download the sample result files at:
Mencoder encoded file: m.mkv: http://www.learndiary.com/test/m.mkv
Ffmpeg encoded file: f.mkv: http://www.learndiary.com/test/f.mkv

Thanks.


More information about the MEncoder-users mailing list