www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Any video transcoding lib like this?

reply Karabuta <karabutaworld gmail.com> writes:
Hello community, has anyone done a lib published/unpublihed in D 
like https://github.com/senko/python-video-converter . It was 
developed in python and uses ffmpeg behind the scene.

It works this way;

from converter import Converter
c = Converter()
info = c.probe('test1.ogg')

conv = c.convert('test1.ogg', '/tmp/output.mkv', {
     'format': 'mkv',
     'audio': {
         'codec': 'mp3',
         'samplerate': 11025,
         'channels': 2
     },
     'video': {
         'codec': 'h264',
         'width': 720,
         'height': 400,
         'fps': 15
     }})

for timecode in conv:
     print "Converting (%f) ...\r" % timecode
Sep 10 2016
parent Guillaume Piolat <first.last gmail.com> writes:
On Saturday, 10 September 2016 at 11:03:44 UTC, Karabuta wrote:
 Hello community, has anyone done a lib published/unpublihed in 
 D like https://github.com/senko/python-video-converter . It was 
 developed in python and uses ffmpeg behind the scene.

 It works this way;

 from converter import Converter
 c = Converter()
 info = c.probe('test1.ogg')

 conv = c.convert('test1.ogg', '/tmp/output.mkv', {
     'format': 'mkv',
     'audio': {
         'codec': 'mp3',
         'samplerate': 11025,
         'channels': 2
     },
     'video': {
         'codec': 'h264',
         'width': 720,
         'height': 400,
         'fps': 15
     }})

 for timecode in conv:
     print "Converting (%f) ...\r" % timecode
Your best bet for now is to use ffmpeg directly: http://code.dlang.org/packages/ffmpeg-d
Sep 11 2016