[Libav-user] yuv420p mjp2 track misidentified as gray8 ?

"René J.V. Bertin" rjvbertin at gmail.com
Sat Feb 9 17:07:11 CET 2013


Hello,

I'm playing with Motion-JPEG2000 support in my FFusion QuickTime component, mostly for fun,

I have a test video produced with a recent ffmpeg version, from an mp4v video with `-vcodec libopenjpeg kk2.mov`

The matching ffprobe identifies this as mjp2 yuv420p content, ffprobe from the ffmpeg version used by FFusion identifies it as gray8.
The same libopenjpeg is used in both cases.

I'm aware that FFusion uses an old lavc (v 52), and that maybe it does some kind of internal conversion of the yuv420p content into gray8, for whatever reason. But if that is not the case, is there a way to interpret (or complete) the frame data returned by avcodec_decode_video2() to reconstruct a colour image? 

The ffprobe outputs:

> ffprobe -show_streams kk2.mov
ffprobe version 1.1.1 Copyright (c) 2007-2013 the FFmpeg developers
  built on Jan 27 2013 12:08:35 with gcc 4.2.1 (GCC) (Apple Inc. build 5666) (dot 3)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libfreetype --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/gcc-4.2 --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  libavutil      52. 13.100 / 52. 13.100
  libavcodec     54. 86.100 / 54. 86.100
  libavformat    54. 59.106 / 54. 59.106
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 32.100 /  3. 32.100
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'kk2.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf54.59.106
  Duration: 00:00:53.00, start: 0.000000, bitrate: 20575 kb/s
    Stream #0:0(eng): Video: jpeg2000 (mjp2 / 0x32706A6D), yuv420p, 720x576, 20575 kb/s, 12 fps, 12 tbr, 12288 tbn, 12288 tbc
    Metadata:
      handler_name    : DataHandler
[STREAM]
index=0
codec_name=libopenjpeg
codec_long_name=OpenJPEG JPEG 2000
profile=unknown
codec_type=video
codec_time_base=1/12288
codec_tag_string=mjp2
codec_tag=0x32706a6d
width=720
height=576
has_b_frames=0
sample_aspect_ratio=0:1
display_aspect_ratio=0:1
pix_fmt=yuv420p
level=-99
timecode=N/A
id=N/A
r_frame_rate=12/1
avg_frame_rate=12/1
time_base=1/12288
start_pts=0
start_time=0.000000
duration_ts=651264
duration=53.000000
bit_rate=20575025
nb_frames=636
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:language=eng
TAG:handler_name=DataHandler
[/STREAM]

> FFusion-124R/FFmpeg/osx86/bin/ffprobe -show_streams kk2.mov
FFprobe version SVN-r1435, Copyright (c) 2007-2011 the FFmpeg developers
  built on Feb  8 2013 16:20:46 with gcc 4.2.1 (Apple Inc. build 5664)
  configuration: --extra-ldflags='-mmacosx-version-min=10.6 -D__DARWIN_UNIX03=0 -Dattribute_deprecated= -w -msse3 -msse4 -mssse3 -arch i386' --cpu=core2 --extra-cflags='-arch i386 -mmacosx-version-min=10.6 -D__DARWIN_UNIX03=0 -Dattribute_deprecated= -w -msse3 -msse4 -mssse3 -fweb -fstrict-aliasing -finline-limit=1000 -freorder-blocks -O3 -finline-functions -funroll-loops -ftree-vectorize -ftracer -mdynamic-no-pic -mtune=core2 --param max-completely-peel-times=2' --prefix=/Volumes/Debian/Users/bertin/work/src/MacOSX/FFusion-124R/FFmpeg/osx86 --cc=gcc-4.2 --disable-amd3dnow --disable-doc --disable-encoders --enable-ffprobe --disable-ffserver --disable-muxers --disable-network --enable-libopenjpeg --extra-cflags=-I/opt/local/include --extra-ldflags=-L/opt/local/lib --enable-swscale --enable-avfilter --disable-avdevice --enable-ffmpeg --target-os=darwin
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 1 /  0.16. 1
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.93. 0 / 52.93. 0
  libavfilter    1.74. 0 /  1.74. 0
  libswscale     0.12. 0 /  0.12. 0
[libopenjpeg @ 0x100a000] Only first component will be used.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'kk2.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf54.59.106
  Duration: 00:00:53.00, start: 0.000000, bitrate: 20575 kb/s
    Stream #0.0(eng): Video: libopenjpeg, gray, 720x576, 20575 kb/s, 12 fps, 12 tbr, 12288 tbn, 12288 tbc
[STREAM]
index=0
codec_name=libopenjpeg
codec_long_name=OpenJPEG based JPEG 2000 decoder
codec_type=video
codec_time_base=1/12288
codec_tag_string=mjp2
codec_tag=0x32706a6d
width=720
height=576
has_b_frames=0
pix_fmt=gray
r_frame_rate=12/1
avg_frame_rate=12/1
time_base=1/12288
start_time=0.000000 
duration=53.000000 
nb_frames=636
TAG:language=eng
[/STREAM]




More information about the Libav-user mailing list