Comments (3)
Based on your function, it seems like you're not trying to change anything about the video. Consider looking at using ffmpeg (which you have installed already) if all you want to do is just convert the container from MOV to MP4. I've also heard good things about handbrake. This doesn't change anything about the video and maintains the size and quality.
Links for help:
https://askubuntu.com/questions/396883/how-to-simply-convert-video-files-i-e-mkv-to-mp4
https://askubuntu.com/questions/50433/how-to-convert-mkv-file-into-mp4-file-losslessly
https://superuser.com/questions/1155186/convert-mov-video-to-mp4-with-ffmpeg.
from moviepy.
I also got this issue too. Finally I chose FFMPEG command to address it instead of MoviePy.
Command:
ffmpeg -an -i IMG_6859.MOV -stream_loop -1 -i res/audio/audio.wav -c:v copy -t 60 -y out.mp4
Here is my code :
import subprocess
ffmpeg_command = [
'ffmpeg',
'-an', # 禁用音频输入
'-i', 'IMG_6859.MOV', # 输入视频文件
'-stream_loop', '-1', # 无限循环音频输入
'-i', 'res/audio/music.mp3', # 输入音频文件
'-c:v', 'copy', # 复制视频流,不进行重新编码
'-t', '60', # 设置输出时长为60秒
'-y', # 如果输出文件已存在,则覆盖它
'out.mp4' # 输出文件
]
result = subprocess.run(ffmpeg_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
if result.returncode != 0:
print("Error executing command:")
print(result.stderr)
else:
print("Command executed successfully.")
# print(result.stdout)
from moviepy.
It seems that your video has the rotate param but moviepy doesn't support it very well, I guess...:)
from moviepy.
Related Issues (20)
- how to keep the aspect ratio for my vertical video? HOT 5
- I cut 1800 seconds of audio, but the result is 1846 seconds. Why is this happening? How can I solve this problem?
- Resizable rounded rectangle
- Getting `AttributeError: 'NoneType' object has no attribute 'get_frame'` when trying to save a `CompositeVideoClip`
- Error When Generating a Long video and not getting the error when generating a shorter video HOT 1
- AttributeError: 'NoneType' object has no attribute 'get_frame' when calling write_videofile HOT 1
- yielding write_videofile progress HOT 5
- Output video without sound
- Inconsistent video duration before and after write_videofile HOT 1
- Audio glitching when concatenating with moviepy
- Error Using MoviePy in Django Project on Linux (Python 3.12, MoviePy 1.0.3)
- Adapt to setuptools v72 HOT 4
- How to obtain an AudioArrayClip or AudioFileClip object from a MP3 BytesIO object?
- CompositeAudioClip not compute duration
- Documentation in a PDF or any other downloadable format please?
- Incorrect Rendering of Bengali Ligatures in Subtitles Using MoviePy HOT 2
- How to set opacity in text_clip using Lambda HOT 1
- Moviepy unable to concatenate a long list of videos but is able to concatenate a short list of videos
- Masking fail when using VideoClip.subclip() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moviepy.