senko/python-video-converter

"quality" option on h264 codec breaks program (error)

Opened this issue · 0 comments

Hey,

I am using this code:

from converter import Converter
c = Converter()

conv = c.convert('input.mp4', 'video-transcoded.mkv', {
    'format': 'mkv',
    'audio': {
        'codec': 'ac3',
    },
    'video': {
        'codec': 'h264',
        'width': 1280,
        'height': 720,
        'quality': 25,
        'preset': 'slow'
    }
})

for timecode in conv:
    print "Converting (%f) ...\r" % timecode

And I get this error:

root@nas:/scripts/tools# python encode.test.py 
Traceback (most recent call last):
  File "encode.test.py", line 18, in <module>
    for timecode in conv:
  File "/usr/local/lib/python2.7/dist-packages/converter/__init__.py", line 184, in convert
    timeout=timeout):
  File "/usr/local/lib/python2.7/dist-packages/converter/ffmpeg.py", line 416, in convert
    p = self._spawn(cmds)
  File "/usr/local/lib/python2.7/dist-packages/converter/ffmpeg.py", line 334, in _spawn
    logger.debug('Spawning ffmpeg with command: ' + ' '.join(cmds))
TypeError: sequence item 14: expected string, int found
root@nas:/scripts/tools# 

And without quality option it works..

Please help me.

EDIT:
And I also debugged the _spawn method:
Spawning ffmpeg with command: /usr/bin/ffprobe -show_format -show_streams filename.mp4

How can I get the logger to work?