Skip to main content

AutoQPF

Generates QPF frame time codes to be used with x264/x265

Install

pip install AutoQPF

Uninstall

pip uninstall AutoQPF

Example of how to use AutoQPF

from auto_qpf.qpf import QpfGenerator, ChapterIndexError, ImproperChapterError, NoChapterDataError

# basic ##########################
# media file (virtually any media file)
qpf = QpfGenerator().generate_qpf(file_input="PATH TO FILE.mkv")

# chapter file (ogm format)
qpf = QpfGenerator().generate_qpf(file_input="PATH TO FILE.txt")


# error handling ##################
try:
    qpf = QpfGenerator().generate_qpf(file_input="PATH TO FILE.mkv")

except ChapterIndexError:
    print("Issue getting the correct index from the chapters")

except ImproperChapterError:
    print("Input has improper or corrupted chapters")

except NoChapterDataError:
    print("Input has no chapter data")

AutoQPF.generate_qpf() parameters

file_input Required, path of the input file

file_output Optional, can specify an output path, if one isn't will automatically create one based on the input

write_to_disk Optional, True/False (default is True), if this is set to false the 'file_output' parameter will be ignored and a list of the converter chapter time codes will be returned

fps Optional, this should be defined when using '.txt' (ogm) format. If it's a media file + has a video track we will automatically detect the FPS. Default is '23.976'

auto_detect_fps Optional, True/False (default is True), this will over ride any user input if the file input is a media file

generate_chapters Optional, True/False (default is True), if enabled the program will automatically output write OGM chapters beside the QPF, correcting improper numbers parsed from source, creating numbered chapters if tagged, and extracting named directly while retaining the same time-codes that align with the QPF file.

Generating chapters to text is done with a helper class, if you want to access this helper class and use it directly you can access it below...

ChapterGenerator.generate_ogm_chapters() parameters

At the moment this requires a MediaInfo.parse() object, in the future I might change it to also accept a file input as well

media_info_obj A parsed pymediainfo object

output_path The output path of the OGM chapters file (suffix must be .txt)

chapter_chunks Optional, float (default is 12.0), this will make chapters for every 12% of the input file

extract_tagged Optional, bool (default is True), this will allow the extraction of detected tagged chapters

extract_named Optional, bool (default is True), this will allow the extraction of detected named chapters

extract_numbered Optional, bool (default is True), this will allow the extraction of detected numbered chapters

If any of extract_* is set to false, when that chapter type is detected the program will generate clean numbered chapters to replace it automatically.

Example of how to use ChapterGenerator

from auto_qpf.qpf import ChapterGenerator
from pymediainfo import MediaInfo

parse = MediaInfo.parse(r"file_input.mkv")

test = ChapterGenerator.generate_ogm_chapters(media_info_obj=parse, output_path="chapter.txt")

# returns path of chapter file
print(test)

Metadata

Release files for autoqpf 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autoqpf 0.1.5
File Size Uploaded
AutoQPF-0.1.5.tar.gz 7.9 kB Details

Release files / AutoQPF-0.1.5.tar.gz

Download URL AutoQPF-0.1.5.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
484601099c680a2f8bf3b64935494e781f4013a8a0f1a10a03ddd39e0136c839
BLAKE2b-256 checksum
How to use checksums
f459dffa3e8a059493f47ce261fa866743150ecf634a259f3b1d7090f79278b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release history Release notifications | RSS feed

0.2.5

2 release files

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

This release

0.1.5 This release

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page