Simple_player in Ipp-samples\\audio-video-codecs\\application...

Simple_player in Ipp-samples\\audio-video-codecs\\application...

Hi

I have builded the example code of ipp-samples\\audio-video-codecs\\application\\simple_player.

I would like to use the player to play H.264 movie, (Xmen.mkv )

I typed :

simple_player.exe Xmen.mkv.

the error message said :
"Failed to initialize splitter."

then the player is stop.

by my traced, the is failed on

umcRes = rpSplitter->Init(*lpSplParams);
the umcRes is UMC_ERR_INVALID_STREAM

What should I do to play the H.264 format movie??

Is the movie format simple_player doest not support ?

By KM player, the movie information is :

General
Complete name : C:\\Documents and Settings\\gaigerchen\\My Documents\\IPP ref\\ipp-samples\\audio-video-codecs\\application\\simple_player\\Xmen.mkv
Format : Matroska
File size : 1.67 GiB
Duration : 1h 47mn
Overall bit rate : 2 223 Kbps
Encoded date : UTC 2009-08-18 02:08:20
Writing application : mkvmerge v1.7.0 ('What Do You Take Me For') built on Apr 28 2006 17:20:19
Writing library : libebml v0.7.7 + libmatroska v0.8.0
Video #1
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 1 frame
Muxing mode : Container profile=Unknown@3.1
Codec ID : V_MPEG4/ISO/AVC
Duration : 1h 47mn
Bit rate : 1 859 Kbps
Nominal bit rate : 1 900 Kbps
Width : 1 024 pixels
Height : 576 pixels
Display aspect ratio : 16:9
Frame rate : 23.976 fps
Resolution : 8 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.131
Stream size : 1.39 GiB (84%)
Writing library : x264 core 67 r1139M 1024283
Encoding settings : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=6 / psy_rd=1.0:0.0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=0 / keyint=250 / keyint_min=25 / scenecut=40 / rc=2pass / bitrate=1900 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
Language : English
Audio #2
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Codec ID : A_AC3
Duration : 1h 47mn
Bit rate mode : Constant
Bit rate : 320 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Surround: L R, LFE
Sampling rate : 48.0 KHz
Stream size : 246 MiB (14%)

thank you.

34 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello,

mkv splitter is not supported in the UMC sample. AVI, MP4, and MPEG TS stream are supported.

Thanks,
Chao

HI

thank your support, I have change other movie for testing.

There is audio on, but video is not been rendering.

I do not know if my input parameter is suitable, I just input

simple_player vod.mp4
or
simple_player vod.mp4 -n

How should I do now to let the player could render screen ?

Properties of the movie is :

General
Complete name : C:\Documents and Settings\gaigerchen\My Documents\IPP ref\ipp-samples\audio-video-codecs\application\simple_player\vod.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 57.5 MiB
Duration : 2mn 49s
Overall bit rate : 2 848 Kbps
Encoded date : UTC 2008-03-28 15:45:26
Tagged date : UTC 2008-03-28 15:45:26
Video #1
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L4.2
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 2mn 49s
Bit rate mode : Variable
Bit rate : 2 687 Kbps
Width : 720 pixels
Height : 406 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 29.970 fps
Standard : NTSC
Resolution : 8 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.307
Stream size : 54.3 MiB (94%)
Language : English
Encoded date : UTC 2008-03-28 15:45:26
Tagged date : UTC 2008-03-28 15:45:26
Audio #2
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : 40
Duration : 2mn 49s
Bit rate mode : Variable
Bit rate : 157 Kbps
Maximum bit rate : 209 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz
Resolution : 16 bits
Stream size : 3.18 MiB (6%)
Language : English
Encoded date : UTC 2008-03-28 15:45:26
Tagged date : UTC 2008-03-28 15:45:26

Hi,

Can you try to add "-vdx" in the command line?

>simple_player -vdxvod.mp4

Thanks,
Chao

HI:

I have write do the input in the code :

#define GAIGER

#ifdef GAIGER
int main(void)
#else
int main(Ipp32s argc, vm_char* argv[])
#endif
{

#ifdef GAIGER
Ipp32s argc = 3;
vm_char* argv[5];

argv[1] = (vm_char*)malloc(256*sizeof(vm_char));
swprintf(argv[1],TEXT("-nvdx"));

argv[2] = (vm_char*)malloc(256*sizeof(vm_char));
swprintf(argv[2],TEXT("vod.mp4"));

#endif
:
:

there is still audio only......

I has tried trace the video code... but, it is too complex...

So, Mr. , could you give me a hint?

thank you.

HI,

I saw, it use "-nvdx":
swprintf(argv[1],TEXT("-nvdx"));

should it be "-vdx"?

Thanks,
Chao

Hi:

I have also tried the H.264 decoder, (in audio-video-codecs\application\umc_h264_dec_con)

similiar last post, I modify the code as :

#define GAIGER

#ifndef GAIGER
int vm_main(Ipp32s argc, const vm_char **argv)
#else
int vm_main(void)
#endif
{

#ifdef GAIGER
Ipp32s argc = 3;
vm_char *argv[5];

argv[1] = (vm_char*)malloc(256*sizeof(vm_char));
swprintf(argv[1],TEXT("-i"));

argv[2] = (vm_char*)malloc(256*sizeof(vm_char));
swprintf(argv[2],TEXT("Taipei101 sunset WMV HD 720.mp4"));
#endif
:
:

Of course, I has also modify function void CommandLine::Parse(Ipp32s argc, const vm_char** argv) to
Parse(Ipp32s argc, vm_char** argv) .

Then the program CRASH in the line :

if( UMC_OK != splitter->Init(splParams) ) (about Ln 334 )

debug assertion failed:
:
expression : auto_ptr not dereferencable

my input file is :

General
Complete name : C:\Documents and Settings\gaigerchen\My Documents\IPP ref\ipp-samples\audio-video-codecs\application\umc_h264_dec_con\Taipei101 sunset WMV HD 720.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 12.9 MiB
Duration : 1mn 54s
Overall bit rate : 947 Kbps
Encoded date : UTC 2008-03-26 20:17:24
Tagged date : UTC 2008-03-26 20:17:24
Video #1
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1mn 53s
Bit rate mode : Variable
Bit rate : 818 Kbps
Nominal bit rate : 800 Kbps
Maximum bit rate : 1 656 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 fps
Resolution : 8 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.035
Stream size : 11.1 MiB (86%)
Writing library : x264 core 58
Encoding settings : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x3:0x133 / me=hex / subme=5 / brdo=0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=0 / threads=3 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=0 / bime=1 / keyint=250 / keyint_min=25 / scenecut=40(pre) / rc=abr / bitrate=800 / ratetol=1.0 / rceq='blurCplx^(1-qComp)' / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / pb_ratio=1.30
Encoded date : UTC 2008-03-26 20:17:24
Tagged date : UTC 2008-03-26 20:17:24
Audio #2
ID : 2
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Format_Settings_Mode : Joint stereo
Codec ID : 6B
Duration : 1mn 54s
Bit rate mode : Constant
Bit rate : 128 Kbps
Maximum bit rate : 134 Kbps
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Resolution : 16 bits
Stream size : 1.74 MiB (14%)
Writing library : LAME3.98b
Encoding settings : -m j -V 4 -q 3 -lowpass 17 -b 128
Encoded date : UTC 2008-03-26 20:17:24
Tagged date : UTC 2008-03-26 20:17:24

(by Pure codec)

I don know how to input the parameter, may you just give me a handle ?

Or point out a workable moive with a set of parameter.
thank you lots.

Liger

Hi
Yes, I have trie the 2 case, but there is no video

The simple_player output is :

Audio Render : DSOUND
Video Render : NULL
-RenderFormat: YV12

Stream Type : MP4ATOM
Video Info :
-Video Type : H264
-Resolution : 720x406
-Frame Rate : 29.97
Audio Info :
-Audio Type : AAC_MP4
-S.Frequency : 48000
-Num.Channel : 2
-BitPerSample: 16

DecRate:40.96 fps(Dec 22.33ms/f + Conv 2.08ms/f = 24.41ms/f) RndrRate 52.58fps A
udio Dec 27.21chnls
DecRate:68.69 fps(Dec 14.15ms/f + Conv 0.41ms/f = 14.56ms/f) RndrRate 30.68fps A
udio Dec 50.96chnls
:
:

(f the movie format , the simple_play does not support ?( ?)

Thank you.

Hello,

Could you attach the video stream? so we can have a check here.
There was an old issue on the rendering here:
http://software.intel.com/en-us/articles/the-directx-render-in-umc-sampl...

Is this the problem?

Thanks,
Chao

HI :

My OS is windows XP sp3, Should modiy my player code?

This attahment is movie for umc_h264_dec_con.

The main function on umc_h264_dec_con. has been modify as :

#define GAIGER

#ifndef GAIGER
int vm_main(Ipp32s argc, const vm_char **argv)
#else
int vm_main(void)
#endif
{

#ifdef GAIGER
Ipp32s argc = 3;
vm_char *argv[5];

argv[1] = (vm_char*)malloc(256*sizeof(vm_char));
swprintf(argv[1],TEXT("-i"));

argv[2] = (vm_char*)malloc(256*sizeof(vm_char));
swprintf(argv[2],TEXT("Taipei101 sunset WMV HD 720.mp4"));
#endif

and :

#if(0)
CommandLine(Ipp32s argc, const vm_char** argv) { Parse(argc, argv); }
#else
CommandLine(Ipp32s argc, vm_char** argv) { Parse(argc, argv); }
#endif

(just writedown the input filename directly.)

thank you.

Attachments: 

AttachmentSize
Downloadvideo/mp4 Taipei101_sunset_WMV_HD_720.mp412.88 MB

Hello,

umc_h264_dec_con appliction does not include the render. The simple player application does.
I just checked your attaced file. I can see the video inthescreenwiththe following command line:

\>simple_player.exe -vdx "Taipei101+sunset+WMV+HD+720.mp4"

Could you please check if it works for you there if you run the simple player?

Thanks,
Chao

HI:

That is my mistake, I use the "build32.bat" to build library, and use standard visual studio IDE

to build the simple_player without rebuild all.

after I clean and rebuild, the simple_player works.

anyway, thank your help !!

Hi

About the umc_h264_dec_con, I input in command line:

umc_h264_dec_con -f yuv420 -i "Taipei101+sunset WMV +HD+720.mp4" -o AA.yuv

or just

umc_h264_dec_con -i "Taipei101+sunset WMV +HD+720.mp4"

the out put is : Video Decoder creation fail

By my trace, that is fail in the line :

if (UMC_OK != h264Decoder->GetInfo(&params))

it is becouse (in umc_h264_task_supplier.cpp):

if (m_CurrentSeqParamSet == -1 && !m_bSeqParamSetRead)
{
return UMC_ERR_NOT_INITIALIZED;
}

/*the m_bSeqParamSetRead is -1*/

so, what command I should input, to convert the movie as yuv format?

thank you.

Hi,

You need to use simple play application.

\>simple_player.exe -vfwf out.yuv "Taipei101+sunset+WMV+HD+720.mp4"

umc_h264_dec only decodes the rawH.264 file. The file you attached also needs MP4 splitter.

Thanks,
Chao

hi

thank you, it do work.

but there are some problem:

1. As your instruction, it does decode to YUV(420) format, but the simplay_player seem go into

a infinite loop . When the out.yuv file has done(~ 3.84G), and I have waited about 30mins, the command

line (dos) does not back to command prompt (C:\...\>).

2. I have use 2 YUV player to render the out.yuv :

http://www.yuvplayer.com/

http://dcmc.ee.ncku.edu.tw/~wjh94m/YUVplayer/index.html

(set h = 1280, w = 720 and format = yuv420)

I found that, the color of the movie became very strange in both player (as below).

Do you know where I get wrong ?

Thank you again.

Original screen from H.264:

The screen after YUV decode:

From the attached the picture, it looks that the U and V plane order is reversed.

When I play the output YUV data with IYUV format, it looks fine. What format did you use to play the output file?

Thanks,
Chao

Hi

Sorry, I got noob.

May I ask what yuv player you use? The 2 players which I list above seem do not support "IYUV" (just YUV 444 420 ..etc).

Or, may the simple_player could output the file with swapped U and V component?

thank you lots again...

Hi,

I tried to set the output as yuv420, not YV12. It can be played.

See if the following command line works for you?

\>simple_player.exe -fyuv420 -vfwf out.yuv "Taipei101+sunset+WMV+HD+720.mp4"

Thanks,
Chao

:

,

HI:

The simple player could not render again.

I just do as before:

simple_player -vdx Taipei101.mp4

I found that that is the driver initializing fail:

umcRes = (Status)pParams->m_pDrvSpec->drvInit(&m_Driver,
pParams->m_pDrvParams);

the umcRes is VM_NOT_INITIALIZED

line 105, in unified_video_render.cpp

it is becouse in the dx_drv.cpp :

if ((NULL == drv->dd_obj) || (false == drv->dd_support_overlay))
{
ERR_SET(VM_NOT_INITIALIZED, "initialization");
}
the drv->dd_support_overlay is false.

it is ,

caps.dwCaps = 0x002000000
DDCAPS_OVERLAY = 0x000008001

so the video render is NULL:

Audio Render : DSOUND
Video Render : NULL
-RenderFormat: YV12

Stream Type : MP4ATOM
Video Info :
-Video Type : H264
-Resolution : 1280x720
-Frame Rate : 25.00
Audio Info :
-Audio Type : MP1L3
-S.Frequency : 44100
-Num.Channel : 2
-BitPerSample: 16

Then, what may be this wrong?
driver fail ?

my system :

windows XP sp3.

but in other players or game, the driver works normally.

thank your instruction.

/////
Oh, it is my noob, I use dxdiag, I found that my computer does not be turned on directShow/directX acceleration !!

anyway, that works. :)

Hi Chao:

I tried to use umc_video_enc_con.exe to encode the Taipei101.yuv which been generated by

simple_player -fyuv420 -vfwf Taipei101.yuv Taipei101+sunset+WMV+HD+720.mp4.

I type :

umc_video_enc_con.exe h264 -i Taipei101.yuv -f 25 -w 1280 -h 720 -o Taipei101.mp4

The Taipei101.mp4, could been played by simple_player

but could not been play by pure codec or media player. (they said, lost decoder).

and the size is 66.8MB, much bigger than original (13.6MB).

So, could you talk me, what parameter I should input, to modified the H264 output?

thank you.

Hi,

the umc_video_enc_con creates a raw H.264 file, not the file in the .mp4 contain ( it you use .h264 as the file extension). You need to check if the decoder you use can support raw H.264 video file.

Thanks,
Chao

Hi Chao:

How should I do, to modify the umc_video_enc_con, let the output be mp4?

I know it is a big project, could you just give me a start point ?

I would like to modify the umc_video_enc_con become a vedeo stream encoder for video conferencing,

keeps encoding the video which is from the camera, then transmission to another computer, decode by (modified) umc_h264_dec_con or Media_SDK or hardware..etc.

thank you. :)

Hi,

You can check the muxer example at this article:

http://software.intel.com/en-us/articles/getting-started-with-intel-ipp-...

I also attached a MP4 muxer example, which takes raw YUV data as input, encode with H.264 video and MP4 container.

Thanks,
Chao

Attachments: 

AttachmentSize
Downloadtext/x-c++src simplemuxer_mp4.cpp4.19 KB

Hi Chao:

the article is extremely useful to me. thank you lots.

That it is what I really want.

thank you.

Hi Chao:

I have modify your sample code for my appliecation.

may I ask, does the H264VideoEncoder just supporting input format as gray, yuv420 and yuv 422 only ?

I find the H264EncoderParams chroma_format_idc is just three:

0 monochrome (starting from High profile)
1 YUV420
2 YUV422 (starting from High422 profile).

I would like let my input is RGB24 or RGB32, then encode as h264 format.

=================================================================

#define EIGHT_BITS 8
#define NUM_OF_LOGICAL_PROCESSOR 0
#define PIXELSIZE3 3
#define PIXELSIZE4 4

int H264EncodeStream(void *pDst,int *H264Size, void *pSrc, int width, int height, int frameNumber, ColorFormat fmt, int bitrate)
{

UMC::Status status;
UMC::MediaData DataOut; UMC::VideoData DataIn;
UMC::H264EncoderParams Params;
UMC::H264VideoEncoder H264Encoder;
UMC::ColorFormat ufmt;

int frameSize;

Ipp8u *pInputData, *pVideoData;
int srcSize, dstSize;

pInputData = (Ipp8u*)pSrc;
pVideoData = (Ipp8u*)pDst;
*H264Size = dstSize = 0;

switch(fmt)
{
case GRAY:
ufmt = UMC::GRAY;
Params.chroma_format_idc = 0;
frameSize = width*height;
break;

case YUV420:
ufmt = UMC::YV12;
frameSize = width*height*3/2;
break;

case YUV422:
ufmt = UMC::YUV422;
frameSize = width*height*2;
break;

case YUV444:
ufmt = UMC::YUV444;
frameSize = width*height*PIXELSIZE3;
break;

case RGB24:
ufmt = UMC::RGB24;
frameSize = width*height*PIXELSIZE3;
break;

case RGB32:
ufmt = UMC::RGB32;
frameSize = width*height*PIXELSIZE4;
break;

default:
return -2;
}/*switch fmt*/

Params.profile_idc = UMC::H264_MAIN_PROFILE;
Params.key_frame_controls.method= UMC::H264_KFCM_INTERVAL;
Params.info.clip_info.width = width;
Params.info.clip_info.height = height;
Params.info.bitrate = bitrate;
Params.numThreads = NUM_OF_LOGICAL_PROCESSOR;

if((status = H264Encoder.Init(&Params))!=UMC::UMC_OK)
return -1;

DataIn.Init(width, height, ufmt, EIGHT_BITS);
DataIn.SetBufferPointer( pInputData, frameSize);
DataIn.SetDataSize(frameSize);

DataOut.SetBufferPointer(pVideoData, frameSize*frameNumber);

int nEncodedFrames = 0 ;
while ( nEncodedFrames < frameNumber)
{
status = H264Encoder.GetFrame(&DataIn, &DataOut);
if (status == UMC::UMC_OK)
{
nEncodedFrames++;

dstSize+=DataOut.GetDataSize();
DataOut.MoveDataPointer(DataOut.GetDataSize());

pVideoData+= frameSize;
DataIn.SetBufferPointer(pVideoData, frameSize);
DataIn.SetDataSize(frameSize);
}
}/*while nEncodedFrames < frameNumber*/
*H264Size = dstSize;

return 0;
}/*H264EncodeStream*/

=====================================================================

If I set the pSrc is RGB pixel array data, output is wrong.

How should I do to modify my code....? I would like not use IPP to comversion my input data as YUV420..

it need additional costing....

is UMC native supports RGB24/RGB32 as H264 encoder input ?

thank you.

Hello,

UMC video encoder sample does not support color conversion and downsampling steps as a part of processing loop. That mean you need to implement that conversion at your application before you call UMC encoder.

Regards,
Vladimir

For RGB format, the following two IPP functions can help to convert into YUV space first,

ippiBGRToYCrCb420_8u_C3P3R();
or

ippiRGBToYCbCr420_8u_C3P3R()

Thanks,
Chao

Hi

thankyou two, that is same as I guess, H264 encoder do not support RGB as input data directly.

HI

I have I integral your exmaple as a library, that is :

DECODE_EXPORTS_API int H264Decode_Init(int BuffSize = 5*MEGABYTE);

DECODE_EXPORTS_API int H264DecodeStream(int Decoder, void *pDst, int *width, int *height, int *frameNumber,
void *pSrc, int videoDataSize, ColorFormat fmt = RGB24);
DECODE_EXPORTS_API void H264Decode_Close(int Decoder);

input is from the simple encoder, it is a series of image.

The full code is in the attachment.

I found that, the decoder just could decode when the function H264DecodeStream been called at first.
After first image, it would fail in the line :

status = h264Decoder->decoder->GetFrame(NULL, h264Decoder->dataOut);

the status would be UMC_ERR_INVALID_STREAM.

I think it is becouse UMC::H264VideoDecoder does not been reset, but using Reset() function is still
not work.

what should it do to modify the code to let the H264DecodeStream could be call many time and still work ? thank you again.

Hi,

Could you please also attached the related the .h file, which can help to reproduce your problem here?

Also, in this code, H264DecodeStream looks only be called once. Is there any code that can actually show the problem, and please also attached the test stream.

Thanks,
Chao

HI Chao:

Sorry I just non-clear code Completely.

I have modify the input and output, the input is h264 file, output is bmp.

you should add those projects: h264_dec, color_space_converter, umc, vm and vm_plus.

the start up project is ConsoleRun.

thank you.

Attachments: 

AttachmentSize
Downloadapplication/rar umcH264Decoder.rar569.86 KB

Hi,

In the code, you are decoding multiple stream data. You need to use multiple instance of H.264. See attached sample.

Reset() change the decoder status to an initialized instance. Not the status before the initialization

Thanks,
Chao

Attachments: 

AttachmentSize
Downloadtext/x-c++src simpledecoder.cpp3.16 KB

HI

I found that the UMC::VideoDecoderParams params could not be re-use, so H264DecodeStream

would not work from this function is called more than a second.

I found that it is just use

params.pPostProcessing = NULL;

in the H264DecodeStream

then H264DecodeStream could be called multi-time with right output.

anyway, thank you.

Leave a Comment

Please sign in to add a comment. Not a member? Join today