nareix / joy4

Golang audio/video library and streaming server
MIT License
2.67k stars 499 forks source link

h264parser: Remove Emulation Prevention Bytes (in ParseSPS) #74

Closed a-rose closed 5 years ago

a-rose commented 6 years ago

Emulation Prevention Bytes are not removed from the bitstream, which can lead to incorrect parsing of the SPS.

The cleanupEmulationPrevention() function read the whole SPS pretty much byte-by-byte looking for EPBs. This is not a great method in terms of performance, but SPS are supposed to be quite short so the impact on performance is negligible.