Coder Social home page Coder Social logo

rezoo / movis Goto Github PK

View Code? Open in Web Editor NEW
297.0 297.0 15.0 19.38 MB

Python library for video editing, presentation video generation, motion graphics, shader art coding, and other video production tasks

Home Page: https://rezoo.github.io/movis/

License: MIT License

Python 100.00%
animation animation-engine motion-graphics python video video-editing video-processing

movis's People

Contributors

elijahsgh avatar rezoo avatar tomabou avatar zigai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

movis's Issues

List of advantages of using movis vs. existing libraries

Thanks for the great library and the corresponding documentation!

However, a new user which wants to do video editing and manipulation could ask: what are the advantages of using movis over the moviepy, which is a much older library with many releases already?

https://github.com/Zulko/moviepy

Maybe we could add a small section in the README and provide some overview over the video editing space available in Python ...

webm ffmpeg flags seem to not be right?

Code:

import movis as mv

scene = mv.layer.Composition(size=(1080, 1900), duration=4.0)
scene.write_video("output.webm")

Output:

[webm @ 0x6e9a600] Only VP8 or VP9 or AV1 video and Vorbis or Opus audio and WebVTT subtitles are supported for WebM.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 -- 
  1%|█▎       

Is this my version of ffmpeg or...? I'm not sure how to solve this.

Resizing Layers Properly

Hello!
First of all i love this package and its really great work & super fast. Just one question since I could not find documentation on how to properly resize layers.
I found a workaround like the following:

image = mv.layer.Image(media_path, duration=duration)
scale_factor = helper.scale_to_cover(
    target_size=self.scene_size, current_size=image.size
)
scene = mv.layer.Composition(size=self.scene_size, duration=duration)
scene.add_layer(image, scale=scale_factor)


def scale_to_cover(target_size, current_size):
    tw, th = target_size
    cw, ch = current_size
    width_ratio = tw / cw
    height_ratio = th / ch
    return max(width_ratio, height_ratio)

But wouldn't it be more convenient having a function like ‘concatenate’ or ‘crop’, so we don't have to create a second layer?

scene.write_video Error

layer = mv.layer.Video(r'D:\video\2\07.mp4')
scene = mv.trim(layer, start_times=[0.0, 2.0], end_times=[1.0, 3.0])
scene.write_video('06.mp4')

C:\Users\17632\AppData\Roaming\Python\Python310\site-packages\movis\layer\media.py:358: FutureWarning: PySoundFile failed. Trying audioread instead.
Audioread support is deprecated in librosa 0.10.0 and will be removed in version 1.0.
duration = librosa.get_duration(path=str(self._audio_file))
C:\Users\17632\AppData\Roaming\Python\Python310\site-packages\movis\layer\media.py:336: UserWarning: PySoundFile failed. Trying audioread instead.
audio, _ = librosa.load(str(self._audio_file), sr=AUDIO_SAMPLING_RATE, mono=False)
C:\Users\17632\AppData\Roaming\Python\Python310\site-packages\librosa\core\audio.py:183: FutureWarning: librosa.core.audio.__audioread_load
Deprecated as of librosa version 0.10.0.
It will be removed in librosa version 1.0.
y, sr_native = __audioread_load(path, offset, duration, dtype)
0%| | 0/60 [00:00<?, ?it/s]C:\Users\17632\AppData\Local\Temp\tmpy2kbmd1a.wav: Permission denied
2%|▏ | 1/60 [00:00<00:07, 7.83it/s]
Traceback (most recent call last):
File "C:\Users\17632\AppData\Roaming\Python\Python310\site-packages\imageio_ffmpeg_io.py", line 630, in write_frames
p.stdin.write(bb)
OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\ttdxg\Python\editvideo\test.py", line 61, in
scene.write_video('06.mp4')
File "C:\Users\17632\AppData\Roaming\Python\Python310\site-packages\movis\layer\composition.py", line 479, in write_video
self._write_video(start_time, end_time, fps, writer)
File "C:\Users\17632\AppData\Roaming\Python\Python310\site-packages\movis\layer\composition.py", line 410, in _write_video
writer.append_data(frame)
File "C:\Users\17632\AppData\Roaming\Python\Python310\site-packages\imageio\core\format.py", line 590, in append_data
return self._append_data(im, total_meta)
File "C:\Users\17632\AppData\Roaming\Python\Python310\site-packages\imageio\plugins\ffmpeg.py", line 600, in _append_data
self._write_gen.send(im)
File "C:\Users\17632\AppData\Roaming\Python\Python310\site-packages\imageio_ffmpeg_io.py", line 637, in write_frames
raise IOError(msg)
OSError: [Errno 22] Invalid argument

FFMPEG COMMAND:
C:\Users\17632\AppData\Roaming\Python\Python310\site-packages\imageio_ffmpeg\binaries\ffmpeg-win64-v4.2.2.exe -y -f rawvideo -vcodec rawvideo -s 1920x1080 -pix_fmt rgba -r 30.00 -i - -i C:\Users\17632\AppData\Local\Temp\tmpy2kbmd1a.wav -vcodec libx264 -pix_fmt yuv420p -v error -map 0:v:0 -map 1:a:0 D:\ttdxg\Python\editvideo\06.mp4

FFMPEG STDERR OUTPUT:

Please accept donation/support

Dear @rezoo , it might not give you a lot of money, but please enable for you to accept donation. I am using your library and would love to donate.

rtsp support

is movis support rtsp like imageio-ffmpeg and opencv ?

best regards

Add mv.ops.fade_in_out()

Related to #25

Current example

import movis as mv

video = mv.layer.Video('foo.mp4')
scene = mv.fade_in_out(video, fade_in_duration=5.0, fade_out_duration=5.0, fade_audio=True)

We will consider the detailed specifications later.

transition animation

How to add transition animations, such as fading in and out, when video stitching

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.