X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=blobdiff_plain;f=cis%2Fcisd.py;h=e1acefd1974fd686d79c64501eb694daf3a6efc9;hb=1ab12b6c509b6a6be95f79dc50089649a32872da;hp=aa50b33aa4d9226a14ad071e4a55d35b4d23a2e9;hpb=42cb85273f6ef35a40c183f1184313bbc06afa05;p=living-lab-site.git diff --git a/cis/cisd.py b/cis/cisd.py index aa50b33..e1acefd 100755 --- a/cis/cisd.py +++ b/cis/cisd.py @@ -2,9 +2,40 @@ import sys import config -import cis_exceptions +# +# !! Imports required for create_torrent +# +from BaseLib.Core.API import * +# +# +# + +def create_torrent(input_): + tdef = TorrentDef() + tdef.add_content(input_, config.AVINFO_CLASS.get_video_duration(input_)) + tdef.set_tracker(config.BT_TRACKER) + + tdef.set_piece_length(32768) + + tdef.finalize() + tdef.save(input_ + ".tstream") + + print 'READY!', config.BT_TRACKER, config.AVINFO_CLASS.get_video_duration(input_) if __name__ == '__main__': - transcoder = config.TRANSCODER_CLASS("../data/media/test.ogv") - transcoder.transcode('ogg', "vorbis", "theora", a_bitrate="192k", a_samplingrate=44100, a_channels=2, v_bitrate="700k", v_framerate=25, v_resolution="800x600", v_dar="16:9") + pass +# transcoder = config.TRANSCODER_CLASS(sys.argv[1]) +# transcoder.transcode('webm', "vorbis", "vp8", a_bitrate="128k", a_samplingrate=22050, a_channels=2, v_bitrate="256k", v_framerate=15, v_resolution="320x240", v_dar="4:3") + +# thumb_extractor = config.THUMB_EXTRACTOR_CLASS(sys.argv[1]) +# #print thumb_extractor.get_video_duration() +# #thumb_extractor.extract_random_thumb() +# print thumb_extractor.extract_summary_thumbs(5) + +# file_transfer = config.FILE_TRANSFERER_CLASS() +# file_transfer.get(['vim_config.tar.gz']) +# #file_transfer.put(['cisd.py']) +# file_transfer.close() + + create_torrent(sys.argv[1])