Giter VIP home page Giter VIP logo

Comments (3)

harroopsra avatar harroopsra commented on August 29, 2024

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.

zengqiang24 avatar zengqiang24 commented on August 29, 2024

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.

byscut avatar byscut commented on August 29, 2024

It seems that your video has the rotate param but moviepy doesn't support it very well, I guess...:)

from moviepy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.