コード例 #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 _cut_orig_mp4(orig_mp4_filename, cut_mp4_filename, lang, line):
    # title.make_mp4_with_title(orig_mp4_filename, lang)
    cmd = ['ffmpeg', '-y', '-i', orig_mp4_filename, '-c', 'copy']
    cmd += ffmpeg.meta_args(orig_mp4_filename, lang)
    cmd += ffmpeg.ss_args(orig_mp4_filename)
    cmd += ffmpeg.to_args(orig_mp4_filename)
    cmd += [cut_mp4_filename]
    _run_ffmpeg_at_line(cmd, line, 'mkv')
コード例 #4
0
def _cut_orig_m4a(orig_mp4_filename, lang, line):
    cmd = ['ffmpeg', '-y',
           '-i', orig_mp4_filename]
    cmd += ffmpeg.meta_args(orig_mp4_filename, lang)
    cmd += ffmpeg.ss_args(orig_mp4_filename)
    cmd += ffmpeg.to_args(orig_mp4_filename)
    cmd += ['-c:a', 'copy', '-vn',
            meta.get_work_filename(orig_mp4_filename, ' ' + lang + '.m4a')]
    _run_ffmpeg_at_line(cmd, line, 'm4a')
コード例 #5
0
def _encode_orig_mp3(orig_mp4_filename, lang, line):
    cmd = ['ffmpeg', '-y',
           '-i', orig_mp4_filename,
           '-ac', '1',
           '-codec:a', 'mp3', '-b:a', '96k']
    cmd += ffmpeg.ss_args(orig_mp4_filename)
    cmd += ffmpeg.to_args(orig_mp4_filename)
    cmd += ffmpeg.meta_args(orig_mp4_filename, lang)
    cmd += [meta.get_work_filename(orig_mp4_filename, ' ' + lang + '.mp3')]
    _run_ffmpeg_at_line(cmd, line, 'mp3')
コード例 #6
0
def _create_mp3_ru_stereo(filename):
    cmd = [
        'ffmpeg', '-y', '-i',
        (meta.get_work_filename(filename, ' ru_mixdown.wav')), '-codec:a',
        'mp3', '-b:a', '128k'
    ]
    cmd += ffmpeg.ss_args(filename)
    cmd += ffmpeg.to_args(filename)
    cmd += ffmpeg.meta_args_ru_stereo(filename)
    cmd += [meta.get_work_filename(filename, ' ru_stereo.mp3')]
    subprocess.run(cmd, check=True)
コード例 #7
0
ファイル: title.py プロジェクト: santinoled/video-scripts
def make_rest_ts(orig_mp4_filename, lang, title_end_time):
    ts_rest_filename = meta.get_work_filename(
        orig_mp4_filename, ' {lang}_rest.ts'.format(lang=lang))
    cmd = [
        'ffmpeg', '-y', '-i', orig_mp4_filename, '-c', 'copy', '-bsf:v',
        'h264_mp4toannexb'
    ]
    cmd += ['-ss', str(title_end_time)]
    cmd += ffmpeg.to_args(orig_mp4_filename)
    cmd += [ts_rest_filename]
    print(cmd)
    subprocess.run(cmd)
    return ts_rest_filename