added video encoding flushing
remove flush_encoder method
make sure return a packet on the first flush if possible