Compare commits
2 Commits
7ea498edc8
...
e0124c0ff3
| Author | SHA1 | Date | |
|---|---|---|---|
|
e0124c0ff3
|
|||
|
7e14afcb84
|
@ -20,7 +20,7 @@ include_directory="build/include"
|
|||||||
lib_directory="build/lib"
|
lib_directory="build/lib"
|
||||||
build_directory="build/${source_directory}"
|
build_directory="build/${source_directory}"
|
||||||
install_directory="build"
|
install_directory="build"
|
||||||
install_library_directory="mp4"
|
install_library_directory="pyav"
|
||||||
|
|
||||||
mkdir -p ${build_directory}
|
mkdir -p ${build_directory}
|
||||||
mkdir -p ${install_directory}
|
mkdir -p ${install_directory}
|
||||||
@ -48,6 +48,8 @@ ${absolute_source_directory}/configure \
|
|||||||
--disable-programs \
|
--disable-programs \
|
||||||
--disable-avdevice \
|
--disable-avdevice \
|
||||||
--disable-avfilter \
|
--disable-avfilter \
|
||||||
|
--disable-swresample \
|
||||||
|
--disable-swscale \
|
||||||
--disable-network \
|
--disable-network \
|
||||||
--disable-manpages \
|
--disable-manpages \
|
||||||
--disable-podpages \
|
--disable-podpages \
|
||||||
|
|||||||
19
make/make-all.sh
Executable file
19
make/make-all.sh
Executable 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
35
pve.py
@ -14,8 +14,10 @@
|
|||||||
# You should have received a copy of the GNU General Public License along with People's Video Editor.
|
# 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/>.
|
# If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from mp4.demuxer import Demuxer
|
import cProfile
|
||||||
from mp4.decoder import Decoder
|
|
||||||
|
from pyav.demuxer import Demuxer
|
||||||
|
from pyav.decoder import Decoder
|
||||||
|
|
||||||
demuxer = Demuxer('test.mp4')
|
demuxer = Demuxer('test.mp4')
|
||||||
|
|
||||||
@ -26,14 +28,21 @@ print(f"audio codec = {demuxer.audio_stream.codec.name}")
|
|||||||
video_decoder = Decoder(demuxer.video_stream)
|
video_decoder = Decoder(demuxer.video_stream)
|
||||||
audio_decoder = Decoder(demuxer.audio_stream)
|
audio_decoder = Decoder(demuxer.audio_stream)
|
||||||
|
|
||||||
while True:
|
num_frames = 0
|
||||||
packet = demuxer.read_packet()
|
|
||||||
eof = (packet is None)
|
with cProfile.Profile() as pr:
|
||||||
if eof or demuxer.video_stream.contains(packet):
|
while True:
|
||||||
video_frames = video_decoder.decode(packet)
|
packet = demuxer.read_packet()
|
||||||
print(f"decoded {len(video_frames)} video frames")
|
eof = (packet is None)
|
||||||
if eof or demuxer.audio_stream.contains(packet):
|
if eof or demuxer.video_stream.contains(packet):
|
||||||
audio_frames = audio_decoder.decode(packet)
|
video_frames = video_decoder.decode(packet)
|
||||||
print(f"decoded {len(audio_frames)} audio frames")
|
num_frames += len(video_frames)
|
||||||
if eof:
|
# print(f"decoded {len(video_frames)} video frames")
|
||||||
break
|
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
2
pve.sh
@ -15,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License along with People's Video Editor.
|
# 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/>.
|
# If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
shared_library_path="./mp4"
|
shared_library_path="./pyav"
|
||||||
absolute_shared_library_path=$(realpath ${shared_library_path})
|
absolute_shared_library_path=$(realpath ${shared_library_path})
|
||||||
|
|
||||||
LD_LIBRARY_PATH=${absolute_shared_library_path} \
|
LD_LIBRARY_PATH=${absolute_shared_library_path} \
|
||||||
|
|||||||
Reference in New Issue
Block a user