Opened 9 years ago

Closed 9 years ago

#4535 closed defect (fixed)

Wrong avi resolution leads to green frames (MSC2)

Reported by: Carl Eugen Hoyos Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: avi mjpeg
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

I will attach the first frames of a cctv recording that contains mjpeg in avi. The mjpeg frames have a resolution of 704x288 and are gray, the avi header reports 704x576. The result are ugly green frames.

$ ffmpeg -i MSC2.avi -qscale 2 -vframes 123 out.avi
ffmpeg version N-71919-ge31cdb5 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      54. 23.101 / 54. 23.101
  libavcodec     56. 37.100 / 56. 37.100
  libavformat    56. 31.102 / 56. 31.102
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, avi, from 'MSC2.avi':
  Duration: 00:00:35.00, start: 0.000000, bitrate: 585 kb/s
    Stream #0:0: Video: mjpeg (MSC2 / 0x3243534D), yuvj422p(pc, bt470bg/unknown/unknown), 704x576, 3 fps, 3 tbr, 3 tbn, 3 tbc
    Metadata:
      title           : ????i
Please use -q:a or -q:v, -qscale is ambiguous
[swscaler @ 0x3200060] deprecated pixel format used, make sure you did set range correctly
Output #0, avi, to 'out.avi':
  Metadata:
    ISFT            : Lavf56.31.102
    Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 704x576, q=2-31, 200 kb/s, 3 fps, 3 tbn, 3 tbc
    Metadata:
      title           : ????i
      encoder         : Lavc56.37.100 mpeg4
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
frame=  123 fps=0.0 q=2.0 Lsize=    4466kB time=00:00:41.00 bitrate= 892.3kbits/s
video:4457kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.190914%

The following produces a nicer output:

$ ffmpeg -i MSC2.avi -vcodec copy out%4d.jpg
$ ffmpeg -framerate 3 -i out%4d.jpg -vf setdar=4/3 -qscale 2 out.avi

Original filename was D__00-események_20150505-Ormai Gillda_MSCII 2015.05.05. 13_03_46_OBFR_Petzvál_u..1.MBF__(18) MOHAI UTCA II..1.AVI

Attachments (1)

MSC2.avi (2.4 MB ) - added by Carl Eugen Hoyos 9 years ago.

Change History (2)

by Carl Eugen Hoyos, 9 years ago

Attachment: MSC2.avi added

comment:1 by Michael Niedermayer, 9 years ago

Reproduced by developer: set
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.