Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita924e45

Browse files
committed
.
1 parent32a7bd6 commita924e45

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed

‎image-converter/README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#Image Converter
2+
3+
Bunu GUI ile proje olarak yapıcam. şimdilik ismi dursun

‎mp4-converter/README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#MP4 CONVERTER
2+
3+
Bunu GUI ile proje olarak yapıcam. şimdilik ismi dursun.

‎mp4-converter/mp4_conv.py‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#import subprocess; subprocess.run(['ffmpeg', '-i', 'a.mp4', '-vf', 'scale=-1:1080', 'movie_resized.mp4'])
2+
3+
############### ALTERNATIVE METHOD USING MOVIEPY ####################
4+
5+
frommoviepy.video.io.VideoFileClipimportVideoFileClip
6+
7+
clip=VideoFileClip("a.mp4")
8+
9+
# make the height 360px
10+
clip.resized(height=720)
11+
12+
clip.write_videofile("movie_resized.mp4")
13+
clip.close()
14+
15+
16+
############## ANOTHER WAY USING MOVIEPY ####################
17+
18+
""" ANOTHER WAY
19+
import moviepy.editor as mp
20+
21+
clip = mp.VideoFileClip("a.mp4")
22+
23+
# make the height 360px ( According to moviePy documenation The width is then computed so that the width/height ratio is conserved.)
24+
clip_resized = clip.resize(height=720)
25+
26+
clip_resized.write_videofile("movie_resized.mp4")
27+
"""

‎mp4-converter/mp4_to_mp3.py‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
importos
2+
frommoviepyimportVideoFileClip
3+
4+
defmp4_to_mp3(input_file:str,output_file:str|None=None):
5+
"""MP4 dosyasını MP3 formatına dönüştürür."""
6+
7+
ifnotos.path.exists(input_file):
8+
print(f"Hata: '{input_file}' dosyası bulunamadı!")
9+
returnFalse
10+
11+
output_file=output_fileoros.path.splitext(input_file)[0]+".mp3"
12+
13+
try:
14+
withVideoFileClip(input_file)asvideo:
15+
ifnotvideo.audio:
16+
print("Hata: Video dosyasında ses bulunamadı!")
17+
return
18+
else :video.audio.write_audiofile(output_file,verbose=False,logger=None)
19+
print(f"✅ Dönüştürme tamamlandı:{output_file}")
20+
returnTrue
21+
exceptExceptionase:
22+
print(f"❌ Hata:{e}")
23+
24+
25+
26+
27+
mp4_to_mp3("a.mp4")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp