av/codec/h264/h264dec
Saxon fc4e88bce6 fixed bugs causing problems with GeoVision H264 RTMP to youtube streaming.
Two fixes were involved, firstly, access unit delimeters were used to denote access units and the Write timeout on rtmpSender's ringBuffer was
increased to stop the 'unable to dump old write' errors. Also made some small changes elsewhere that should fix future issues, particular with
MTS output.
2019-10-07 14:18:20 +10:30
..
bits codec/h264/h264dec: added tests for pps parsing found in pps.go and made necessary changes 2019-07-23 16:38:35 +09:30
CODEOWNERS codec/h264: decode pakage renamed to h264dec 2019-07-19 15:19:15 +09:30
LICENSE codec/h264: decode pakage renamed to h264dec 2019-07-19 15:19:15 +09:30
README.md codec/h264: decode pakage renamed to h264dec 2019-07-19 15:19:15 +09:30
cabac.go codec/h264/h264dec: embedded SliceHeader and SliceData into Slice type, and embedded SPS and PPS into VideoStream type 2019-09-09 11:08:48 +09:30
cabac_test.go codec/h264/h264dec: moved CABAC encoding related stuff to cabacenc.go and cabacenc_test.go and corrected function names 2019-08-26 16:01:48 +09:30
cabacenc.go codec/h264/h264dec/cabac.go: added binarization process for coded block pattern 2019-08-26 16:35:06 +09:30
cabacenc_test.go codec/h264/h264dec: moved CABAC encoding related stuff to cabacenc.go and cabacenc_test.go and corrected function names 2019-08-26 16:01:48 +09:30
cabactab.go codec/h264/h264dec: added tables from reference implementation which are adapted tables from tables 9-12 to 9-33 of specifications for use in CABC initialisation 2019-08-06 14:21:52 +09:30
cavlc.go Merged in total-coeff-and-trailing-ones (pull request ) 2019-09-20 00:38:58 +00:00
cavlc_test.go codec/h264/h264dec: using const string instead of CSV file to hold table 9-5. Also made some other minor improvements 2019-09-09 16:41:26 +09:30
cavlctab.go codec/h264/h264dec/cavlctab.go: commented const string representation of table 9-5. 2019-09-09 16:41:26 +09:30
decode.go codec/h264/h264dec/decode.go: slightly simplified if-else statements regarding BottomField and FieldPic 2019-09-18 19:41:32 +09:30
frame.go fixed bugs causing problems with GeoVision H264 RTMP to youtube streaming. 2019-10-07 14:18:20 +10:30
helpers.go codec/h264/h264dec: added binToInt function and test 2019-09-09 16:40:42 +09:30
helpers_test.go codec/h264/h264dec: added binToInt function and test 2019-09-09 16:40:42 +09:30
mbtype.go codec/h264/h264dec: added functions for loading table 9-5 CSV into [nColumns]map[int]map[int][2]int with testing 2019-09-09 16:41:26 +09:30
mbtype_test.go codec/h264/h264dec: changed packages from h264 to h264dec 2019-07-19 15:20:39 +09:30
mnvars.go codec/h264/h264dec: changed packages from h264 to h264dec 2019-07-19 15:20:39 +09:30
nalunit.go codec/h264/h264dec: addressing PR feedback. 2019-08-20 11:39:12 +09:30
nalunit_test.go codec/h264/h264dec: addressing PR feedback. 2019-08-20 11:39:12 +09:30
parse.go codec/h264/h264dec: fixed field types in sps.go and corrected code after merge of master into branch 2019-07-30 10:16:08 +09:30
parse_test.go codec/h264/h264dec: added tests for pps parsing found in pps.go and made necessary changes 2019-07-23 16:38:35 +09:30
pps.go codec/h264/h264dec: fixed some bugs found by testing 2019-08-05 13:59:08 +09:30
pps_test.go codec/h264/h264dec: merged in master and removed additional binToSlice func 2019-07-31 22:39:20 +09:30
rangetablps.go codec/h264/h264dec: changed packages from h264 to h264dec 2019-07-19 15:20:39 +09:30
rbsp.go codec/h264/h264dec: fixed import paths 2019-07-19 15:44:45 +09:30
read.go fixed bugs causing problems with GeoVision H264 RTMP to youtube streaming. 2019-10-07 14:18:20 +10:30
read_test.go codec/h264/h264dec/read_test.go: added file header 2019-07-31 22:40:10 +09:30
server.go codec/h264/h264dec: fixed import paths 2019-07-19 15:44:45 +09:30
slice.go Merged in picture-order-count (pull request ) 2019-09-20 02:37:33 +00:00
slice_test.go codec/h264/h264dec/slice_test.go: added license information to file header 2019-08-20 12:06:11 +09:30
sps.go codec/h264/h264dec/sps.go: commented fields of syntax structures 2019-07-31 20:25:38 +09:30
statetransxtab.go codec/h264/h264dec: changed packages from h264 to h264dec 2019-07-19 15:20:39 +09:30

README.md

Build Status Go Report Card

Listens for a stream of H264 bytes on port 8000.

A stream is read sequentially dropping each NAL into a struct with access to the RBSP and seekable features. No interface contracts are implemented right now. This is heavily a work in progress.

TODO

  • CABAC initialization
  • Context-adaptive arithmetic entropy-coded syntax element support
  • Macroblock to YCbCr image decoding

Done

  • DecodeBypass, 9.3.3.2.3
  • DecodeTerminate, 9.3.3.2.4
  • RenormD - 9.3.3.2.2
  • rangeTableLPS ( Table 9-44 )
  • Derive ctxIDX per 9.3.3.1
  • Select M, N values

ArithmeticDecoding S 9.3.3.2

  • cabac.go : ArithmeticDecoding 9.3.3.3.2
  • cabac.go : DecodeBypass, DecodeTerminate, DecodeDecision

In Progress

  • Make use of DecodeBypass and DecodeTerminate information
  • 9.3.3.2.1 - BinaryDecision
  • 9.3.3.2.1.1, 9.3.3.2.2

Next

  • Make use of initCabac (initialized CABACs)

Background

The last point was and is the entire driving force behind this project: To decode a single frame to an image and begin doing computer vision tasks on it. A while back, this project was started to keep an eye on rodents moving their way around various parts of our house and property. What was supposed to happen was motion detected from one-frame to another of an MJPEG stream would trigger capturing the stream. Analyzing the stream, even down at 24 fps, caused captures to be triggered too late. When it was triggered, there was so much blur in the resulting captured stream, it wasn't very watchable.

Doing a little prototyping it was apparent reading an h.264 stream into VLC provided a watchable, unblurry, video. With a little searching on the internet, (https://github.com/gqf2008/codec) provided an example of using ffMPEG to decode an h.264 frame/NAL unit's macroblocks into a YCbCr image. Were this some shippable product with deadlines and things, GGF2008 would've been wired up and progress would've happened. But this is a tinkering project. Improving development skills, learning a bit about streaming deata, and filling dead-air were the criteria for this project.

Because of that, a pure Go h.264 stream decoder was the only option. Duh.