Page 3 of 5
Re: Recording and streaming emu frames
Posted: Fri Dec 26, 2014 1:37 pm
by Anes
what is a "scanline stride"??
What i have is all the pixels retriving a pointer to my D3d9 texture, wich acttually contain the RGB info (from botton to up) wich i actually invert the image by code.
Re: Recording and streaming emu frames
Posted: Fri Dec 26, 2014 1:39 pm
by tepples
Anes wrote:what is a "scanline stride"??
I assume the number of bytes between the start of one scanline and the start of the next.
Re: Recording and streaming emu frames
Posted: Fri Dec 26, 2014 6:38 pm
by rockcarry
Anes wrote:I solved it... thanks
what's the problem, and how do you fix it ?
Re: Recording and streaming emu frames
Posted: Fri Dec 26, 2014 6:45 pm
by rockcarry
tepples wrote:Anes wrote:what is a "scanline stride"??
I assume the number of bytes between the start of one scanline and the start of the next.
Yes, you are right.
Re: Recording and streaming emu frames
Posted: Sat Dec 27, 2014 10:19 am
by Anes
rockcarry wrote:Anes wrote:I solved it... thanks
what's the problem, and how do you fix it ?
No, no it was a noob thing from my part. I realized that i had the .def empty.
Then what i did was to add to the .def file:
Code: Select all
EXPORTS
ffencoder_audio
ffencoder_free
ffencoder_init
ffencoder_video
and made:
Code: Select all
lib /def:ffencoder.def /OUT:ffencoder.lib
from the Visual Studio 2010 command prompt.
and then inside the code:
Code: Select all
extern "C" {
#include <ffencoder.h>
}
having the path of "ffencoder.h" in my lib path.
And solved it

Re: Recording and streaming emu frames
Posted: Sat Dec 27, 2014 10:21 am
by Anes
So the encoder works by "scanline"??
Re: Recording and streaming emu frames
Posted: Sat Dec 27, 2014 11:36 am
by Anes
I'll be honest, i don't know how to encode the video.
If i have a ptr to all the ARGB pixels of frame how do i do?
thanks.
Re: Recording and streaming emu frames
Posted: Sun Dec 28, 2014 2:40 am
by rockcarry
Anes wrote:I'll be honest, i don't know how to encode the video.
If i have a ptr to all the ARGB pixels of frame how do i do?
thanks.
Code: Select all
BYTE vbuf[256 * 240 * 4];
void *vdata [8] = { vbuf };
int linesize[8] = { 256 * 4 };
ffencoder_video(encoder, vdata, linesize);
vbuf stored the 32bit ARGB data, then vdata[0] = vbuf, linesize[0] = 256 * 4
Re: Recording and streaming emu frames
Posted: Sun Dec 28, 2014 3:01 am
by nIghtorius
rockcarry wrote:Anes wrote:I'll be honest, i don't know how to encode the video.
If i have a ptr to all the ARGB pixels of frame how do i do?
thanks.
Code: Select all
BYTE vbuf[256 * 240 * 4];
void *vdata [8] = { vbuf };
int linesize[8] = { 256 * 4 };
ffencoder_video(encoder, vdata, linesize);
vbuf stored the 32bit ARGB data, then vdata[0] = vbuf, linesize[0] = 256 * 4
Why use arrays? (vdata[8], linesize[8])
why not just
void* vdata
int* linesize
or
int linesize =256 * 4;
ffencoder_video (encoder, &vbuf, &linesize);
why the arrays of 8 elements?
Re: Recording and streaming emu frames
Posted: Sun Dec 28, 2014 3:30 am
by rockcarry
ffmpeg using many many different pixel and audio formats, some format is using multi-paneled or multi-channel data.
Re: Recording and streaming emu frames
Posted: Sun Dec 28, 2014 7:42 am
by Anes
rockcarry wrote:Anes wrote:I'll be honest, i don't know how to encode the video.
If i have a ptr to all the ARGB pixels of frame how do i do?
thanks.
Code: Select all
BYTE vbuf[256 * 240 * 4];
void *vdata [8] = { vbuf };
int linesize[8] = { 256 * 4 };
ffencoder_video(encoder, vdata, linesize);
vbuf stored the 32bit ARGB data, then vdata[0] = vbuf, linesize[0] = 256 * 4
Damn!! my video only shows green colour with some garbage. Could it be a codec problem? i mean i have "k lite codec pack" installed.
Re: Recording and streaming emu frames
Posted: Sun Dec 28, 2014 7:57 am
by Anes
wtf!!! i tried a lot of configurations and still canno't acchive a good .mp4 file...
Re: Recording and streaming emu frames
Posted: Sun Dec 28, 2014 8:31 am
by Anes
What i fool i was.. it was "pixel format", anyway i the emu turns very slow as it encode the video. it's my emu performance thing.
Re: Recording and streaming emu frames
Posted: Sun Dec 28, 2014 9:28 am
by tepples
That's another reason for encoding in a separate process: it lets you use all cores of your multi-core CPU.
Re: Recording and streaming emu frames
Posted: Sun Dec 28, 2014 6:24 pm
by Anes
Is it worth to try to encode in a different thread?
I made the following: i created a thread like this:
Code: Select all
DWORD WINAPI ThreadProc(
_In_ LPVOID lpParameter
)
{
for (;;)
{
if (video_record)
{
data[0] = pixels;
video_record = 0;
ffencoder_video(ffhandle, data, linesize);
//Sleep(1000);
}
}
}
so at the end of the frame i set "video_record" to "1".
The emu run fast, but when i play the video runs too fast, i don't know why.