kanehekili / videocut Goto Github PK
View Code? Open in Web Editor NEWMPEG2,MP4,MKV,WEBM Cutter for Linux using MPV and libavcodec or ffmpeg. Cutting is lossless, the target file will not be reencoded
License: Other
MPEG2,MP4,MKV,WEBM Cutter for Linux using MPV and libavcodec or ffmpeg. Cutting is lossless, the target file will not be reencoded
License: Other
Hello,
This application seems interesting, though I have no idea how to install it. I have packaged ~85 packages for NixOS, many of which are Python packages, and this repository, seems to be written in Python, doesn't adhere to any standard, and I have no idea where to start when building it - there is no setup.py
, no pyproject.toml
etc.. I found some Makefile
s in non-standard locations, but I didn't understand what they are for...
I may be able to help with that after I'll put my mind to it, but in the meantime it'd be great if you'll show interest in fixing this.
Traceback (most recent call last):
Arch linux, version videocut-2.2.0-1
If more than 2 cutting marks are present, the movie is not saved.
Please declare the license.
How ti fix it?thanks again!
Bonjour,
I'm french and like original version movies with original language and french subtitles but, when editing a m2t file (kaffeine dvt-tv one) with videocut, I get this error and no selection of language and subtitle when playing back :
Traceback (most recent call last):
cordialement,
Just found your app and its amazing.
i have a suggestion :
i dont want to delete some parts.just want to speed up some un-wanted parts.
may you please add this option ?
thanks.
Hi,
I read your post here:
https://askubuntu.com/questions/1304004/how-to-edit-mkv-with-subtitles-and-keep-the-subs
I would find it useful to be able to edit video and subtitles at the same time, for occasional films.
It is a little time consuming to using a video editor to make cuts, then a subtitle editor to make all the same cuts to the subtitles.
However, when I tried to edit a video with soft subtitles (.srt) within an mkv container. VideoCut did not seem to import them.
I have uploaded sample video files below, from before and after trimming with VideoCut. The subtitles do not make it into the output file.
Are subtitles supported for the mkv container?
Input:
https://github.com/lxs602/Test/blob/main/DEFA%20-%20East%20German%20trailer%20subs.mkv
Output:
https://github.com/lxs602/Test/blob/main/DEFA%20-%20East%20German%20trailer%20subs-cut.mkv
Log from terminal:
user@user-pc:~/Downloads/videocut$ VideoCut
using CV3
qt5ct: using qt5ct plugin
libpng warning: iCCP: known incorrect sRGB profile
qt5ct: D-Bus global menu: no
4.2
['/opt/videocut/ffmpeg/bin/V4/remux5', '-i', '/home/user/Videos/DEFA - East German trailer subs.mkv', '-s', '00.000,20.720', >'/home/user/Videos/DEFA - East German trailer subs-cut.mkv']
<Input #0, matroska,webm, from '/home/luke/Videos/DEFA - East German trailer subs.mkv':
< Metadata:
< ENCODER : Lavf58.29.100
< Duration: 00:00:30.98, start: 0.000000, bitrate: 6462 kb/s
< Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, top first), 720x576 [SAR 16:15 DAR 4:3], SAR 1:1 DAR 5:4, 25 fps, >>25 tbr, 1k tbn, 50 tbc (default)
< Metadata:
< DURATION : 00:00:30.640000000
< Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16p, 192 kb/s (default)
< Metadata:
< DURATION : 00:00:30.744000000
< Stream #0:2: Subtitle: subrip
< Metadata:
< DURATION : 00:00:30.979000000
<Registered 4 decoding threads
<MPEG2 set to PS-stream
.<Video bitrate: 6462640
<Audio: sample rate: 48000 bitrate: 192000
<Output #0, matroska, to '/home/user/Videos/DEFA - East German trailer subs-cut.mkv':
< Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, top first), 720x576 [SAR 16:15 DAR 4:3], q=2-31, 25 fps
< Side data:
< cpb: bitrate max/min/avg: 96939600/4308426/6462640 buffer size: 2072576 vbv_delay: -1
< Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16p, 192 kb/s
<Video length is about 20.72 seconds
<Mux video - Offset: 0 (0.000) fps: 25.000 audio -offset 240 (0.240) delta:-240 (-0.240)
<First IFrame DTS found: 0, normalized: 0 (0.000) mainOffset: 240 (0.24000) voutDelta:40.000
<Video tbi: 1000 tbo: 1000 ; Audio tbi: 1000 tbo: 1000
<Video IN: matroska,webm long:Matroska / WebM
<Video OUT: matroska long:Matroska
<Done
<Args: /home/user/Videos/DEFA - East German trailer subs.mkv -> /home/user/Videos/DEFA - East German trailer subs-cut.mkv
Additionally, in the documentation it mentions that Videocut may not cut to exact frames.
I think, though, that it would be useful to know exactly where you are cutting...
For example, I know that some video editors cut to keyframes, so this is just a suggestion for something which I think would be beneficial.
Best wishes,
L
So, just for kicks I tried to remux this file
./remux5 -i ~/tsMuxer/DVCPROHD_1080i50.qt -s 000.000,002.000 -l eng dvcpro_cut.mov
file itself from
http://samples.mplayerhq.hu/mov/FCP/DVCPROHD_1080i50.mov
for some reason if i cut from 0.0 to 1 sec I see no audio in output, but if I cut to two seconds I see audio, but just 1 sec long )
remux5 was compiled on aarch64/termux against ffmpeg 5.1.2 libs ...
I also wonder if you might like to hack same feature into our ffmpeg-based NLE called Cinelerra-GG, but this is loooong shot.
As in the previous version, still report errors when saving files。Here the logs
Traceback (most recent call last):
File "C:/Users/Bugs/Desktop/VideoCut-master/src/VideoCut.py", line 2020, in run
self.function(*self.arguments)
File "C:/Users/Bugs/Desktop/VideoCut-master/src/VideoCut.py", line 1801, in __directCut
if self.cutter.setupBinary():
File "C:\Users\Bugs\Desktop\VideoCut-master\src\FFMPEGTools.py", line 1491, in setupBinary
fv = FFmpegVersion()
File "C:\Users\Bugs\Desktop\VideoCut-master\src\FFMPEGTools.py", line 1620, in init
self.figureItOut()
File "C:\Users\Bugs\Desktop\VideoCut-master\src\FFMPEGTools.py", line 1623, in figureItOut
result = subprocess.Popen(["/usr/bin/ffmpeg", "-version"], stdout=subprocess.PIPE).communicate()
File "C:\Users\Bugs\anaconda3\lib\subprocess.py", line 858, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Bugs\anaconda3\lib\subprocess.py", line 1311, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified.
Like 1.3.2, I found that the error aslo was caused by the Class 'cutter' in 1.3.3, my platform is win11,anaconda , I tried to write a function ‘cut' in the Class 'Cutter' to solve the error. It works on my computer.Here is, in VCCuter.
def myCut(self, cutlist):
for index, cutmark in enumerate(cutlist):
t1 = cutmark[0].timePos
t2 = cutmark[1].timePos
cmd = ["ffmpeg","-i", self.config.srcfilePath, "-codec", "copy", "-ss", timedeltaToString2(t1), "-to", timedeltaToString2(t2), self.config.targetPath]
print(cmd)
log("cut file:", cmd)
try:
executeCmd(cmd)
except Exception as error:
self.warn("Remux failed: %s" % (error))
log("Remux failed", error)
self.runningProcess = None
return False
self.say("Cutting done")
self.runningProcess = None
return True
then, in videocut line 1820 Called this function. it works.
Request from moebius1 to support DVB_SUBTITLE in mpegts streams
Debian 11 Bookworm, all dependencies are installed but libmpv1 - there is only libmpv2 in repos, installed in hope to substitute.
Any help, perhaps?
The precise cut is good but it compresses the output audio and video and I wanna change that. Since there's nothing about that in the config file, where in the source code do you set the ffmpeg audio and video bitrate for output?
Error while trying to save video with other from ".mp4" file extesion. Original video format .mov. But program automaticly add ".mp4". Make extension of saving video be like in source video.
Greetings, it may be worth adding "intervals" for cutting video. I will explain what is it -
The interval has a beginning and an end, everything that includes into it - is included in the final file. One project can have one or more than one intervals. So It replace current start/stop points system, 'cause it will group one start and one stop together. So later we can add some "processors" per selected interval, like: video speed control, any sound tunnings(for example like I requested in my last issue), and etc. I think this feature will get new LEVEL_UP for VideoCut. Also would be nice to have some previews of start/stop (or of start only).
If You don't like this idea, please close/cancel/reject this issue.
Since I have a hobby of filming on RC planes / quadcopters, I often get footage in H.265 encoding, but unfortunately when using Davinci Resolve for color grading and etc, in Linux there is a problem with this encoding, since it is proprietary. It would be very cool if VideoCut could transcode videos to other formats. For example "lossless" mjpeg. Very often I have to use the following one-liner -
ffmpeg -i $1 -vcodec mjpeg -q:v 2 -an -f mov $2
. I haven't yet been able to understand the code of the FFMPEGTools.py, to do this my self.
Hi, great tool! :-)
Just one minor issue: if I want to save a video that has no audio stream, it fails, see below.
I created a video just as a screen capture from my desktop for educational purposes, without the need for audio.
Here is what I used:
ffmpeg -video_size 1024x768 -framerate 25 -f x11grab -i :0.0+100,200 output.mp4
from https://trac.ffmpeg.org/wiki/Capture/Desktop
Log:
generate file: my.mp4
video: h264
Traceback (most recent call last):
File "VideoCut.py", line 1255, in run
self.function(*self.arguments)
File "VideoCut.py", line 1088, in __makeCuts
hasSucess = cutter.cutPart(t1, t2, index,slices)
File "/home/ssi/dev/VideoCut/VideoCutter/build/videocut/FFMPEGTools.py", line 632, in cutPart
audioMode = self._audioMode(self.MODE_CUT)
File "/home/ssi/dev/VideoCut/VideoCutter/build/videocut/FFMPEGTools.py", line 664, in _audioMode
log("audio:",self._config.streamData.getAudioStream().getCodec())
AttributeError: 'NoneType' object has no attribute 'getCodec'
I could simply resolve that by checking, if there is no audio stream, in which case I returned an empty array. This way, my cut video was saved perfectly!
in FFMPEGTools.py, line 664, in _audioMode
I added right at the beginning:
if not self._config.streamData.getAudioStream():
log("audio:","None")
return []
It is worth adding the possibility that the pieces of the video could be assembled in a different order, for example, at the beginning a piece from the end, and at the end a piece from the beginning. For those moments when you need a mandatory sequence of frames (Ascending), you can add the STRICT mode.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.