Adding better logs in error case
Add log to debug
Test to detect FFMPEG encoding failure
Fix string conditional
Some code format