SkillAgentSearch skills...

Pyh264decode

Decode H.264 packets with external avcC to YUV frames

Install / Use

/learn @tzwenn/Pyh264decode
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

PyH264Decode

This is a small Python module to decode raw H.264 packets with external avcC extra data (ISO/IEC 14496:15).

It wraps ffmpeg's libavcodec and returns YUV420p frames, with the lineskip being the actual width of each frame.

Installing

This module is currently only tested with Python 2.7. You'll need ffmpeg (tested with 2.4.2) or libav with H.264 support installed.

$ python setup.py build
$ sudo python setup.py install
$ pydoc h264decode

Usage

import h264decode

decoder = h264decode.Decoder(avccPacket)
for frame in frameGenerator:
	yuv = decoder.decodeFrame(frame)
	print "Read frame of %dx%d pixels" % (yuv.width, yuv.height)
	# e.g. rendering with pygame:
	overlay.display((yuv.y, yuv.u, yuv.v))

License

Code is under the BSD 2 Clause (NetBSD) license.

View on GitHub
GitHub Stars30
CategoryDevelopment
Updated1y ago
Forks6

Languages

C

Security Score

60/100

Audited on Oct 6, 2024

No findings