Python script to encode videos