diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..757be1e Binary files /dev/null and b/.DS_Store differ diff --git a/create_image.py b/create_image.py new file mode 100644 index 0000000..db8d907 --- /dev/null +++ b/create_image.py @@ -0,0 +1,9 @@ +from PIL import Image, ImageDraw, ImageFont + +def reddit(img, title): + i = Image.open(img) + d = ImageDraw.Draw(i) + d.text((28, 36), title, fill=(255, 0, 0)) + # fnt = ImageFont.truetype('Pillow/Tests/fonts/FreeMono.ttf', 40) + i.save(fp=i+'.png') + return True \ No newline at end of file diff --git a/ffmpeg b/ffmpeg new file mode 100755 index 0000000..1c6694a Binary files /dev/null and b/ffmpeg differ diff --git a/image.png b/image.png new file mode 100644 index 0000000..d0db9ad Binary files /dev/null and b/image.png differ diff --git a/out.mp4 b/out.mp4 new file mode 100644 index 0000000..0725cab Binary files /dev/null and b/out.mp4 differ diff --git a/out2.mp4 b/out2.mp4 new file mode 100644 index 0000000..dc6e8c7 Binary files /dev/null and b/out2.mp4 differ diff --git a/process_video.py b/process_video.py index 3919c1d..8f2001c 100644 --- a/process_video.py +++ b/process_video.py @@ -1,2 +1,31 @@ import ffmpeg +def add_title(iv, ii): + ( + ffmpeg + .input(iv) + .overlay(ffmpeg.input(ii), x=0, y=420) + .output('out2.mp4') + .run(cmd='./ffmpeg', overwrite_output=True) + ) + # vid = ffmpeg.input(iv) + # pic = ffmpeg.input(ii) + # vid = ffmpeg.overlay(vid, pic) + # vid = ffmpeg.output('out.mp4') + # vid = ffmpeg.run(vid) + +# add_title(iv='out.mp4', ii='image.png') + +def initialize_video(iv, t): + ( + ffmpeg + .input(iv) + .filter("crop", f"ih*({1080}/{1920})", f"iw*({1080}/{1920})") + .output(segment_time='1', f='segment', reset_timestamps='1', filename=f'segments/output%03d.mp4') + .run(cmd='./ffmpeg', overwrite_output=True) + ) + +initialize_video('video.mp4', 1) +add_title('out.mp4', 'image.png') + +ffmpeg.output \ No newline at end of file diff --git a/reddit.py b/reddit.py new file mode 100644 index 0000000..69cd448 --- /dev/null +++ b/reddit.py @@ -0,0 +1,14 @@ +import praw + +reddit = praw.Reddit( + client_id="my client id", + client_secret="my client secret", + user_agent="my user agent", +) + +def get_posts(): + ids = [] + for submission in reddit.subreddit("news").new(limit=10): + ids.append(submission.id) + return ids + diff --git a/segments/output000.mp4 b/segments/output000.mp4 new file mode 100644 index 0000000..32f3af7 Binary files /dev/null and b/segments/output000.mp4 differ diff --git a/video.mp4 b/video.mp4 new file mode 100644 index 0000000..7936dc0 Binary files /dev/null and b/video.mp4 differ diff --git a/video_0.mp4 b/video_0.mp4 new file mode 100644 index 0000000..32f3af7 Binary files /dev/null and b/video_0.mp4 differ