Xfire videos get decoded with the wrong colorspace

Discuss about generic usage of MediaCoder.

Moderator: HuggiL

Post Reply
crazedmodder
Beginner
Beginner
Posts: 5
Joined: Sat Oct 17, 2009 5:34 am

Xfire videos get decoded with the wrong colorspace

Post by crazedmodder » Mon Oct 19, 2009 12:27 pm

When I play Street Fighter 4 I like to record my matches with Xfire (it's an in-game program for chat and taking screenshots/video). I used to use Fraps but a day's worth of recording took up too much space and it was always recording my microphone. The videos are recorded at a pretty high bitrate (92 Mbps) and I want to shrink them so I tried using Mediacoder but my videos always end up with completely wrong colors (they don't look inverted).

The videos play fine in Windows Media Player and Media Player Classic - Homecinema x64 build 1.3.1249.0. However, when I play them in Mediacoder (MPlayer) the colors are inverted so I'm guessing it's a problem with the decoder and not setting the right color space. If there is a way to change/force the colorspace during decoding as I think that would take care of the problem. If there is no way to do that does anybody have any ideas on what I could do?

Thanks!

All details following, I think the "Console output of video section when playing video" section is the most relevant.

Software:
  • Vista Home Premium x64
    Mediacoder Version 0.7.2 build 4522
    Mediacoder Core 2 add-on
    Xfire version 1.115 Build 39439
Hardware:
  • Intel Core i5-750
    8GB Ram
    Nvidia GTX 260
Video Codec:
  • Type: ICM
    Name: Xfire Video Codec
    Format: XFR1
    Binary: xfcodec.dll
    Version: 1.0.0.39439
Console output of video section when playing video:

Code: Select all

Opening video decoder: [vfw] Win32/VfW video codecs
Loading codec DLL: 'xfcodec.dll'
Loaded DLL driver xfcodec.dll at 36e0000
VDec: vo config request - 840 x 524 (preferred colorspace: Packed YUY2)
[PP] Using codec's postprocessing, max q = 9.
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
[swscaler @ 0x3170980]BICUBIC scaler, from yuv420p to yuv420p using MMX2
VO: [direct3d] 640x368 => 640x399 Planar YV12
ICDecompressQuery failed: Error -2
Selected video codec: [xfire] vfm: vfw (xfire video)
Source Video Details:

Code: Select all

Container: AVI
	Bitrate: 92 Mbps
	Duration: 167.5 sec(s)
	Size: 1855 MB
Video (0): xfire
	Bitrate: 92 Mbps
	Resolution: 840x524
	Frame Rate: 30.00 FPS
	Scan: Progressive
Settings in Mediacoder:
  • Video:
    Format: h.264
    Mode: Three-Pass
    Bitrate: 1250 Kbps
    Source: Mencoder, Mplayer or Auto (the rest don't work)
    Encoder: Auto-select

    Container: Avi
    Multiplexer: Auto Select

    Picture:
    Resize: 640x368
    Frame Rate: 30.000 - Global
    Effects: Filter video by encoder or source (only tried these two)
Console output from conversion:

Code: Select all

ANS_TIME_POSITION=7.0
ANS_TIME_POSITION=7.0
ANS_TIME_POSITION=7.3
ANS_TIME_POSITION=7.3
ANS_TIME_POSITION=7.7
ANS_TIME_POSITION=7.7
[GUI] Closed by main mplayer window
[GUI] GUI thread terminated.

Exiting... (Quit)

Exiting... (Quit)
MEncoder UNKNOWN-4.2.4 (C) 2000-2009 MPlayer Team
success: format: 0  data: 0x0 - 0x73faf698
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
AVI: ODML: Building ODML index (2 superindexchunks).
VIDEO:  [XFR1]  840x524  24bpp  30.000 fps  92143.8 kbps (11248.0 kbyte/s)
[V] filefmt:3  fourcc:0x31524658  size:840x524  fps:30.000  ftime:=0.0333
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 4531819
Opening video filter: [format fmt=i420]
Opening video filter: [harddup]
==========================================================================
Opening video decoder: [vfw] Win32/VfW video codecs
Loading codec DLL: 'xfcodec.dll'
Loaded DLL driver xfcodec.dll at 2d0000
VDec: vo config request - 840 x 524 (preferred colorspace: Packed YUY2)
[PP] Using codec's postprocessing, max q = 9.
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
[swscaler @ 0x35e83f0]using unscaled yuv420p -> yuv420p special converter
ICDecompressQuery failed: Error -2
Selected video codec: [xfire] vfm: vfw (xfire video)
==========================================================================

# ".\codecs\mencoder.exe" pipe:7 -demuxer rawvideo -rawvideo fps=30/1:w=840:h=52
4:format=i420 -vf scale=640:368:0:0,harddup  -passlogfile "C:\Users\Eric\AppData
\Local\Temp\mcpass4328.log" -of rawvideo -ovc x264 -x264encopts bitrate=1250:qco
mp=0.6:qp_min=10:qp_max=51:qp_step=4:dct_decimate:me=hex:me_range=16:keyint=250:
keyint_min=25:fast_pskip:cabac:direct_pred=auto:nomixed_refs:trellis=1:nob_pyram
id:b_adapt=1:no8x8dct:weight_b:bframes=3:threads=auto:frameref=1:subq=1:pass=1 -
nosound -o NUL

MEncoder UNKNOWN-4.2.4 (C) 2000-2009 MPlayer Team
success: format: 0  data: 0x0 - 0x0
rawvideo file format detected.
[V] filefmt:26  fourcc:0x30323449  size:840x524  fps:30.000  ftime:=0.0333
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 4531819
Opening video filter: [harddup]
Opening video filter: [scale w=640 h=368 interlaced=0 chr-drop=0]
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 840 x 524 (preferred colorspace: Planar I420)
VDec: using Planar I420 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
[swscaler @ 0x348a140]BICUBIC scaler, from yuv420p to yuv420p using MMX2
x264 [info]: using SAR=368/399
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
x264 [info]: profile Main, level 3.0
Selected video codec: [rawi420] vfm: raw (RAW I420)
==========================================================================
Pos: 167.2s   5025f ( 0%) 82.18fps Trem:   0min   0mb  A-V:0.000 [1175:0]]
Flushing video frames.

Video stream: 158457.600 kbit/s  (19807200 B/s)  size: 3318366240 bytes  167.533
 secs  5026 frames
Pos: 167.3s   5027f ( 0%) 82.20fps Trem:   0min   0mb  A-V:0.000 [1175:0]
Flushing video frames.

Video stream: 1173.583 kbit/s  (146697 B/s)  size: 24576777 bytes  167.533 secs
 5027 frames
x264 [info]: slice I:30    Avg QP:25.39  size: 22577
x264 [info]: slice P:2652  Avg QP:30.52  size:  7227
x264 [info]: slice B:2344  Avg QP:32.69  size:  2018
x264 [info]: consecutive B-frames: 14.8% 66.0%  5.6% 13.5%
x264 [info]: mb I  I16..4: 29.6%  0.0% 70.4%
x264 [info]: mb P  I16..4:  6.2%  0.0% 14.9%  P16..4: 40.9% 12.6%  2.6%  0.0%  0
.0%    skip:22.7%
x264 [info]: mb B  I16..4:  1.3%  0.0%  0.0%  B16..8: 20.5%  2.9%  1.4%  direct:
 8.3%  skip:65.5%  L0:37.1% L1:49.4% BI:13.5%
x264 [info]: final ratefactor: 27.20
x264 [info]: direct mvs  spatial:71.6%  temporal:28.4%
x264 [info]: coded y,uvDC,uvAC intra:73.7% 87.9% 65.7% inter:18.2% 20.7% 4.3%
x264 [info]: kb/s:1173.5
MEncoder UNKNOWN-4.2.4 (C) 2000-2009 MPlayer Team
success: format: 0  data: 0x0 - 0x73faf698
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
AVI: ODML: Building ODML index (2 superindexchunks).
VIDEO:  [XFR1]  840x524  24bpp  30.000 fps  92143.8 kbps (11248.0 kbyte/s)
[V] filefmt:3  fourcc:0x31524658  size:840x524  fps:30.000  ftime:=0.0333
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 4531819
Opening video filter: [format fmt=i420]
Opening video filter: [harddup]
==========================================================================
Opening video decoder: [vfw] Win32/VfW video codecs
Loading codec DLL: 'xfcodec.dll'
Loaded DLL driver xfcodec.dll at 2d0000
VDec: vo config request - 840 x 524 (preferred colorspace: Packed YUY2)
[PP] Using codec's postprocessing, max q = 9.
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
[swscaler @ 0x36283f0]using unscaled yuv420p -> yuv420p special converter
ICDecompressQuery failed: Error -2
Selected video codec: [xfire] vfm: vfw (xfire video)
==========================================================================

# ".\codecs\mencoder.exe" pipe:7 -demuxer rawvideo -rawvideo fps=30/1:w=840:h=52
4:format=i420 -vf scale=640:368:0:0,harddup  -passlogfile "C:\Users\Eric\AppData
\Local\Temp\mcpass4328.log" -of rawvideo -ovc x264 -x264encopts bitrate=1250:qco
mp=0.6:qp_min=10:qp_max=51:qp_step=4:dct_decimate:me=hex:me_range=16:keyint=250:
keyint_min=25:fast_pskip:cabac:direct_pred=auto:nomixed_refs:trellis=1:nob_pyram
id:b_adapt=1:no8x8dct:weight_b:bframes=3:threads=auto:frameref=1:subq=1:pass=3 -
nosound -o NUL

MEncoder UNKNOWN-4.2.4 (C) 2000-2009 MPlayer Team
success: format: 0  data: 0x0 - 0x0
rawvideo file format detected.
[V] filefmt:26  fourcc:0x30323449  size:840x524  fps:30.000  ftime:=0.0333
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 4531819
Opening video filter: [harddup]
Opening video filter: [scale w=640 h=368 interlaced=0 chr-drop=0]
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 840 x 524 (preferred colorspace: Planar I420)
VDec: using Planar I420 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
[swscaler @ 0x346a140]BICUBIC scaler, from yuv420p to yuv420p using MMX2
x264 [info]: using SAR=368/399
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
x264 [info]: profile Main, level 3.0
Selected video codec: [rawi420] vfm: raw (RAW I420)
==========================================================================
Pos: 167.2s   5025f ( 0%) 83.68fps Trem:   0min   0mb  A-V:0.000 [1247:0]]
Flushing video frames.

Video stream: 158457.600 kbit/s  (19807200 B/s)  size: 3318366240 bytes  167.533
 secs  5026 frames
Pos: 167.3s   5027f ( 0%) 83.70fps Trem:   0min   0mb  A-V:0.000 [1247:0]
Flushing video frames.

Video stream: 1245.664 kbit/s  (155707 B/s)  size: 26086273 bytes  167.533 secs
 5027 frames
x264 [info]: slice I:30    Avg QP:25.06  size: 24271
x264 [info]: slice P:2652  Avg QP:30.46  size:  7663
x264 [info]: slice B:2344  Avg QP:32.36  size:  2147
x264 [info]: consecutive B-frames: 14.8% 66.0%  5.6% 13.5%
x264 [info]: mb I  I16..4: 31.3%  0.0% 68.7%
x264 [info]: mb P  I16..4:  6.1%  0.0% 16.0%  P16..4: 37.0% 13.2%  2.8%  0.0%  0
.0%    skip:24.9%
x264 [info]: mb B  I16..4:  1.5%  0.0%  0.0%  B16..8: 18.1%  3.2%  1.6%  direct:
 8.2%  skip:67.5%  L0:37.9% L1:47.1% BI:15.0%
x264 [info]: direct mvs  spatial:57.8%  temporal:42.2%
x264 [info]: coded y,uvDC,uvAC intra:74.4% 88.2% 66.5% inter:18.6% 18.7% 4.2%
x264 [info]: kb/s:1245.6

# ".\codecs\mencoder.exe" -quiet -oac pcm -pcmopts pipe=0x00000000000002EC -ovc
frameno -of rawvideo -channels 2 -af channels=2 -o NUL "D:\Videos\Fraps\sf4-2009
-10-17-18-35-20.avi"

MEncoder UNKNOWN-4.2.4 (C) 2000-2009 MPlayer Team
MEncoder UNKNOWN-4.2.4 (C) 2000-2009 MPlayer Team
success: format: 0  data: 0x0 - 0x73faf698
success: format: 0  data: 0x0 - 0x73faf698
AVI file format detected.
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
[aviheader] Audio stream found, -aid 1
AVI: ODML: Building ODML index (2 superindexchunks).
AVI: ODML: Building ODML index (2 superindexchunks).
Detected NON-INTERLEAVED AVI file format.
VIDEO:  [XFR1]  840x524  24bpp  30.000 fps  92143.8 kbps (11248.0 kbyte/s)
VIDEO:  [XFR1]  840x524  24bpp  30.000 fps  92143.8 kbps (11248.0 kbyte/s)
[V] filefmt:3  fourcc:0x31524658  size:840x524  fps:30.000  ftime:=0.0333
[V] filefmt:3  fourcc:0x31524658  size:840x524  fps:30.000  ftime:=0.0333
Opening video filter: [expand osd=1]
==========================================================================
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 4531819
Opening video filter: [format fmt=i420]
Opening video filter: [harddup]
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
==========================================================================
AUDIO: 48000 Hz, 1 ch, s16le, 768.0 kbit/100.00% (ratio: 96000->96000)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
Audio data will be piped out through pipe 5
Opening video decoder: [vfw] Win32/VfW video codecs
Loading codec DLL: 'xfcodec.dll'
Loaded DLL driver xfcodec.dll at 3d0000
VDec: vo config request - 840 x 524 (preferred colorspace: Packed YUY2)
[PP] Using codec's postprocessing, max q = 9.
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
[swscaler @ 0x3783f0]using unscaled yuv420p -> yuv420p special converter
ICDecompressQuery failed: Error -2
Selected video codec: [xfire] vfm: vfw (xfire video)
==========================================================================

# ".\codecs\mencoder.exe" pipe:9 -demuxer rawvideo -rawvideo fps=30/1:w=840:h=52
4:format=i420 -vf scale=640:368:0:0,harddup  -passlogfile "C:\Users\Eric\AppData
\Local\Temp\mcpass4328.log" -ovc x264 -x264encopts bitrate=1250:qcomp=0.6:qp_min
=10:qp_max=51:qp_step=4:dct_decimate:me=hex:me_range=16:keyint=250:keyint_min=25
:fast_pskip:cabac:direct_pred=auto:nomixed_refs:trellis=1:nob_pyramid:b_adapt=1:
no8x8dct:weight_b:bframes=3:threads=auto:frameref=1:subq=7:pass=2 -audio-preload
 0 -audio-demuxer rawaudio -rawaudio channels=2:rate=48000:samplesize=2 -audiofi
le pipe:7 -oac mp3lame -lameopts vbr=2:q=7:mode=0 -o "D:\Videos\Street Fighter\C
hampionship Mode - G2\10-17-2009\sf4-2009-10-17-18-35-20.avi"

MEncoder UNKNOWN-4.2.4 (C) 2000-2009 MPlayer Team
success: format: 0  data: 0x0 - 0x0
rawvideo file format detected.
rawaudio file format detected.
[V] filefmt:65536  fourcc:0x30323449  size:840x524  fps:30.000  ftime:=0.0333
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 48000 Hz, 2 ch, s16le, 1536.0 kbit/100.00% (ratio: 192000->192000)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 4531819
Opening video filter: [harddup]
Opening video filter: [scale w=640 h=368 interlaced=0 chr-drop=0]
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 840 x 524 (preferred colorspace: Planar I420)
VDec: using Planar I420 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
[swscaler @ 0x147e370]BICUBIC scaler, from yuv420p to yuv420p using MMX2
x264 [info]: using SAR=368/399
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
x264 [info]: profile Main, level 3.0
Selected video codec: [rawi420] vfm: raw (RAW I420)
==========================================================================
MP3 audio selected.
Writing header...9f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.019 [0:0]
ODML: vprp aspect is 16384:10214.
Setting audio delay to 0.024s.
Writing header...
ODML: vprp aspect is 16384:10214.
Setting audio delay to 0.024s.
Pos:   0.6s     27f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.068 [0:0]
Skipping frame!
Recommended video bitrate for 650MB CD: 32545in   0mb  A-V:0.047 [1332:129]
Recommended video bitrate for 700MB CD: 35048
Recommended video bitrate for 800MB CD: 40056
Recommended video bitrate for 2 x 650MB CD: 65091
Recommended video bitrate for 2 x 700MB CD: 70098
Recommended video bitrate for 2 x 800MB CD: 80113

Video stream:    0.960 kbit/s  (120 B/s)  size: 20104 bytes  167.533 secs  5026
frames

Audio stream: 1536.000 kbit/s  (192000 B/s)  size: 31680000 bytes  165.000 secs
Pos: 167.2s   5025f ( 0%) 74.90fps Trem:   0min   0mb  A-V:0.032 [1251:129]
Flushing video frames.

Video stream: 158457.600 kbit/s  (19807200 B/s)  size: 3318366240 bytes  167.533
 secs  5026 frames
Pos: 167.2s   5027f ( 0%) 74.92fps Trem:   0min   0mb  A-V:0.032 [1251:129]
Flushing video frames.
Writing index...
Writing header...
ODML: vprp aspect is 16384:10214.
Setting audio delay to 0.024s.

Video stream: 1249.121 kbit/s  (156140 B/s)  size: 26153468 bytes  167.500 secs
 5027 frames

Audio stream:  129.391 kbit/s  (16173 B/s)  size: 2665968 bytes  164.832 secs
x264 [info]: slice I:30    Avg QP:25.13  size: 25834
x264 [info]: slice P:2651  Avg QP:30.48  size:  7560
x264 [info]: slice B:2344  Avg QP:32.61  size:  2276
x264 [info]: consecutive B-frames: 14.8% 66.0%  5.6% 13.5%
x264 [info]: mb I  I16..4: 19.6%  0.0% 80.4%
x264 [info]: mb P  I16..4:  3.2%  0.0% 12.5%  P16..4: 34.8% 16.6%  9.6%  0.0%  0
.0%    skip:23.4%
x264 [info]: mb B  I16..4:  0.2%  0.0%  1.7%  B16..8: 42.4%  2.6%  3.7%  direct:
 4.1%  skip:45.2%  L0:34.7% L1:61.9% BI: 3.4%
x264 [info]: direct mvs  spatial:58.8%  temporal:41.2%
x264 [info]: coded y,uvDC,uvAC intra:74.1% 91.4% 72.2% inter:19.4% 23.0% 6.2%
x264 [info]: kb/s:1249.0
D:\Videos\Street Fighter\Championship Mode - G2\10-17-2009\sf4-2009-10-17-18-35-
20.avi is scheduled to be muxed into container as type 2.
D:\Videos\Street Fighter\Championship Mode - G2\10-17-2009\sf4-2009-10-17-18-35-
20.avi is scheduled to be muxed into container as type 1.

stanley
Site Admin
Site Admin
Posts: 4135
Joined: Mon May 15, 2006 7:43 pm
Location: Sydney

Re: Xfire videos get decoded with the wrong colorspace

Post by stanley » Mon Oct 19, 2009 11:25 pm

Please provide a downloadable sample file.
When things work together, things work.

crazedmodder
Beginner
Beginner
Posts: 5
Joined: Sat Oct 17, 2009 5:34 am

Re: Xfire videos get decoded with the wrong colorspace

Post by crazedmodder » Tue Oct 20, 2009 4:46 am

I have uploaded the sample video along with a screenshot in a zip file here:
http://www.megafileupload.com/en/file/1 ... 1-zip.html
The screenshot shows what the colors should look like.

If you would prefer me to use a different uploading site just let me know your preferred site and I will upload it there.

Thanks!

User avatar
thibeaz
Amateur
Amateur
Posts: 76
Joined: Tue May 29, 2007 2:17 am

Re: Xfire videos get decoded with the wrong colorspace

Post by thibeaz » Fri Oct 23, 2009 6:50 am

it could be the fact xfire uses their own compression codec for video that could be causing the issue

crazedmodder
Beginner
Beginner
Posts: 5
Joined: Sat Oct 17, 2009 5:34 am

Re: Xfire videos get decoded with the wrong colorspace

Post by crazedmodder » Fri Oct 23, 2009 10:39 am

I was thinking that at first but the video seems to get decoded fine (in mplayer it looks same quality as playing the file in MPC or WMP) it's just that the colors are wrong. I also thought they were inverted but they aren't, blue fireballs are coming out red and a lot of stuff on screen is coming out blue/yellow/green. I just think that maybe the codec has some weird way of setting the color and although it can be decoded by other codecs the colors get messed up because they can't find the color space information or they can't figure it out.

stanley
Site Admin
Site Admin
Posts: 4135
Joined: Mon May 15, 2006 7:43 pm
Location: Sydney

Re: Xfire videos get decoded with the wrong colorspace

Post by stanley » Fri Oct 23, 2009 7:52 pm

Try this:
Set Settings->Video Filters->Extra->Swap U and V plane to true
When things work together, things work.

crazedmodder
Beginner
Beginner
Posts: 5
Joined: Sat Oct 17, 2009 5:34 am

Re: Xfire videos get decoded with the wrong colorspace

Post by crazedmodder » Sat Oct 24, 2009 6:19 pm

stanley wrote:Try this:
Set Settings->Video Filters->Extra->Swap U and V plane to true
Excellent! It works, thank you very much.

Post Reply