Пример #1
0
def _create_and_upload_ru_mono_video(orig_mp4_filename, ts_title_filename,
                                     ts_rest_filename):
    concat_str = _get_concat_args(ts_title_filename, ts_rest_filename)
    ru_mono_titled_mp4_filename = meta.get_work_filename(
        orig_mp4_filename, ' ru_mono titled.mkv')
    cmd = [
        'D:\\video\\GoswamiMj-videos\\ffmpeg-hi8-heaac.exe', '-y', '-i',
        concat_str
    ]
    cmd += ffmpeg.ss_args(orig_mp4_filename)
    cmd += ['-i', meta.get_work_filename(orig_mp4_filename, ' ru_mixdown.wav')]
    cmd += ['-c:v', 'copy']
    cmd += ['-c:a', 'libfdk_aac']
    cmd += ['-ac', '1']  # mono
    cmd += ffmpeg.to_args(orig_mp4_filename)
    cmd += ['-shortest']
    cmd += [ru_mono_titled_mp4_filename]
    os.chdir('D:\\video\GoswamiMj-videos')
    subprocess.run(cmd, check=True)
    os.chdir('C:\\Users\\ashutosh\\Dropbox\\Reference\S\scripts')

    title = meta.get_youtube_title_ru_mono(orig_mp4_filename)
    description = meta.get_youtube_description_ru_mono(orig_mp4_filename)
    youtube_id = my_youtube.upload(ru_mono_titled_mp4_filename,
                                   title=title,
                                   description=description,
                                   lang='ru')
    meta.update_yaml(orig_mp4_filename, 'youtube_id_rus_mono', youtube_id)
Пример #2
0
def _create_and_upload_ru_mono_video(orig_mp4_filename):
    ru_mono_m4a_filename = meta.get_work_filename(orig_mp4_filename,
                                                  ' ru_mono.m4a')
    cmd = [
        'D:\\video\\GoswamiMj-videos\\ffmpeg-hi8-heaac.exe', '-y', '-i',
        meta.get_work_filename(orig_mp4_filename,
                               ' ru_mixdown.wav'), '-c:a', 'libfdk_aac', '-ac',
        '1', '-b:a', '128k', '-metadata:s:a:0', 'language=rus'
    ]
    cmd += ffmpeg.meta_args_ru_mono(orig_mp4_filename)
    cmd += [ru_mono_m4a_filename]
    subprocess.run(cmd, check=True)

    ru_mono_video_filename = meta.get_work_filename(orig_mp4_filename,
                                                    ' ru_mono.mkv')
    cmd = [
        'ffmpeg', '-y', '-i', orig_mp4_filename, '-i', ru_mono_m4a_filename,
        '-map', '0:v', '-map', '1:a', '-c', 'copy'
    ]
    cmd += ffmpeg.meta_args_ru_mono(orig_mp4_filename)
    cmd += ffmpeg.ss_args(orig_mp4_filename)
    cmd += ffmpeg.to_args(orig_mp4_filename)
    cmd += [ru_mono_video_filename]
    subprocess.run(cmd, check=True)

    title = meta.get_youtube_title_ru_mono(orig_mp4_filename)
    description = meta.get_youtube_description_ru_mono(orig_mp4_filename)
    youtube_id = my_youtube.upload(ru_mono_video_filename,
                                   title=title,
                                   description=description,
                                   lang='ru')
    meta.update_yaml(orig_mp4_filename, 'youtube_id_rus_mono', youtube_id)
Пример #3
0
 def test_get_youtube_title_ru_mono(self):
     filename = self.get_test_filename('2016-10-12 brmadhusudan.mp4')
     expected = 'Удача Чиангмайского ашрама (моно). Бхакти Ран̃джан Мадхусӯдан'
     self.assertEqual(expected, meta.get_youtube_title_ru_mono(filename))
Пример #4
0
 def test_get_youtube_title_ru_mono_question_mark(self):
     filename = self.get_test_filename('2016-10-05 goswamimj.mp4')
     expected = 'Настроение или сердце? (моно) Бхакти Судхӣр Госва̄мӣ'
     self.assertEqual(expected, meta.get_youtube_title_ru_mono(filename))
Пример #5
0
 def test_get_youtube_title_ru_mono_dot(self):
     filename = self.get_test_filename('2016-01-01 goswamimj.mp4')
     expected = 'Проверка точки (моно). Бхакти Судхӣр Госва̄мӣ'
     self.assertEqual(expected, meta.get_youtube_title_ru_mono(filename))