linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Help to debug h264 headers (or video) generation in kernel driver
@ 2015-09-26  7:06 Andrey Utkin
       [not found] ` <CAMxVRxD7+uf-Lb8V2Eck1qM0boA3WGvQAPvHYL2Q4hU0erQ=gw@mail.gmail.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Utkin @ 2015-09-26  7:06 UTC (permalink / raw)
  To: x264-devel, FFmpeg development discussions and patches,
	Linux Media, kernel-mentors, devel

I'm working on Linux kernel driver for multimedia grabber and H264
encoder based on Techwell/Intersil 5864 chip. Of course it will be
open and pushed into upstream kernel.

The device produces H264 encoded data, but it lacks any headers. The
reference driver generates headers and glues frames together in code,
but I failed both reverse-engineering and porting that code. The code
of reference driver is overwhelmingly complicated, and I have no
knowledge how H264 bitstream is formed, that's why my attempts failed.

I have reached a limited success with both setting up the hardware
encoder and forming the headers. You can see the samples of produced
video here:
http://lizard.bluecherry.net/~autkin/tw5864_tiled_video/ntsc_cif.h264
http://lizard.bluecherry.net/~autkin/tw5864_tiled_video/ntsc_d1.h264
http://lizard.bluecherry.net/~autkin/tw5864_tiled_video/pal_cif.h264
http://lizard.bluecherry.net/~autkin/tw5864_tiled_video/pal_d1.h264

Currently it produces "tiled" picture. The width of tiles on these
sample videos is 256 pixels.
I am not sure whether the issue is in hardware settings, or incorrect
headers which lead to partial failure of decoding.
Here is ffplay log for playing back such video:
https://gist.github.com/krieger-od/5269c762a36bcb52b93a . Obviously
some enhancements to headers generation are needed.

Playing with hardware mirroring flags proves that the raw frame gets
caught fully and correctly. But for h264 encoding, it gets garbled.
Also please notice that frame order is incorrect, the motion goes back
and forth.

You can see our latest code for this development at
https://github.com/bluecherrydvr/linux/tree/tw5864/drivers/staging/media/tw5864
(branch tw5864, subdirectory drivers/staging/media/tw5864).

Any input is extremely appreciated.

-- 
Bluecherry developer.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [x264-devel] Help to debug h264 headers (or video) generation in kernel driver
       [not found] ` <CAMxVRxD7+uf-Lb8V2Eck1qM0boA3WGvQAPvHYL2Q4hU0erQ=gw@mail.gmail.com>
@ 2015-09-26 16:16   ` Andrey Utkin
  0 siblings, 0 replies; 2+ messages in thread
From: Andrey Utkin @ 2015-09-26 16:16 UTC (permalink / raw)
  To: Mailing list for x264 developers
  Cc: kernel-mentors, devel,
	FFmpeg development discussions and patches, Linux Media

On Sat, Sep 26, 2015 at 10:44 AM, Max Lapshin <max.lapshin@gmail.com> wrote:
> Do you get some packets from this device or it is a bytestream?

Oh hi a linux.org.ru buddy :)
I get headerless binary data portions of known length, one portion for
each encoded video frame. NAL headers generation is done on driver
level in reference software, and I have no choice but to follow same
approach.
You can check most of the info about this project from my earlier
request for help: https://lkml.org/lkml/2015/6/2/761

-- 
Bluecherry developer.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-26 16:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-26  7:06 Help to debug h264 headers (or video) generation in kernel driver Andrey Utkin
     [not found] ` <CAMxVRxD7+uf-Lb8V2Eck1qM0boA3WGvQAPvHYL2Q4hU0erQ=gw@mail.gmail.com>
2015-09-26 16:16   ` [x264-devel] " Andrey Utkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).