chldydgh4687 / 00Self-Linux_trial_and_error

Linux & DeepLearning
0 stars 0 forks source link

[Solved] [S2VT] 1. 영상 다운로드 2. 영상 짜르기 #22

Open chldydgh4687 opened 4 years ago

chldydgh4687 commented 4 years ago
  1. pytube

    • urlib.request 오류 못찾아서 2번 방법으로 변경..
  2. youtubeDL https://www.programcreek.com/python/example/98358/youtube_dl.YoutubeDL

chldydgh4687 commented 4 years ago

ffmpeg (youtube-dl -g ([link)] | sed "s/.*/-ss 10 -i &/") -t 60 -c copy test3.mkv

chldydgh4687 commented 4 years ago

os.system("") – PrinceOfCreation Feb 23 '19 at 18:41 I tried but it is not working os.system("ffmpeg ([link)] | sed 's/.*/-ss 10 -i &/') -t 60 -c copy test3.mkv") – Anish Mazumdar Feb 24 '19 at 5:48

chldydgh4687 commented 4 years ago

ffmpeg -ss 12:15 -i "1st-URL" -ss 12:15 -i "2nd-URL" -t 5:15 -map 0:v -map 1:a -c:v libx264 -c:a aac output.mkv

chldydgh4687 commented 4 years ago

ffmpeg -ss 00:00:15.00 -i "OUTPUT-OF-FIRST URL" -t 00:00:10.00 -c copy out.mp4

chldydgh4687 commented 4 years ago

youtube-dl -g "https://www.youtube.com/watch?v=V_f2QkBdbRI"

chldydgh4687 commented 4 years ago

ffmpeg $(youtube-dl -g 'https://www.youtube.com/watch?v=oHg5SJYRHA0' | sed "s/.*/-ss 00:05 -i &/") -t 01:00 -c copy out.mkv

chldydgh4687 commented 4 years ago

SET /P url= FOR /F %%A IN ('youtube-dl.exe -g %url%') DO ( ffmpeg.exe -ss 00:41:55 -i "%%A" -c copy -t 00:03:00 output.mp4 )

chldydgh4687 commented 4 years ago

ffmpeg $(youtube-dl -g 'https://www.youtube.com/watch?v=NnW5EjwtE2U' | sed "s/.*/-ss 10 -i &/") -t 60 -c copy test3.mkv

chldydgh4687 commented 4 years ago

성공

# from pytube import YouTube
from __future__ import unicode_literals
import os
import youtube_dl
import urllib
import shutil

TEXT_DIR = '/home/ivcl/Desktop/git/video-captioning/text_files/'
Vid2Url = eval(open(TEXT_DIR + 'Vid2Url_Full.txt').read())
video_id = str(Vid2Url['vid1547'])
video_url = 'https://www.youtube.com/watch?v='+ video_id

print('https://www.youtube.com/watch?v='+ video_id)

ydl_opts = {
    'format' : 'best/best',
    'outtmpl': ("/home/ivcl/Desktop/git/video-captioning/Data/YouTubeClips/test"),
    'merge_output_format' : 'ffmpeg',
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    ydl.download([video_url])

os.chdir('/home/ivcl/Desktop/git/video-captioning/Data/YouTubeClips/')
os.system('ffmpeg -ss 00:01:44 -i test -t 00:00:06 -vcodec copy -acodec copy test_m.mp4')
os.chdir('/home/ivcl/Desktop/git/video-captioning')