[Libav-user] Seeing double with H.264 images

Zachary Northrup coop6 at criticallink.com
Thu Aug 4 21:05:56 CEST 2011


Hello all,

I am developing software that interfaces with network attached security
cameras. I have been successfully using libavformat to mux the H.264 streams
I receive to MPEG-TS files. However, we just got a new camera that has a
strange issue when we view the files recorded from it. The video frames that
we receive from it are double the height of the older cameras and seem to
contain two copies of the picture, one on top of the other. I'm not sure
what would be causing this, but does anyone have any idea what could be the
cause? Based on some header files supplied with the camera's SDK, it sends
the video with an extended PES header that contains two flags that indicate
this behavior: is_interleaved set to 0 and field_id set to 0. Are these
standard PES/H.264 NAL fields? I thought it might be some weird interlacing,
except that the image is actually twice the height of the real image.

Now, one solution of course is to decode the image, crop it, and then
re-encode it into the file, but unfortunately that isn't fast enough for us.
Is there a way I can change how I write the stream that will cause media
players to either ignore the bottom half of the image or else properly
decode it into two frames? Based on the names of those PES fields, it sounds
like interleaving multiple video frames in the same picture might be a
standard feature.

-- 

Zachary Northrup
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110804/e2444828/attachment.html>


More information about the Libav-user mailing list