doc/examples/transcoding: check encoder before using it

Fixes null pointer exception

Found-by: stoupeace
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>