Old 28th January 2011, 00:29   #1
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,140
New Vp8 coder. v-0.9.5

Hey guys, the camjo was re-released with a couple small updates and most importantly, a new build of the vp8 codec.

more info here.

http://www.thebitstream.com/?p=250

Also, added the first round of icecast server mount support. If you use nsv output , name the mount '*.nsv' or winamp will not play it as nsv. The icecast module also outputs plain audio. No title change action yet.
Smelter is offline   Reply With Quote
Old 29th January 2011, 14:25   #2
streamer45
Member
 
Join Date: Jul 2006
Location: Italy
Posts: 93
Nice job Smelter
streamer45 is offline   Reply With Quote
Old 29th January 2011, 15:57   #3
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,140
Hey, thx

btw streamer45, Your red5 app was rebuilt and works mucho better.

hit me on skype.
Smelter is offline   Reply With Quote
Old 8th February 2011, 19:18   #4
sigma_sigma
Member
 
sigma_sigma's Avatar
 
Join Date: Dec 2004
Location: Bucharest
Posts: 77
Send a message via Yahoo to sigma_sigma
Well, vp8 codec can be used with nsvcap thanks to nsv_coder_vp8.dll. I haven't tested yet but I think old nsvcap (from NSVtools_repack.exe) can broadcast via shoutcast without problems. I don't know what Vidcast.exe can do, looks to be a similar application like nsvcap. Unfortunately I don't have any camera in this PC to make some tests right now. The old vp62 encoder did his job several years, we hope that vp8 has a better image quality at the same video bitrate comparing with vp62. I'm using it since 2004 after I have discovered the solution here on winamp forums.
We are waiting also a brand new version of NSVTOOLS, that one i'm using is the last build ever made, pls correct me if I'm wrong.
Also in these years I couldn't find a proper solution to put the streaming in a web page.
As far as I know, the only one player is Rava's made by AOL who can connect to a shoutcast server which is broadcasting vp62 content but is working with IE only without support for firefox or other browsers. Somebody told me that there is also a flash solution, never found it, never saw a live stream example in a web page (swf) somewhere.
I've read also about red5 but i don't understand exactly what it does and seems to run under linux only http://red5.org/wiki/Install
Anyway I was curios about this new vp8 codec and for a solution to mount a shoutcast stream into a web page power by a flash solution (even for vp62 if it works will be outstanding).
My previous post here was several years ago so if I'll make this post into a wrong section please accept my apologies.
sigma_sigma is offline   Reply With Quote
Old 8th February 2011, 21:41   #5
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,140
Quote:
Originally Posted by sigma_sigma View Post
Well, vp8 codec can be used with nsvcap thanks to nsv_coder_vp8.dll.
Dont just thank me, Thank winamp for adding native support so no special dll are needed to watch.




Quote:
I haven't tested yet but I think old nsvcap (from NSVtools_repack.exe) can broadcast via shoutcast without problems.
Yes and is quite stable if you are satisfied with that solution and limited resolution and DV support.
Quote:
We are waiting also a brand new version of NSVTOOLS, that one i'm using is the last build ever made, pls correct me if I'm wrong.
There are no NSVTools forthcoming from AOL/Winamp. Winamp will point to my encoder for NSV video encoding and broadcasting when I feel it is stable enough.

Quote:
Also in these years I couldn't find a proper solution to put the streaming in a web page.
As far as I know, the only one player is Rava's made by AOL who can connect to a shoutcast server which is broadcasting vp62 content but is working with IE only without support for firefox or other browsers. Somebody told me that there is also a flash solution, never found it, never saw a live stream example in a web page (swf) somewhere.
I've read also about red5 but i don't understand exactly what it does and seems to run under linux only http://red5.org/wiki/Install
Red5 runs on windows and linux, and provides flash playback of NSV.
Quote:
Anyway I was curios about this new vp8 codec and for a solution to mount a shoutcast stream into a web page power by a flash solution (even for vp62 if it works will be outstanding).
My previous post here was several years ago so if I'll make this post into a wrong section please accept my apologies.
Here is flash player that connects to shoutcast server and even supports AACp and H264.

http://thundersnow.thebitstream.com/player/
Smelter is offline   Reply With Quote
Old 11th February 2011, 21:18   #6
sigma_sigma
Member
 
sigma_sigma's Avatar
 
Join Date: Dec 2004
Location: Bucharest
Posts: 77
Send a message via Yahoo to sigma_sigma
Thanks so much. I've tried vp8 under nsvtools and is working very nice via shoutcast. Very interesting latest verion of camjo but is working only with icecast. After the transmission is started camjo can connect to icecast but unfortunately winamp client not. I wasn't able to connect to the stream with winamp using the standard url like http://server_ip:8000;stream.nsv, nothing happens.....is trying to connect for ~one second and suddenly gives up.
Any solutions? Thanks in advance!
sigma_sigma is offline   Reply With Quote
Old 12th February 2011, 15:03   #7
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,140
sorry, My fault. I broke it.

Ill fix it soon,
Smelter is offline   Reply With Quote
Old 16th February 2011, 19:48   #8
sigma_sigma
Member
 
sigma_sigma's Avatar
 
Join Date: Dec 2004
Location: Bucharest
Posts: 77
Send a message via Yahoo to sigma_sigma
We are waiting the new version, nice work Smelter!
sigma_sigma is offline   Reply With Quote
Old 24th February 2011, 23:41   #9
oLRi
Member
 
Join Date: May 2008
Posts: 94
Will your red5 app oder thundersnow support vp8?
oLRi is offline   Reply With Quote
Old 25th February 2011, 02:18   #10
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,140
no until I get the alchemy version or create the alchemy version myself. cygwin anyone?
Smelter is offline   Reply With Quote
Old 25th February 2011, 09:37   #11
oLRi
Member
 
Join Date: May 2008
Posts: 94
Quote:
Originally Posted by Smelter View Post
cygwin anyone?
I do.

I tried also to create a vp8 coder dll by myself. Tried it with the samples from the nsv sdk, can you post the visual studio source from your coder dll?

Played arround with your vp8 coder dll...found some "bugs":
- VLC plays VP8 Stream but the picture is 180° inverted
- ffmpeg can't decode an vp8 nsv stream, error messge: Invalid (unknown) pixel format

Last edited by oLRi; 25th February 2011 at 12:29.
oLRi is offline   Reply With Quote
Old 26th February 2011, 16:11   #12
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,140
http://comserver.googlecode.com/svn/.../comDemo/coder

Extract the the codec source from http://www.webmproject.org/tools/vp8-sdk/ to the 'includes' directory.

Configure the project settings to the correct includes.

On your flipping.... So then, you'll have to flip/unflip the image output, which is unflipped I think, and set/unset the coder_dll flip flag. Winamp is not flipped at this time, so flip the output and toggle the flip flag. Winamp will still be right side up then.

Also check versions. 'Flip' shouldn't change between versions, but output can look funny. This was 9.5 from january.
Smelter is offline   Reply With Quote
Old 28th February 2011, 12:54   #13
oLRi
Member
 
Join Date: May 2008
Posts: 94
Sooooooo.....

I changed:
code:
RGBtoYUV420PSameSize((const unsigned char *)in,raw.img_data,4,0,cfg.g_w,cfg.g_h);

to:
code:
RGBtoYUV420PSameSize((const unsigned char *)in,raw.img_data,4,1,cfg.g_w,cfg.g_h);

the 1/0 is the toggle for flipping.

When i use a coder.dll with this settings my VLC Stream is correct, but now my winamp stream is fliped.

But i think i am missing this:
Quote:
so flip the output
how can i do this?
oLRi is offline   Reply With Quote
Old 28th February 2011, 14:23   #14
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,140
Oh shit, you're right! the flip flag is in the decoder, and that is now built in to winamp core!


We can ask winamp team to flip nsv video for vp8 and It would probably be in the next release
Smelter is offline   Reply With Quote
Old 28th February 2011, 14:33   #15
oLRi
Member
 
Join Date: May 2008
Posts: 94
So there is no possibility to compile a coder.dll with vp8 which has a "normal" picture in vlc (and other clients) AND winamp at the same time?

So the only thing i can do is build a dll for "winamp viewers" and "other viewers"?
oLRi is offline   Reply With Quote
Old 28th February 2011, 14:46   #16
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,140
No, the winamp team is very cool about responding to this kind of thing.

It will just be till the next release likely.
Smelter is offline   Reply With Quote
Old 28th February 2011, 15:00   #17
oLRi
Member
 
Join Date: May 2008
Posts: 94
There is something other i'm playing with at this time:
watermarking.

I thought i can't be that hard to implement a watermark with a custom dll.

in this function
RGBtoYUV420PSameSize
you have 'rgb' which is the rgbpicture of each frame, right?
So i must be easily possible to modify each frame...any ideas about that?
oLRi is offline   Reply With Quote
Old 28th February 2011, 16:07   #18
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,140
The easy way is to load the rgb bits of another and blend them.

code:

void AlphaBlender2(char *pBits, char* m_pCheckers)
{ // the incoming source
//
RGBQUAD * pSource = (RGBQUAD*) pBits;

// the checkerboard buffer
//
RGBQUAD * pCheckers = (RGBQUAD*) m_pCheckers;
// blend them
//
for( int x = 0 ; x < 320 * 240 ; x++ )
{
if( pCheckers->rgbReserved)
{
RGBQUAD d;
d.rgbRed = (BYTE) (pSource->rgbRed * pSource->rgbReserved / 256 +
pCheckers->rgbRed * ( 256 - pSource->rgbReserved ) / 256);

d.rgbGreen = (BYTE) (pSource->rgbGreen * pSource->rgbReserved / 256 +
pCheckers->rgbGreen * ( 256 - pSource->rgbReserved ) / 256);

d.rgbBlue = (BYTE) (pSource->rgbBlue * pSource->rgbReserved / 256 +
pCheckers->rgbBlue * ( 256 - pSource->rgbReserved ) / 256);

d.rgbReserved= pCheckers->rgbReserved;
*pCheckers = d;
}
pSource++;
pCheckers++;
}
}





The harder but easier way( go figure...) is with device context.


code:


#include "stdafx.h"
#pragma once
#include "streams.h"
#include "stdio.h"
#include <tchar.h>
#include "CAutoDC.h"
#include<iostream>
using namespace std;

char *CAutoDC::Translate(char * Main ,char *pBuffer)
{
//Clear DC paintbuffer
PatBlt(m_dcPaint,0,0,320,240,BLACKNESS);

//Copy Sample to DC paintbuffer
CopyMemory(m_pPaintBuffer,pBuffer,307200);
//Set up Blend function
StretchBlt(m_dcPaint2,0,239,320,-240,m_dcPaint,0,0,320,240,SRCCOPY);
CopyMemory(Main,m_pPaintBuffer2,abs(m_bmpInfo.bmiHeader.biWidth*m_bmpInfo.bmiHeader.biHeight*m_bmpInfo.bmiHeader.biBitCount/8));
return Main;
}
void CAutoDC::GetColor1(RGBQUAD *pQuad1)
{
CAutoLock lock(&cSharedState);
*pQuad1=tColor;
return ;
}
void CAutoDC::GetColor2(RGBQUAD *pQuad2)
{
CAutoLock lock(&cSharedState);
*pQuad2=t2Color;
return ;
}
void CAutoDC::GetAlpha1( BYTE * Alpha1)
{
CAutoLock lock(&cSharedState);
*Alpha1=alpha;
return;
}
void CAutoDC::GetAlpha2( BYTE * Alpha2)
{
CAutoLock lock(&cSharedState);
*Alpha2=alpha2;
return;
}
void CAutoDC::SetColor2 (RGBQUAD *pQuad2)
{//State changing method
CAutoLock lock(&cSharedState);
t2Color=*pQuad2;
}
void CAutoDC::SetColor1 (RGBQUAD *pQuad1)
{//State changing method
CAutoLock lock(&cSharedState);
tColor=*pQuad1;
}
void CAutoDC::SetAlpha2 (BYTE * pAlpha2)
{//State changing method
CAutoLock lock(&cSharedState);
alpha2=*pAlpha2;
}
void CAutoDC::SetAlpha1 (BYTE * pAlpha1)
{//State changing method
CAutoLock lock(&cSharedState);
alpha=*pAlpha1;
}
void *CAutoDC::Logo (void* Main, void* Pip)
{//Streaming method
CAutoLock lock(&cSharedState);
//Picture in Picture
//Clear DC paintbuffer
PatBlt(m_dcPaint,0,0,m_bmpInfo.bmiHeader.biWidth,m_bmpInfo.bmiHeader.biHeight,BLACKNESS);
PatBlt(m_dcPaint2,0,0,m_bmpInfo.bmiHeader.biWidth,m_bmpInfo.bmiHeader.biHeight,BLACKNESS);
//Copy Sample to DC paintbuffer
CopyMemory(m_pPaintBuffer,Main,CSAMP);
CopyMemory(m_pPaintBuffer2,Pip,CSAMP);
//Set up Blend function
BLENDFUNCTION blend;
blend.BlendOp =AC_SRC_OVER;
blend.BlendFlags =0;
blend.SourceConstantAlpha =alpha;

AlphaBlend(m_dcPaint,140,110,160,120,m_dcPaint2,0,0,320,240,blend);
CopyMemory(Main,m_pPaintBuffer,CSAMP);
return Main;
}

void *CAutoDC::Pip (void* Main, void* Pip)
{//Streaming method

//Picture in Picture
//Clear DC paintbuffer
PatBlt(m_dcPaint,0,0,m_bmpInfo.bmiHeader.biWidth,m_bmpInfo.bmiHeader.biHeight,BLACKNESS);
PatBlt(m_dcPaint2,0,0,m_bmpInfo.bmiHeader.biWidth,m_bmpInfo.bmiHeader.biHeight,BLACKNESS);
//Copy Sample to DC paintbuffer
CopyMemory(m_pPaintBuffer,Main,CSAMP);
CopyMemory(m_pPaintBuffer2,Pip,CSAMP);
//Set up Blend function
BLENDFUNCTION blend;
blend.BlendOp =AC_SRC_OVER;
blend.BlendFlags =0;
blend.SourceConstantAlpha =alpha;

AlphaBlend(m_dcPaint,140,110,160,120,m_dcPaint2,0,0,320,240,blend);
CopyMemory(Main,m_pPaintBuffer,CSAMP);
return Main;
}
void *CAutoDC::PipRect (void* Main, void* Pip, BLTRECT *Rect, int Alpha)
{//Streaming method

//Picture in Picture
//Clear DC paintbuffer
PatBlt(m_dcPaint,0,0,m_bmpInfo.bmiHeader.biWidth,m_bmpInfo.bmiHeader.biHeight,BLACKNESS);
PatBlt(m_dcPaint2,0,0,m_bmpInfo.bmiHeader.biWidth,m_bmpInfo.bmiHeader.biHeight,BLACKNESS);
//Copy Sample to DC paintbuffer
CopyMemory(m_pPaintBuffer,Main,CSAMP);
CopyMemory(m_pPaintBuffer2,Pip,CSAMP);
//Set up Blend function
BLENDFUNCTION blend;
blend.BlendOp =AC_SRC_OVER;
blend.BlendFlags =0;
blend.SourceConstantAlpha =Alpha;

AlphaBlend(m_dcPaint,Rect->Left ,Rect->Top ,Rect->Width ,Rect->Height ,m_dcPaint2,0,0,320,240,blend);
CopyMemory(Main,m_pPaintBuffer,CSAMP);
return Main;
}


void CAutoDC::TextSample (void * pBuffer,char * text)
{//Streaming method
CAutoLock lock(&cSharedState);
//Clear DC paintbuffer
PatBlt(m_dcPaint,0,0,m_bmpInfo.bmiHeader.biWidth,m_bmpInfo.bmiHeader.biHeight,BLACKNESS);
//Copy Sample to DC paintbuffer
CopyMemory(m_pPaintBuffer,pBuffer,CSAMP);
CHAR szText[256];
sprintf( szText,text);
//Text background color
SetBkMode(m_dcPaint,TRANSPARENT);
SetTextColor(m_dcPaint,RGB(0 ,0 ,0 ));
//Do the text
if( !TextOut( m_dcPaint, (m_bmpInfo.bmiHeader.biWidth/2-((strlen(text)/2)*8))+1, m_bmpInfo.bmiHeader.biHeight-19, szText,_tcslen( szText ) ) )
return ;
// Text Color

//SetTextColor(m_dcPaint,(COLORREF)tColor);
SetTextColor(m_dcPaint,RGB(t2Color.rgbRed ,t2Color.rgbGreen ,t2Color.rgbBlue ));

//Do the text
if( !TextOut( m_dcPaint, (m_bmpInfo.bmiHeader.biWidth/2-((strlen(text)/2)*8)), m_bmpInfo.bmiHeader.biHeight-20, szText,_tcslen( szText ) ) )
return ;
//Copy sample back to original buffer
CopyMemory(pBuffer,m_pPaintBuffer,CSAMP);
}
void CAutoDC::TextSample (void * pBuffer,char * text, int Linenum)
{//Streaming method
CAutoLock lock(&cSharedState);
Linenum++;
//Clear DC paintbuffer
PatBlt(m_dcPaint,0,0,m_bmpInfo.bmiHeader.biWidth,m_bmpInfo.bmiHeader.biHeight,BLACKNESS);
//Copy Sample to DC paintbuffer
CopyMemory(m_pPaintBuffer,pBuffer,CSAMP);
CHAR szText[256];
sprintf( szText,text);
//Text background color
SetBkMode(m_dcPaint,TRANSPARENT);
// Text Color
SetTextColor(m_dcPaint,RGB(0 ,0 ,0 ));
//Do the text
if( !TextOut( m_dcPaint, 4, (((m_bmpInfo.bmiHeader.biHeight-18)/12) * Linenum)-19, szText,_tcslen( szText ) ) )
return ;
//SetTextColor(m_dcPaint,(COLORREF)tColor);
SetTextColor(m_dcPaint,RGB(tColor.rgbRed ,tColor.rgbGreen ,tColor.rgbBlue));
//Do the text
if( !TextOut( m_dcPaint, 3, (((m_bmpInfo.bmiHeader.biHeight-20)/12) * Linenum)-20, szText,_tcslen( szText ) ) )
return ;
//Copy sample back to original buffer
CopyMemory(pBuffer,m_pPaintBuffer,CSAMP);
}
void CAutoDC::MakeMediaType()
{
ZeroMemory(pMediaType, sizeof(CMediaType));
VIDEOINFO *pvi = (VIDEOINFO *)pMediaType->AllocFormatBuffer(sizeof(VIDEOINFO));
if (NULL == pvi)
return ;//E_OUTOFMEMORY;

ZeroMemory(pvi, sizeof(VIDEOINFO));

pvi->bmiHeader.biCompression = BI_RGB;
pvi->bmiHeader.biBitCount = 32;
pvi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
pvi->bmiHeader.biWidth = 320;
pvi->bmiHeader.biHeight = 240;
pvi->bmiHeader.biPlanes = 1;
pvi->bmiHeader.biSizeImage = GetBitmapSize(&pvi->bmiHeader);
pvi->bmiHeader.biClrImportant = 0;

SetRectEmpty(&(pvi->rcSource)); // we want the whole image area rendered.
SetRectEmpty(&(pvi->rcTarget)); // no particular destination rectangle

pMediaType->SetType(&MEDIATYPE_Video);
pMediaType->SetFormatType(&FORMAT_VideoInfo);
pMediaType->SetTemporalCompression(FALSE);

const GUID SubTypeGUID = GetBitmapSubtype(&pvi->bmiHeader);
pMediaType->SetSubtype(&MEDIASUBTYPE_RGB32);
pMediaType->SetSampleSize(pvi->bmiHeader.biSizeImage);

m_bmpInfo.bmiHeader = pvi->bmiHeader;
m_bmpInfo2.bmiHeader = pvi->bmiHeader;

return ;
}
void CAutoDC::MakeDC()
{
HBITMAP hDibSection = CreateDIBSection(NULL, (BITMAPINFO *) &m_bmpInfo, DIB_RGB_COLORS,&m_pPaintBuffer, NULL, 0);
HBITMAP hDibSection2 = CreateDIBSection(NULL, (BITMAPINFO *) &m_bmpInfo2, DIB_RGB_COLORS,&m_pPaintBuffer2, NULL, 0);

HDC hDC = GetDC(NULL);

m_dcPaint = CreateCompatibleDC(hDC);
m_dcPaint2 = CreateCompatibleDC(hDC);

SetMapMode(m_dcPaint, GetMapMode(hDC));
SetMapMode(m_dcPaint2, GetMapMode(hDC));

HGDIOBJ OldObject = SelectObject(m_dcPaint,hDibSection);
HGDIOBJ OldObject2 = SelectObject(m_dcPaint2,hDibSection2);
}
CAutoDC::CAutoDC()
{
CAutoLock lock(&cSharedState);
alpha=0;
alpha2=0;
pMediaType= new CMediaType;
this->MakeMediaType ();
this->MakeDC ();
t2Color.rgbBlue =t2Color.rgbGreen =t2Color.rgbRed =255;
tColor.rgbBlue =255;
tColor.rgbGreen =255;
tColor.rgbRed=255;
tColor.rgbReserved =0;
t2Color.rgbReserved =0;
}
CAutoDC::~CAutoDC()
{
DeleteDC(m_dcPaint);
DeleteDC(m_dcPaint2);

}




Smelter is offline   Reply With Quote
Old 4th March 2011, 02:21   #19
oLRi
Member
 
Join Date: May 2008
Posts: 94
Hmm..

And how do i parse a bmp file from filesystem to a rgbquad array?
oLRi is offline   Reply With Quote
Old 4th March 2011, 04:28   #20
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,140
code:

#pragma once
#include"stdafx.h"


class CBitmapHandler
{
private:

char * buffer;
public:
int width,height,depth;
CBitmapHandler(void)
{
buffer=NULL;
depth=32;

}

int getSize()
{
return width*height*(depth/8);
}
char * getBits()
{
return buffer;
}
int readBitmap(char * path)
{
HANDLE m_hFile = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);

if (m_hFile == INVALID_HANDLE_VALUE)
return -1;

DWORD dwFileSize = GetFileSize(m_hFile, NULL);
if (dwFileSize == INVALID_FILE_SIZE)
return -1;
BYTE* m_pFile = new BYTE[dwFileSize];
DWORD nBytesRead = 0;
if(!ReadFile(m_hFile, m_pFile, dwFileSize, &nBytesRead, NULL))
{
return -1;
}
int cbFileHeader = sizeof(BITMAPFILEHEADER);
BITMAPFILEHEADER *pBm = (BITMAPFILEHEADER*)m_pFile;

int m_cbBitmapInfo = pBm->bfOffBits - cbFileHeader;

BITMAPINFO* m_pBmi = (BITMAPINFO*)(m_pFile + cbFileHeader);
height=m_pBmi->bmiHeader.biHeight;
width=m_pBmi->bmiHeader.biWidth;
depth=m_pBmi->bmiHeader.biBitCount;


if(buffer)
delete[] buffer;

buffer=new char[height * width * 4];

char * dataSrc=(char *) m_pFile + cbFileHeader + m_cbBitmapInfo;
char * dataDst=(char *) buffer;


for(int kk=0;kk< width * height ; kk++)
{


if(depth==32)
{
*dataDst++=*dataSrc++;
*dataDst++=*dataSrc++;
*dataDst++=*dataSrc++;
*dataDst++=*dataSrc++;
}
else if(depth==24)
{
*dataDst++=*dataSrc++;
*dataDst++=*dataSrc++;
*dataDst++=*dataSrc++;
*dataDst++=0xFF;
}else
{
return -1;
}



}

CloseHandle(m_hFile);

m_hFile = INVALID_HANDLE_VALUE;


return 1;

}

void makeBitmap(char * name, int Width,int Height,int bitCount,void * pBuffer,int BufferSize)
{
TCHAR szFilename[MAX_PATH];
wsprintf(szFilename, TEXT("%s\0"),name);

HANDLE hf = CreateFile(szFilename, GENERIC_WRITE, FILE_SHARE_READ,
NULL, CREATE_ALWAYS, NULL, NULL );

BITMAPFILEHEADER bfh;
memset( &bfh, 0, sizeof( bfh ) );
bfh.bfType = 'MB';
bfh.bfSize = sizeof( bfh ) + BufferSize + sizeof( BITMAPINFOHEADER );
bfh.bfOffBits = sizeof( BITMAPINFOHEADER ) + sizeof( BITMAPFILEHEADER );

DWORD Written = 0;
WriteFile( hf, &bfh, sizeof( bfh ), &Written, NULL );

BITMAPINFOHEADER bih;
memset( &bih, 0, sizeof( bih ) );
bih.biSize = sizeof( bih );
bih.biWidth = Width;
bih.biHeight = Height;
bih.biPlanes = 1;
bih.biBitCount = bitCount;
bih.biSizeImage=Width*Height*bitCount/8;
bih.biCompression=0;
bih.biClrImportant=0;

Written = 0;
WriteFile( hf, &bih, sizeof( bih ), &Written, NULL );

// Write the bitmap bits
//
Written = 0;
WriteFile( hf, pBuffer, BufferSize, &Written, NULL );

CloseHandle( hf );





}

~CBitmapHandler(void)
{
if(buffer)
delete[] buffer;
}
};




Smelter is offline   Reply With Quote
Old 4th March 2011, 12:41   #21
oLRi
Member
 
Join Date: May 2008
Posts: 94
Hmm

I've made a test file, i opens 2 bmp's and gets the bits. this works, but if i use your alphablend function my application crashes...

here's the code:
http://pastebin.com/VZrLhVm0

i think it has something todo with the pointers, i'm very new to c
oLRi is offline   Reply With Quote
Old 4th March 2011, 14:18   #22
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,140
probably not the same size as the movie.
Smelter is offline   Reply With Quote
Old 9th March 2011, 16:11   #23
oLRi
Member
 
Join Date: May 2008
Posts: 94
Quote:
Originally Posted by Smelter View Post
The easy way is to load the rgb bits of another and blend them.

code:

d.rgbRed = (BYTE) (pSource->rgbRed * pSource->rgbReserved / 256 +
pCheckers->rgbRed * ( 256 - pSource->rgbReserved ) / 256);

According to:
http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx

"rgbReserved" can only be 0? But this makes no sense because it would ALWAYS mean:

(pSource->rgbRed * 0 / 256 + pCheckers->rgbRed * ( 256 - 0 ) / 256);
which would be:
(0 / 256 + pCheckers->rgbRed * 256 / 256);
which is:
(0 + pCheckers->rgbRed);
which is:
(pCheckers->rgbRed);
oLRi is offline   Reply With Quote
Old 9th March 2011, 22:41   #24
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,140
yes it is zero typically where the media type is 24 bits per pixel, and the whole frame work supports systems that can only access a full word. At the pixel level it is the 'quad'. at the pixel row level it is the 'image stride'.

'reserved' was 'reserved' for any 32bit pixel type even where the reserved byte data does not translate to visual 'alpha'

The 'reserved' byte could hold any data related to the pixel.

The 'must be zero' key 'must be zero' where you are only sending 24bits of color to a machine that it is unknown what Endian it is. Your RGBQuads are handled in the same system, and only to shuffle the pointed values. Clearly your render pipeline requests ARGB pixels, which are 32bits packed. You can create your own class handler to handle the pointers.

You should also look at the 32bit alpha media type from the directshow samples.
Smelter is offline   Reply With Quote
Old 9th March 2011, 22:47   #25
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,140
If a PC sends 24bit pixels to a MAC, the 32bit word must have the reserved byte as zero so the MAC can determine what 8 bits is blue, then swap.

'must be zero' would not apply to 32 bit alpha image, and really only apply in an windows function that explicitly takes a RGBQuad as a parameter, and even then, 'must be zero' I think was auto inserted any time a developer left a parameter undocumented , as in the case of future media types.
Smelter is offline   Reply With Quote
Old 4th September 2011, 17:59   #26
MrX_1980
Senior Member
 
Join Date: Mar 2003
Location: Germany - NRW
Posts: 109
Send a message via ICQ to MrX_1980
Hello

The VP8 v0.9.7 "Cayuga" is out since about one month ago (2011-08-02).

The changelog sounds nice:
http://www.webmproject.org/tools/vp8-sdk/changelog.html
http://blog.webmproject.org/2011/08/...-released.html

I hope we will see with this release more VP8 Shoutcast TV streams if Winamp supports it.
MrX_1980 is offline   Reply With Quote
Old 13th September 2011, 02:17   #27
Jeeper One
Major Dude
 
Jeeper One's Avatar
 
Join Date: May 2003
Location: Denver, Colorado
Posts: 1,056
Your site seems to be under maintenance Smelter but this has me intrigued now.....

In fact, I just may take those videos that can't be streamed elsewhere (You know THOSE videos ) & put them on SHOUTcast TV (If only AOHell would re-add the SHOUTcast TV YP > )

Cheers

Pat Cook
Englewood, CO
Jeeper One is offline   Reply With Quote
Old 19th January 2012, 18:31   #28
pythy
Junior Member
 
Join Date: Apr 2008
Posts: 1
I have compiled a new "nsv_coder_vp8.dll" based on VP8 v0.9.7 "Cayuga". You can download it under http://bommels-technik-welt.de.
It works very fine on my NSV-Tools.

Have fun and enjoy it

cu Pythy
pythy is offline   Reply With Quote
Old 20th January 2012, 08:11   #29
sankt
Moderator
 
sankt's Avatar
 
Join Date: Apr 2003
Location: SCVI . NET
Posts: 2,877
Nice Job Pithy !
sankt is offline   Reply With Quote
Old 20th January 2012, 08:21   #30
sankt
Moderator
 
sankt's Avatar
 
Join Date: Apr 2003
Location: SCVI . NET
Posts: 2,877
It is a shame that NSV encoding cant be added to VLC. That would take care of any update for NSV tools.

There is actually an NSV module that some one created a few years ago, I still wonder why it could not be added to VLC.
sankt is offline   Reply With Quote
Old 3rd February 2012, 06:16   #31
rockouthippie
Banned
 
rockouthippie's Avatar
 
Join Date: Jun 2004
Location: Oregon
Posts: 11,008
Shoutcast needs to stream webm. The best current tool for making webm (VP8/vorbis) files is ffmpeg. FFmpeg is now suitable for making webm in a production environment. It is about half speed vs. h264 in the encode direction. That's a lot better than it was last year. Mostly it's not really well threaded.

VLC (and I think it's almost on purpose) is a terrible encoder.
rockouthippie is offline   Reply With Quote
Old 12th February 2012, 16:43   #32
MrX_1980
Senior Member
 
Join Date: Mar 2003
Location: Germany - NRW
Posts: 109
Send a message via ICQ to MrX_1980
VP8 Codec SDK v1.0.0 "Duclair" Released (Friday, January 27, 2012)

"performance improvements up to ~10,5%" :-)

Update:
libvpx 1.0.0 Duclair: VP8 Video Encoding Benchmarked
MrX_1980 is offline   Reply With Quote
Old 12th February 2012, 17:32   #33
sankt
Moderator
 
sankt's Avatar
 
Join Date: Apr 2003
Location: SCVI . NET
Posts: 2,877
Good catch !

Dirac has updated their encoder as well.

http://diracvideo.org/2012/01/schroedinger-1-0-11/
sankt is offline   Reply With Quote
Old 25th February 2012, 17:32   #34
MrX_1980
Senior Member
 
Join Date: Mar 2003
Location: Germany - NRW
Posts: 109
Send a message via ICQ to MrX_1980
VP8 Codec SDK (libvpx) before 1.0.0 "Duclair" allows remote attackers to cause a denial of service (application crash)...
http://web.nvd.nist.gov/view/vuln/de...=CVE-2012-0823
MrX_1980 is offline   Reply With Quote
Old 6th March 2012, 05:36   #35
pumbaa2
Junior Member
 
Join Date: Mar 2012
Posts: 42
Indeed, I've been using VP62. I just installed VP8 and everything so far looks good. I will find out shortly about the Quality. A copy of the VP8 Codec along with Install Instructions has been posted to my files area on my website. The German Webpage was a little painful to look at
pumbaa2 is offline   Reply With Quote
Old 6th March 2012, 09:56   #36
pumbaa2
Junior Member
 
Join Date: Mar 2012
Posts: 42
Quote:
Originally Posted by pythy View Post
I have compiled a new "nsv_coder_vp8.dll" based on VP8 v0.9.7 "Cayuga". You can download it under http://bommels-technik-welt.de.
It works very fine on my NSV-Tools.

Have fun and enjoy it

cu Pythy
The codec settings field is a little to big and partially covers the Okay Button. Infact, on my version of NSVTools, the Okay button is invisible but right below the "Logo" in the Output Format Settings Dialog inside FlaskMPEG for NSV. Is there a fix for this?
pumbaa2 is offline   Reply With Quote
Old 6th March 2012, 09:58   #37
pumbaa2
Junior Member
 
Join Date: Mar 2012
Posts: 42
Ohh also, I noticed that whatever bitrate I use seems to be "halfed" when its done. I can set it to 256kb/sec but when I play it back in Winamp 5 it reports closer to 128. Ideas?
pumbaa2 is offline   Reply With Quote
Old 13th April 2012, 16:04   #38
slavas
Major Dude
 
Join Date: Apr 2003
Location: kaimas šalia Anykščių
Posts: 680
probably You encoding at 15 FPS, and wrapper didnt set correctly FPS for encoder.
Sample Xvid coder didnt handle FPS neither marked keyframes IIRC
slavas is offline   Reply With Quote
Old 15th April 2012, 09:48   #39
pumbaa2
Junior Member
 
Join Date: Mar 2012
Posts: 42
Hahhaha, okay... Yeah, your right.. My FPS was set at 15, that does explain a few things.
pumbaa2 is offline   Reply With Quote
Old 15th April 2012, 10:25   #40
slavas
Major Dude
 
Join Date: Apr 2003
Location: kaimas šalia Anykščių
Posts: 680
yeah just tested myself, that's the case
slavas is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > SHOUTcast > SHOUTcast TV / Nullsoft Video

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump