PAL channels black and white

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
Vayshya
Blank Cone
Blank Cone
Posts: 14
Joined: 11 Jan 2007 12:50

PAL channels black and white

Postby Vayshya » 11 Jan 2007 14:31

With TV tuner LifeView Prime34 TV VLC shows SECAM channels normally and PAL channels as black and white. The only way to get color on PAL channels is to use WDMControl utility by hands during broadcasting. I need automatic way to get color PAL channels.
For example make :norm=pal parameter work.

pseudo555
Blank Cone
Blank Cone
Posts: 27
Joined: 09 Jul 2004 19:05
VLC version: from 0.8.6 to 3.0
Operating System: win 10

Postby pseudo555 » 14 Jan 2007 00:02

Same problem as above, I need the pal L format to have the color. :?

Vayshya
Blank Cone
Blank Cone
Posts: 14
Joined: 11 Jan 2007 12:50

Postby Vayshya » 18 Jan 2007 08:21

May be I can look how Windows Media Encoder do it and change vlc to do the same.

Vayshya
Blank Cone
Blank Cone
Posts: 14
Joined: 11 Jan 2007 12:50

Postby Vayshya » 19 Jan 2007 13:09

Here is information needed to set PAL standard when capturing from TV tuner. Where inside vlc I have to change DirectShow graph to make parameter :norm=pal work in Windows?

WDM Video Capture Filter

IAMAnalogVideoDecoder Interface

IAMAnalogVideoDecoder::put_TVFormat Method

AnalogVideoStandard Enumeration
typedef enum
{
AnalogVideo_None = 0x00000000
AnalogVideo_NTSC_M = 0x00000001,
AnalogVideo_NTSC_M_J = 0x00000002,
AnalogVideo_NTSC_433 = 0x00000004,
AnalogVideo_PAL_B = 0x00000010,
AnalogVideo_PAL_D = 0x00000020,
AnalogVideo_PAL_H = 0x00000080,
AnalogVideo_PAL_I = 0x00000100,
AnalogVideo_PAL_M = 0x00000200,
AnalogVideo_PAL_N = 0x00000400,
AnalogVideo_PAL_60 = 0x00000800,
AnalogVideo_SECAM_B = 0x00001000,
AnalogVideo_SECAM_D = 0x00002000,
AnalogVideo_SECAM_G = 0x00004000,
AnalogVideo_SECAM_H = 0x00008000,
AnalogVideo_SECAM_K = 0x00010000,
AnalogVideo_SECAM_K1 = 0x00020000,
AnalogVideo_SECAM_L = 0x00040000,
AnalogVideo_SECAM_L1 = 0x00080000,
AnalogVideo_PAL_N_COMBO = 0x00100000
} AnalogVideoStandard;

pseudo555
Blank Cone
Blank Cone
Posts: 27
Joined: 09 Jul 2004 19:05
VLC version: from 0.8.6 to 3.0
Operating System: win 10

Postby pseudo555 » 19 Jan 2007 19:13

A friend of mine found the solution :
He creates a *.m3u which contains :

Code: Select all

#EXTM3U #EXTVLCOPT:dshow-vdev=Pinnacle WDM PCTV Video Capture #EXTVLCOPT:dshow-adev=Realtek AC97 Audio #EXTVLCOPT:dshow-size= dshow://
It works perfectly !

I use the composite input of my tuner card. :wink:

DJ
Cone Master
Cone Master
Posts: 8206
Joined: 01 Jan 2006 04:30
Location: Koloa, Hawaii USA

Postby DJ » 19 Jan 2007 19:22

It should be the country code you need.

It could also be that the Chroma value is not correct for your card.

I believe these are all of the Chroma formats:

I420
I411
I422
YUYV
UYVY
RV24
RV32
I42N
I41N
GRAW

RV24 and RV32 seem to be common for raw video.

Vayshya
Blank Cone
Blank Cone
Posts: 14
Joined: 11 Jan 2007 12:50

Postby Vayshya » 20 Jan 2007 07:12

Playlist opend TV tuner as usual, nothing changed.
Country code is exactly what I need because it does the same as AMAnalogVideoDecoder::put_TVFormat method.
Problem is vlc ignores country code. :dshow-tuner-country=48 (Poland, default video standard PAL) does nothing.
When I set regional standards in Windows to Poland, vlc still opens PAL channels as SECAM somehow.
Have somebody been ever able to open PAL channels in color with vlc?

Vayshya
Blank Cone
Blank Cone
Posts: 14
Joined: 11 Jan 2007 12:50

Postby Vayshya » 23 Jan 2007 14:36

I have studied DirectShow filter wich VLC uses to tune TV tuner. Swiched channels directly from running graph. VLC always has SECAM standard for all channels. I have set PAL standard straight in filter by built-id DirectShow method and it works.
I need parameter in VLC witch will apply put_TVFormat method to filter of TV tuner, something like "dshow-tvformat:".

In this topic implementation of VLC DirectShow parameters has been discussed.
viewtopic.php?t=5890

There IAMTVTuner interface is used in dshow.cpp. To set TV standard, IAMAnalogVideoDecoder interface and it's method put_TVFormat needed.
Something like this.

#define TVSTANDARD_TEXT N_("TV standard selection")
#define TVSTANDARD_LONGTEXT N_( \
"You can select TV standard that will be used by the DirectShow plugin." )

add_integer( "dshow-tvstandard", 1, NULL, TVSTANDARD_TEXT, TVSTANDARD_LONGTEXT,
VLC_TRUE );

var_Create( p_this, "dshow-tvstandard", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );


int i_tvstandard;


i_tvstandard = var_GetInteger( p_this, "dshow-tvstandard" );

msg_Dbg( p_this, "Config tvstandard: %i",
i_tvstandard );

IAMAnalogVideoDecoder *p_TV2 = NULL;

hr = p_capture_graph->FindInterface( &PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Interleaved,
p_device_filter,
IID_IAMAnalogVideoDecoder, (void **)&p_TV2 );

hr = p_TV2->put_TVFormat(i_tvformat);

Vayshya
Blank Cone
Blank Cone
Posts: 14
Joined: 11 Jan 2007 12:50

Postby Vayshya » 25 Jan 2007 12:22

Here is full code for VLC 0.8.1, later I will test it and compile for 0.8.6a.

...
static void ConfigTuner( vlc_object_t *, ICaptureGraphBuilder2 *,
IBaseFilter * );

...

#define CHANNEL_TEXT N_("TV Channel selection")
#define CHANNEL_LONGTEXT N_( \
"You can select the tv channel that will be used by the DirectShow plugin." )
#define COUNTRY_TEXT N_("Country selection")
#define COUNTRY_LONGTEXT N_( \
"You can select the country that will be used by the DirectShow plugin." )
#define INPUT_TEXT N_("Input selection (Cable/Antenna)")
#define INPUT_LONGTEXT N_( \
"You can select the input that will be used by the DirectShow plugin." )

#define TVSTANDARD_TEXT N_("TV standard selection")
#define TVSTANDARD_LONGTEXT N_( \
"You can select TV standard that will be used by the DirectShow plugin." )

...

add_integer( "dshow-channel", 1, NULL, CHANNEL_TEXT, CHANNEL_LONGTEXT,
VLC_TRUE );

add_integer( "dshow-country", 1, NULL, COUNTRY_TEXT, COUNTRY_LONGTEXT,
VLC_TRUE );

add_bool( "dshow-input", VLC_FALSE, NULL, INPUT_TEXT, INPUT_LONGTEXT,
VLC_TRUE );

add_integer( "dshow-tvstandard", 1, NULL, TVSTANDARD_TEXT, TVSTANDARD_LONGTEXT,
VLC_TRUE );

...

var_Create( p_this, "dshow-channel", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_this, "dshow-country", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_this, "dshow-input", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );

var_Create( p_this, "dshow-tvstandard", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );

...

ConfigTuner( p_this, p_sys->p_capture_graph_builder2,
p_device_filter );

...

static void ConfigTuner( vlc_object_t *p_this,
ICaptureGraphBuilder2 *p_capture_graph,
IBaseFilter *p_device_filter )
{
int i_channel, i_country;
long l_modes = 0;
bool b_input;
HRESULT hr;

int i_tvstandard;

i_channel = var_GetInteger( p_this, "dshow-channel" );
i_country = var_GetInteger( p_this, "dshow-country" );
b_input = var_GetBool( p_this, "dshow-input" );

i_tvstandard = var_GetInteger( p_this, "dshow-tvstandard" );

msg_Dbg( p_this, "Config channel: %i, country: %i",
i_channel, i_country );

msg_Dbg( p_this, "Config tvstandard: %i",
i_tvstandard );

if( p_capture_graph )
{
IAMTVTuner *p_TV = NULL;
hr = p_capture_graph->FindInterface( &PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Interleaved,
p_device_filter,
IID_IAMTVTuner, (void **)&p_TV );
if( FAILED(hr) )
{
hr = p_capture_graph->FindInterface( &PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Video,
p_device_filter,
IID_IAMTVTuner,
(void **)&p_TV );
}

if( SUCCEEDED(hr) )
{

hr = p_TV->GetAvailableModes(&l_modes);
if (SUCCEEDED(hr) && (l_modes & AMTUNER_MODE_TV))
{
hr = p_TV->put_Mode(AMTUNER_MODE_TV);
}

if ( b_input )
p_TV->put_InputType( 0, TunerInputAntenna );
else
p_TV->put_InputType( 0, TunerInputCable );

p_TV->put_CountryCode( (long)i_country );
p_TV->put_Channel( (long)i_channel,
AMTUNER_SUBCHAN_NO_TUNE,
AMTUNER_SUBCHAN_NO_TUNE );
p_TV->Release();
}

IAMAnalogVideoDecoder *p_TV2 = NULL;
hr = p_capture_graph->FindInterface( &PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Interleaved,
p_device_filter,
IID_IAMAnalogVideoDecoder, (void **)&p_TV2 );
if( FAILED(hr) )
{
hr = p_capture_graph->FindInterface( &PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Video,
p_device_filter,
IID_IAMAnalogVideoDecoder,
(void **)&p_TV2 );
}
if( SUCCEEDED(hr) )
{
hr = p_TV2->put_TVFormat( (long)i_tvformat);
p_TV->Release();
}


}

}

Vayshya
Blank Cone
Blank Cone
Posts: 14
Joined: 11 Jan 2007 12:50

Postby Vayshya » 26 Jan 2007 13:42

Here are changes for VLC 0.8.6a, untested.

#define TVSTANDARD_TEXT N_("TV standard selection")
#define TVSTANDARD_LONGTEXT N_( \
"Set the tuner TV standard." )
...

add_integer( "dshow-tvstandard", 1, NULL, TVSTANDARD_TEXT,
TVSTANDARD_LONGTEXT, VLC_TRUE );

...

var_Create( p_this, "dshow-tvstandard",
VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );

...

int i_channel, i_country, i_input, i_tvstandard;

...

IAMAnalogVideoDecoder *p_TV2;

...

i_tvstandard = var_GetInteger( p_this, "dshow-tvstandard" );

...

msg_Dbg( p_this, "tuner config: channel %i, country %i, input type %i, TV standard %i",
i_channel, i_country, i_input, i_tvstandard );

...

hr = p_capture_graph->FindInterface( &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Interleaved,
p_device_filter, IID_IAMAnalogVideoDecoder,
(void **)&p_TV2 );
if( FAILED(hr) )
{
hr = p_capture_graph->FindInterface( &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,
p_device_filter, IID_IAMAnalogVideoDecoder,
(void **)&p_TV2 );
}
if( FAILED(hr) )
{
msg_Dbg( p_this, "couldn't find tuner IAMAnalogVideoDecoder interface" );
return;
}
if( SUCCEEDED(hr) )
{
hr = p_TV2->put_TVFormat( i_tvformat );
}
p_TV2->Release();

Vayshya
Blank Cone
Blank Cone
Posts: 14
Joined: 11 Jan 2007 12:50

Postby Vayshya » 27 Jan 2007 09:44

Country code works if first opened channel has PAL standard and after switching to another channel by external utilities. This is partial workaround for the problem. After start with parameters :dshow-tuner-country=48 :dshow-tuner-channel = X ( country 48 has PAL standard by default and X channel in PAL standard ) user see black and white picture but after switching to any another channel he get evercolor channels.
So due to DirectShow, TV tuner driver or device TV standard being applied only if current channel is in this format and country code being applied only after switching channels during capturing.

IAMAnalogVideoDecoder::put_TVFormat Method works immediatly without swtching channels so it must completly solve the problem.

I havn't been able to compile 0.8.6a source, may be due to changes in Cygwin. I will try latest nightly.

Vayshya
Blank Cone
Blank Cone
Posts: 14
Joined: 11 Jan 2007 12:50

Postby Vayshya » 30 Jan 2007 13:27

Here are changes for one of the latests nightlies.

filter.cpp

const GUID IID_IAMAnalogVideoDecoder = {0xC6E13350, 0x30AC, 0x11d0, {0xA1, 0x8C, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56}};

dshow.cpp

#define TVSTANDARD_TEXT N_("TV standard selection")
#define TVSTANDARD_LONGTEXT N_( \
"Set the tuner TV standard." )

add_integer( "dshow-tvstandard", 0, NULL, TVSTANDARD_TEXT,
TVSTANDARD_LONGTEXT, VLC_TRUE );

var_Create( p_this, "dshow-tvstandard",
VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );

int i_channel, i_country, i_input, i_amtuner_mode, i_tvstandard;

IAMAnalogVideoDecoder *p_TV2;

i_tvstandard = var_GetInteger( p_this, "dshow-tvstandard" );

if( !i_channel && !i_country && !i_input && !i_amtuner_mode && !i_tvstandard ) return; /* Nothing to do */

msg_Dbg( p_this, "tuner config: channel %i, country %i, input type %i, tuner mode %i, TV standard %i",
i_channel, i_country, i_input, i_amtuner_mode, i_tvstandard);

hr = p_graph->FindInterface( &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Interleaved,
p_device_filter, IID_IAMAnalogVideoDecoder,
(void **)&p_TV2 );
if( FAILED(hr) )
{
hr = p_graph->FindInterface( &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,
p_device_filter, IID_IAMAnalogVideoDecoder,
(void **)&p_TV2 );
}
if( FAILED(hr) )
{
hr = p_graph->FindInterface( &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Stream,
p_device_filter, IID_IAMAnalogVideoDecoder,
(void **)&p_TV2 );
}

if( FAILED(hr) )
{
msg_Dbg( p_this, "couldn't find tuner IAMAnalogVideoDecoder interface" );
return;
}
if( SUCCEEDED(hr) )
{
hr = p_TV2->put_TVFormat( i_tvstandard );
}
p_TV2->Release();

It was compiled successfully. Later I'll test it.

Vayshya
Blank Cone
Blank Cone
Posts: 14
Joined: 11 Jan 2007 12:50

Postby Vayshya » 01 Feb 2007 07:54

Code itself works but put_tvformat method succeeds only when being applied on working graph. If applied during setting up graph it has no effect. So separate function needed which will search for correct interface and call put_tvformat method. It must be called after starting capturing somewhere in the code.


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 91 guests