Exemplo n.º 1
0
 def OnMuxButton(self,event):
   directory=self.demuxer.GetDirectory()
   try:
     if self.options.save_as_copy:
       root,ext=os.path.splitext(self.filename)
       remuxed_name=root+'.remuxed'+ext
     else:
       remuxed_name=self.filename
     muxer=Muxer(self.tools,remuxed_name,directory,'kate')
     while self.list.GetItemCount()>0: self.list.DeleteItem(0)
     self.demuxer=None
     self.SetupActionButton(self.action_button)
     try:
       self.RemoveTemporaryFiles(directory)
     except:
       wx.MessageBox('Failed to remove all temporary files from\n%s' % directory,'Error',parent=self,style=wx.OK|wx.CENTRE|wx.ICON_ERROR)
   except Exception,e:
     wx.MessageBox('Failed to remux file:\n'+str(e),'Error',parent=self,style=wx.OK|wx.CENTRE|wx.ICON_ERROR)
Exemplo n.º 2
0
#!/usr/bin/env python

import os

os.environ['MESHUGGAHME_AVCONV_PATH'] = '/usr/bin/avconv'
os.environ['MESHUGGAHME_YTDL_PATH'] = '/home/phaedrus/repos/meshuggahme/muxer/youtube-dl'
os.environ['MESHUGGAHME_DL_PATH'] = '/home/phaedrus/tmp/meshuggahme/dl'
os.environ['MESHUGGAHME_OUTPUT_PATH'] = '/home/phaedrus/tmp/meshuggahme/out'

from muxer import Muxer

gojira = 'https://www.youtube.com/watch?v=BGHlZwMYO9g'
#spears = 'https://www.youtube.com/watch?v=LOZuxwVk7TU'
spears = 'https://youtu.be/LOZuxwVk7TU'

if __name__ == '__main__':
    gojira_muxer = Muxer(yt_url=gojira)
    spears_muxer = Muxer(yt_url=spears)

    gojira_muxer.download_video()
    spears_muxer.download_video()

    gojira_muxer.demux()
    spears_muxer.demux()

    spears_muxer.remux(gojira_muxer.get_audio_file())


Exemplo n.º 3
0
def muxer_worker():
    global redis
    global onset_dicts, onset_dir, X, Y, Z

    while True:
        try:
            yt_url = redis.lpop('yturls')
            if yt_url is None:
                time.sleep(10)
            else:
                m = Muxer(yt_url=yt_url)
                m.download_video()
                with open(
                    '{output_dir}/{ytid}.status.json'.format(output_dir=output_dir, ytid=m.ytid), 'w'
                ) as f:
                    f.write('{"status": "processing", "stage": 1}')
                m.demux()
                with open(
                    '{output_dir}/{ytid}.status.json'.format(output_dir=output_dir, ytid=m.ytid), 'w'
                ) as f:
                    f.write('{"status": "processing", "stage": 2}')
                m.convert_to_wav()
                with open(
                    '{output_dir}/{ytid}.status.json'.format(output_dir=output_dir, ytid=m.ytid), 'w'
                ) as f:
                    f.write('{"status": "processing", "stage": 3}')
                # XXX: Call meshuggahfier here, and use its output in place of m.get_audio_file()
                meshuggahfied_file = '{output_path}/{ytid}mm.wav'.format(
                    output_path=m.output_dir, ytid=m.ytid
                )
                if not os.path.exists(meshuggahfied_file):
                    meshuggahme(
                        m.get_audio_file(),
                        X, improve_func=improve_log_no_loudness,
                        onset_dicts=onset_dicts, onset_dir=onset_dir,
                        metric='correlation', output_file=meshuggahfied_file,
                        original_w=10
                    )
                with open(
                    '{output_dir}/{ytid}.status.json'.format(output_dir=output_dir, ytid=m.ytid), 'w'
                ) as f:
                    f.write('{"status": "processing", "stage": 4}')
                meshuggahfied_file = m.compress_wav(meshuggahfied_file)
                with open(
                    '{output_dir}/{ytid}.status.json'.format(output_dir=output_dir, ytid=m.ytid), 'w'
                ) as f:
                    f.write('{"status": "processing", "stage": 5}')
                m.remux(meshuggahfied_file).split('/')[-1]
                with open(
                    '{output_dir}/{ytid}.status.json'.format(output_dir=output_dir, ytid=m.ytid), 'w'
                ) as f:
                    f.write('{"status": "complete"}')
        except Exception as e:
            print repr(e)
Exemplo n.º 4
0
my_logger.info("video recording delay: " + str(video_rec_delay) + " frames: " + str(video_offset) + " seconds")
my_logger.info("audio recording delay: " + str(audio_rec_delay) + " frames: " + str(audio_offset) + " seconds")

my_logger.info("camera settings: " + str(camera_width)+"x"+str(camera_height) + " @ " + str(camera_fps) + "fps. [" + str(camera_hflip) + "," + str(camera_vflip) + "]")



############################
# initally wipe the locks
############################
wipeAllLocks(rec_folder)

############################
# setup muxer
############################
mx = Muxer(rec_folder, rec_folder_a, out_folder, backup_folder)
mx.setLock(rec_lock)
mx.setFPS(camera_fps)

# print "ready to record..."

############################
# main loop
############################
while True:
    try:
        sleep(0.5)

        now = time.time()
        if record_started > 0:
            if (now - record_started) > recording_duration:
Exemplo n.º 5
0
my_logger.info("audio recording delay: " + str(audio_rec_delay) + " frames: " +
               str(audio_offset) + " seconds")

my_logger.info("camera settings: " + str(camera_width) + "x" +
               str(camera_height) + " @ " + str(camera_fps) + "fps. [" +
               str(camera_hflip) + "," + str(camera_vflip) + "]")

############################
# initally wipe the locks
############################
wipeAllLocks(rec_folder)

############################
# setup muxer
############################
mx = Muxer(rec_folder, rec_folder_a, out_folder, backup_folder)
mx.setLock(rec_lock)
mx.setFPS(camera_fps)

# print "ready to record..."

############################
# main loop
############################
while True:
    try:
        sleep(0.5)

        now = time.time()
        if record_started > 0:
            if (now - record_started) > recording_duration: