VideoHelp Forum




+ Reply to Thread
Results 1 to 10 of 10
  1. I wanted to use mencoder to decode an avi file (and normally do some filtering which is not supported by ffmpeg), then pipe the output to ffmpeg to encode as prores using:
    Code:
    mencoder -lavdopts threads=2 -really-quiet -of rawvideo -o - -ovc raw -demuxer lavf -vfm ffmpeg -noskip -vf scale,format=i420,scale,format=422p -nosound -mc 0 test.avi | ffmpeg -y -pix_fmt yuv422p -s 640x352 -f rawvideo -i - -threads 2 -vcodec prores_aw -profile:v 0 -f mov test.mov
    Problem is that the output is all blue, and all people look like smurfs, which normally is a good indicator that some color conversion went wrong.
    -> does any one see where I made the mistake ?
    Quote Quote  
  2. Sounds like the U and V channels were reversed. Like this?
    Click image for larger version

Name:	swapuv.jpg
Views:	953
Size:	17.7 KB
ID:	18835
    Quote Quote  
  3. yes, but why?
    Code:
    -vf scale,format=i420,scale,format=422p
    should do the conversion, shouldn't it ?
    Quote Quote  
  4. you can try -vf swapuv, but I would try to figure out the underlying problem first



    which filtering are you doing that is not supported by ffmpeg ?

    btw, ffmpeg added a field matcher + decimate (IVTC) , plus a bunch more things recently
    Quote Quote  
  5. which filtering are you doing that is not supported by ffmpeg ?
    mainly filmdint (I also use libass, since I can't get ffmpeg to compile with it properly, due to the whole fontconfig thing )

    Didn't know about decimate.

    Thanks, swapuv does solve the problem, but why is it needed at all?
    Quote Quote  
  6. I don't know. Try working backwards, and go step by step


    1st are you sure it's not a prores decoding issue ? Try another player/decoder

    2nd, something other than prores (ie. is it the prores encoder that is the problem ) ? - I doubt it , but try huffyuv or utvideo instead . If that test is ok, then the pipe up to ffmpeg should be ok

    3rd , is it -vf scale or swscale ? try i420 with ffv1, instead of i422 , maybe something got swapped during the chroma upscale ?

    .
    .
    .
    Quote Quote  
  7. the problem seems to be the "-vf scale,format=i420,scale,format=422p" when I save the output into a raw yuv file the problem is already there,.. seems like a bug in mencoder (libav?)
    Quote Quote  
  8. Originally Posted by Selur View Post
    the problem seems to be the "-vf scale,format=i420,scale,format=422p" when I save the output into a raw yuv file the problem is already there,.. seems like a bug in mencoder (libav?)

    I 'm not familiar with the syntax for mencoder -vf scale, but why is format specified as i420, then 422p (not i422) ?

    I would expect the same naming conventions between the arguments

    i420, i422

    or

    420p, 422p

    or

    yuv420p, yuv422p
    Last edited by poisondeathray; 12th Jul 2013 at 10:58.
    Quote Quote  
  9. Another option - you could also do the 420=>422 chroma scaling in ffmpeg . Or was there a reason why it's done in mencoder ? (different , better algorithm ? )
    Quote Quote  
  10. Only reason I do the conversion in mencoder is that I generate the call and switch out the encoder depending on the format I want to convert to (x264, vpxenc, ffmpeg, ....) and not all encoders can do the color conversion themself.

    I 'm not familiar with the syntax for mencoder -vf scale, but why is format specified as i420, then 422p (not i422) ?
    will check in the source code, since I can't find any documentation about it
    422p seems to be correct:
    Code:
    #include "libmpcodecs/img_format.h"
    
    /* FIXME: snyc with img_format.h */
    static struct {
      const char* name;
      unsigned int fmt;
    } mp_imgfmt_list[] = {
      {"444p16le", IMGFMT_444P16_LE},
      {"444p16be", IMGFMT_444P16_BE},
      {"444p14le", IMGFMT_444P14_LE},
      {"444p14be", IMGFMT_444P14_BE},
      {"444p12le", IMGFMT_444P12_LE},
      {"444p12be", IMGFMT_444P12_BE},
      {"444p10le", IMGFMT_444P10_LE},
      {"444p10be", IMGFMT_444P10_BE},
      {"444p9le",  IMGFMT_444P9_LE},
      {"444p9be",  IMGFMT_444P9_BE},
      {"422p16le", IMGFMT_422P16_LE},
      {"422p16be", IMGFMT_422P16_BE},
      {"422p14le", IMGFMT_422P14_LE},
      {"422p14be", IMGFMT_422P14_BE},
      {"422p12le", IMGFMT_422P12_LE},
      {"422p12be", IMGFMT_422P12_BE},
      {"422p10le", IMGFMT_422P10_LE},
      {"422p10be", IMGFMT_422P10_BE},
      {"422p9le",  IMGFMT_422P9_LE},
      {"422p9be",  IMGFMT_422P9_BE},
      {"420p16le", IMGFMT_420P16_LE},
      {"420p16be", IMGFMT_420P16_BE},
      {"420p10le", IMGFMT_420P10_LE},
      {"420p10be", IMGFMT_420P10_BE},
      {"420p9le",  IMGFMT_420P9_LE},
      {"420p9be",  IMGFMT_420P9_BE},
      {"444p16",   IMGFMT_444P16},
      {"422p16",   IMGFMT_422P16},
      {"422p10",   IMGFMT_422P10},
      {"420p16",   IMGFMT_420P16},
      {"420p10",   IMGFMT_420P10},
      {"420p9",    IMGFMT_420P9},
      {"444a", IMGFMT_444A},
      {"422a", IMGFMT_422A},
      {"420a", IMGFMT_420A},
      {"444p", IMGFMT_444P},
      {"422p", IMGFMT_422P},
      {"411p", IMGFMT_411P},
      {"440p", IMGFMT_440P},
      {"yuy2", IMGFMT_YUY2},
      {"yvyu", IMGFMT_YVYU},
      {"uyvy", IMGFMT_UYVY},
      {"yvu9", IMGFMT_YVU9},
      {"if09", IMGFMT_IF09},
      {"yv12", IMGFMT_YV12},
      {"i420", IMGFMT_I420},
      {"iyuv", IMGFMT_IYUV},
      {"clpl", IMGFMT_CLPL},
      {"hm12", IMGFMT_HM12},
      {"y800", IMGFMT_Y800},
      {"y8",   IMGFMT_Y8},
      {"y8a",  IMGFMT_Y8A},
      {"y16be", IMGFMT_Y16_BE},
      {"y16le", IMGFMT_Y16_LE},
      {"nv12", IMGFMT_NV12},
      {"nv21", IMGFMT_NV21},
      {"bgr24", IMGFMT_BGR24},
      {"bgr32", IMGFMT_BGR32},
      {"bgr16", IMGFMT_BGR16},
      {"bgr15", IMGFMT_BGR15},
      {"bgr12", IMGFMT_BGR12},
      {"bgr8", IMGFMT_BGR8},
      {"bgr4", IMGFMT_BGR4},
      {"bg4b", IMGFMT_BG4B},
      {"bgr1", IMGFMT_BGR1},
      {"rgb64be", IMGFMT_RGB64BE},
      {"rgb64le", IMGFMT_RGB64LE},
      {"rgb48be", IMGFMT_RGB48BE},
      {"rgb48le", IMGFMT_RGB48LE},
      {"rgb48ne", IMGFMT_RGB48NE},
      {"rgb24", IMGFMT_RGB24},
      {"rgb32", IMGFMT_RGB32},
      {"rgb16", IMGFMT_RGB16},
      {"rgb15", IMGFMT_RGB15},
      {"rgb12", IMGFMT_RGB12},
      {"rgb8", IMGFMT_RGB8},
      {"rgb4", IMGFMT_RGB4},
      {"rg4b", IMGFMT_RG4B},
      {"rgb1", IMGFMT_RGB1},
      {"rgba", IMGFMT_RGBA},
      {"argb", IMGFMT_ARGB},
      {"bgra", IMGFMT_BGRA},
      {"abgr", IMGFMT_ABGR},
      {"xyz12be",  IMGFMT_XYZ12LE},
      {"xyz12le",  IMGFMT_XYZ12BE},
      {"gbr14pbe", IMGFMT_GBR14PLE},
      {"gbr14ple", IMGFMT_GBR14PBE},
      {"gbr12pbe", IMGFMT_GBR12PLE},
      {"gbr12ple", IMGFMT_GBR12PBE},
      {"gbr24p", IMGFMT_GBR24P},
      {"mjpeg", IMGFMT_MJPEG},
      {"mjpg", IMGFMT_MJPEG},
      { NULL, 0 }
    };
    source: m_option.c from mplayer project
    Last edited by Selur; 12th Jul 2013 at 11:29.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!