I've been trying the examples in the Intel Media SDK tutorial:
However, I found that when trying to take a sample raw YUV4 video (such as "coastguard" from http://media.xiph.org/video/derf/) which plays correctly in VLC, encode it with simple_3_encode, and decode it with simple_2_decode (which should give me back a lossy version of the original YUV), the final video looks quite different in VLC. See the attachments below. Furthermore, MediaInfo can't read any metadata in the final output.
What could be the problem?
I picked up the first raw YUV frame of the "coastguard" content from here, http://www.cipr.rpi.edu/resource/sequences/sequences/sif/yuv/sif_yuv_coastguard.tgz (the two first links are broken) and encoded it to H.264 using simple_3_encode project without issues. The YUV file is of resolution 352x288, so you have to change the inputWidth and inputHeight in the code.
I do not recommend using typical end user media players (such as VLC or WMP) to play back elementary streams(ES). Such players were developed with container decode (not ES) in focus and it will often fail to decode pure ES.
If you want to play back (render) pure ES check out Media SDK sample_decode sample or video tools such as Elecard StreamEye, FFmpeg and many others.
Elecard also have a nice YUV viewer tool whihc you can use to validate YUV content before feeding it into any encoder.
I do not believe the "pedestrian" content is of typical YUV type color space format since I do see some drifting shadows. You would likely have to convert color space first if you want to use this clip.
I had made the change to the resolution parameters for 352 x 288. I have tried your suggestion of using ffmpeg. However, when I extract the frames of the encoded h264 file (or view with ffplay), the result has a strange vertical line and the video seems to "scroll sideways" (see attachment). The ffmpeg command I use is:
ffmpeg -i test.264 -vframes 300 out%d.png
See attachment for examples. Is there something I am missing?
I see nothing wrong with the coastguard YUV content. I suspect that in the process of merging the coastguard YUV files you may have introduced some additional padding, thus the scrolling issue.
I joined the first 12 yuv frames from the coastguard content into one yuv file and was able to encode into a proper stream.
I suggest you validate your YUV input files with YUV viewing tool before feeding it to an encoder.