Convert Encode RGB24 Uncompress Avi file to H.264

Convert Encode RGB24 Uncompress Avi file to H.264

I'm test Intel Media SDK now.

When I run sample program to encode RGB24 Un-compress avi
video toencoded h264 OR MPEG2 file does not played inMedia Player. In VLC
file play with show only Color Lines which move Horizontal and Vertical and Framerate also increase from 30 to 60

I convert the RBG24 to YUV420 Formt but result still same.

Encoded File screenshort is below

Thank in Advance

18 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

Hello Omar,
If you are using sample_encode please note that it requires pure raw video stream as input. AVI container contains meta information which being encoded as frame data results in such artifacted stream. As for output stream not playable with Windows Media Player this is again due to the sample specifics - it produces an elementary video stream. WMP is not able to playback elementary h.264 format.
If you would like to convert an AVI to MP4 for example you may use Media SDK Direct Show samples with GraphEdit application (FileSource Async->AVI Splitter->Color Converter -> Intel Media SDK H.264 Encoder -> Intel MSDK MP4 Muxer -> FileWriter)
Regards,Nina

And if you have some trouble connecting "Color Converter -> Intel Media SDK H.264 Encoder" (like Nina said), please make a search in this forum.... ;)

Good luck!

Regards, Guilherme

Thanks for Help.

But After convert Avi video to Raw YUV format.Now I got Following Result

Source Video:

Encoded Video:

Tnanks in Advance

Hi Omar,Sample_encode requires YUV 420 format and your source is YUY2 (YUV 422) as I see.Nina

Thanks for Reply

I Convert RGB to I420 format and then encode to MPEG2. Now Encoded Video Show good result but images are move horizontally as shown in below Image.

Sourc Image:

The result looks like you have provided wrong resolution to the sample_encode (width/2 instead of actual width). Could you share the command line you are using? Also please share the raw video after color conversion - you may cut several first frames and attach the stream here.
Nina

Are you using I420 like:

Y0Y1Y4Y5
Y2Y3Y6Y7.....
.....
U...
V....

???

I don't know if I could explain.. but, are you shure that you are setting Y's correctly ?

Regards, Guilherme

command

sample_encode mpeg2 -i 1.yuv -o result.mp4 -w 720 -h 576

and Source and Result File can be Download at following Link
http://www.sonovision2.com/downloads/VideoFile.zip

and one more question is that can i used Intel SDK H264 or Mpeg2 decoderin VB.net or Window Media Player as Decoder?

Hi gthomaz

I don't kwn what is Y's setting. I convert RGB24 Source Avi file to Raw I420 format using following Command

mencoder.exe -of avi Source.avi -o 1.yuv -vf format=I420 -nosound -ovc raw

Hi Omar,
As far as the input YUV file for the sample_encode already looks bad this means you are doing something wrong at conversion stage. This is not an encoding problem.
In your command line for mencoder.exe please try removing '-of' option, it is mispaced and probably takes effect and results in avi container at output again.
Try this linemencoder Source.avi -ovc raw -vf format=i420 -o out.yuv
If this doesn't help please share the Source.avi.
Nina

Regarding your other questions. As for VB.Net there was an answer posted in your older threadhttp://software.intel.com/en-us/forums/showthread.php?t=82102&o=a&s=lr
As for Windows Media Player it should be possible to use Media SDK decoders through Media Foundation and Direct Show sample decoder plugins. Likely you will need to experiment with GUIDs and merits to make WMP use those plugins, but it should work. Please give it a try.
Regards,Nina

Hi Nina

I tried this line
mencoder Source.avi -ovc raw -vf format=i420 -o out.yuv

but result still same. I upload Source and Result Files at following Link
http://www.sonovision2.com/downloads/SourceFile.zip

Hi Omar,
I checked mencoder at my side - the problem is that the default output container is AVI. To actually get the raw video stream you need to add the option -of rawvideo.
The whole line should be:mencoder Source.avi -of rawvideo -ovc raw -vf format=i420 -o out.yuv
I checked that it provides a raw video stream. The only problem I saw - some corruption on the first several frames. Seems that there's a problem in mencoder's color conversion algorithm.
To overcome this I used VirtualDubMode to change compression inside avi from cvid to IYUV and after that used mencoder to extract raw video from an avi. Having done all that I achieved a totally good looking YUV stream.
Please try. Also be sure to use the correct resolution with sample_encode after that - I noticed that Source.avi has the resolution 1024x768 and you encoded as 720x480.
Best regards,Nina

Hi Nina,

Thanks I also get good looking Video but Video movehorizontally and not playback as Video.
How can i solve this issue?

Hi Omar,
Based on the Source.avi you shared, the raw video after conversion and the encoded video after encoding with sample-encode playback totally fine at my side. Horizontal movement shows that you still get an avi file after conversion. Please check the command line arguments of mencoder.
Regards,Nina

Hi Nina

Thanks for help. Issue is Fixed.

Very glad to hear that!-Nina

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui