Skip to main content

Fragmented mp4stream Package

Usage

import fragmentedmp4stream.service
import sys

def main(argv):
    fragmentedmp4stream.service.start(argv)

if __name__ == "__main__":
    main(sys.argv[1:])

videocodec support

  • h264
  • h265

protocol support

  • http(fmp4, hls)
  • rtsp

parameters

  • -p(--ports) ports[http, rtsp] to bind(def. 4555,4556)
  • -r(--root) files directory(required) - path to seek required mp4 file
  • -s(--segment) segment duration sec.(def. 6) - floor limit of segment duration
  • -c(--cache) cache segmentation - save segmentation as .*.cache files
  • -b(--basic) user:password@realm (use Basic Authorization)
  • -d(--digest) user:password@realm (use Digest Authorization)
  • -v(--verb) be verbose (show structure of required mp4 file)
  • -h(--help) this help

installation

pip install fragmented-mp4stream-pkg==0.0.4

subtitles

  • Innner subtitles: track handler=text, type=tx3g. Verified with MPlayer.
  • Outer subtitles:
    • master playlist: m3u8-file - ex.
    #EXTM3U
    #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=NO,FORCED=NO,URI="http://mkh-Aspire-A315-54K:4555/toystory20sub.m3u8"
    #EXT-X-STREAM-INF:PROGRAM-ID=1,SUBTITLES="subs"
    http://mkh-Aspire-A315-54K:4555/toystory20.m3u8
    
    • subtitles playlist: m3u8-file - ex. toystory20sub.m3u8
      #EXTM3U
      #EXT-X-PLAYLIST-TYPE:VOD
      #EXT-X-MEDIA-SEQUENCE:0
      #EXT-X-TARGETDURATION:8
      #EXTINF:4.0107,
      http://mkh-Aspire-A315-54K:4555/toystory20.vtt
    
    • webVTT subtitles: vtt-files - ex. toystory20.vtt
      WEBVTT
      
      00:00:02.829 --> 00:00:4.829 line:74% align:left
      <i>subtitles example.</i>
      

streams

  • json list of available files

    http://ip:http_port/

  • fragmented mp4

    http://ip:http_port/filename_without_extension

  • hls container with fragmented mp4

    http://ip:http_port/filename_with_m3u_extension

  • rtsp

    rtsp://ip:rtsp_port/filename_without_extension

autorization

Supports Basic and Digest authorization. A specific authorization can be setup or both.

rtsp stream

Supports trick play:

  • reverse
  • scaling
  • seeking

Supports parameters

  • position - returns asset position timestamp

example1

  • service
    • python3 mp4stream.py -r ~/video/
  • client

example2

example3

example4

  • service
    • python3 mp4stream.py -r ~/video/
  • client
    • ffplay -rtsp_transport tcp rtsp://192.168.250.229:4556/toystory

      ~/video/toystory.mp4 - rtsp stream

Metadata

Release files for fragmented-mp4stream-pkg 0.0.4

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

Source distribution (sdist)

Source distribution for fragmented-mp4stream-pkg 0.0.4
File Size Uploaded
fragmented-mp4stream-pkg-0.0.4.tar.gz 35.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fragmented-mp4stream-pkg 0.0.4
File Interpreter ABI Platform
fragmented_mp4stream_pkg-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 86.4 kB

Release files / fragmented-mp4stream-pkg-0.0.4.tar.gz

Download URL fragmented-mp4stream-pkg-0.0.4.tar.gz
Size 35.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c48dbe3caabf0a6f38230a15345eadd2b55a0ab3d960d7c58f8568196e1d6005
BLAKE2b-256 checksum
How to use checksums
403f607f0ff3008f2cf30f13af82087c02a54c04f6544ccab1eb009a2811bafe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release files / fragmented_mp4stream_pkg-0.0.4-py3-none-any.whl

Download URL fragmented_mp4stream_pkg-0.0.4-py3-none-any.whl
Size 51.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4633f4292205b17571771b8bbab20521c5bee13047b787291cc3e0e16969a575
BLAKE2b-256 checksum
How to use checksums
190507d976c1caaa374fbd2a3db6f93a263c58fd8f1fe161d757a9ac8bdbe989
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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