encoder: implement headers and trailers (not working yet)
transcode example seems to be working

although the output file seems to not be very well formed