我目前正在尝试使用FFMPEG将我的视频源从各种分辨率缩小到最大宽度854和最大高度480.我想用模数/分频器最小缩放宽高比2.
目前这是我得到的: 规模= -2:'分钟(IH \,480)'
这仅适用于高度部分,但仍需要弄清楚如何进行宽度部分以及为两者保持-2分频器。有任何想法吗?感谢
答案 0 :(得分:2)
使用import requests
from bs4 import BeautifulSoup
def get_html():
url = 'https://www.nytimes.com/'
r = requests.get(url)
r_html = r.text
return r_html
def print_titles():
soup = BeautifulSoup(get_html(), 'html.parser')
titles = soup.findAll('h2', class_="story-heading")
for title in titles:
if title.a:
titles = title.a.text.replace('\n', ' ').strip()
#print(titles)
return titles
else:
titles = title.contents[0].strip()
#print(titles)
return titles
import NYTimesHeadings as nyt
def write_to_file():
with open('Write to File Test.txt', 'r+') as file:
file.write(str(nyt.print_titles()))
return file
write_to_file()