Compare commits

...

2 Commits

Author SHA1 Message Date
e0124c0ff3 test 2025-10-04 14:22:39 +02:00
7e14afcb84 cleanup 2025-10-04 14:22:11 +02:00
12 changed files with 45 additions and 15 deletions

View File

@ -20,7 +20,7 @@ include_directory="build/include"
lib_directory="build/lib"
build_directory="build/${source_directory}"
install_directory="build"
install_library_directory="mp4"
install_library_directory="pyav"
mkdir -p ${build_directory}
mkdir -p ${install_directory}
@ -48,6 +48,8 @@ ${absolute_source_directory}/configure \
--disable-programs \
--disable-avdevice \
--disable-avfilter \
--disable-swresample \
--disable-swscale \
--disable-network \
--disable-manpages \
--disable-podpages \

19
make/make-all.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
# People's Video Editor: high quality, GPU accelerated mp4 editor
# Copyright (C) 2025 Roz K <roz@rozk.net>
#
# This file is part of People's Video Editor.
#
# People's Video Editor is free software: you can redistribute it and/or modify it under the terms of the
# GNU General Public License as published by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# People's Video Editor is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with People's Video Editor.
# If not, see <https://www.gnu.org/licenses/>.
./make/make-x264.sh
./make/make-ffmpeg.sh

35
pve.py
View File

@ -14,8 +14,10 @@
# You should have received a copy of the GNU General Public License along with People's Video Editor.
# If not, see <https://www.gnu.org/licenses/>.
from mp4.demuxer import Demuxer
from mp4.decoder import Decoder
import cProfile
from pyav.demuxer import Demuxer
from pyav.decoder import Decoder
demuxer = Demuxer('test.mp4')
@ -26,14 +28,21 @@ print(f"audio codec = {demuxer.audio_stream.codec.name}")
video_decoder = Decoder(demuxer.video_stream)
audio_decoder = Decoder(demuxer.audio_stream)
while True:
packet = demuxer.read_packet()
eof = (packet is None)
if eof or demuxer.video_stream.contains(packet):
video_frames = video_decoder.decode(packet)
print(f"decoded {len(video_frames)} video frames")
if eof or demuxer.audio_stream.contains(packet):
audio_frames = audio_decoder.decode(packet)
print(f"decoded {len(audio_frames)} audio frames")
if eof:
break
num_frames = 0
with cProfile.Profile() as pr:
while True:
packet = demuxer.read_packet()
eof = (packet is None)
if eof or demuxer.video_stream.contains(packet):
video_frames = video_decoder.decode(packet)
num_frames += len(video_frames)
# print(f"decoded {len(video_frames)} video frames")
if eof or demuxer.audio_stream.contains(packet):
audio_frames = audio_decoder.decode(packet)
# print(f"decoded {len(audio_frames)} audio frames")
if eof:
break
print(f"num frames: {num_frames}")
pr.print_stats()

2
pve.sh
View File

@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License along with People's Video Editor.
# If not, see <https://www.gnu.org/licenses/>.
shared_library_path="./mp4"
shared_library_path="./pyav"
absolute_shared_library_path=$(realpath ${shared_library_path})
LD_LIBRARY_PATH=${absolute_shared_library_path} \