rewrite input nal demux code