Recherche avancée

Médias (0)

Mot : - Tags -/serveur

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (46)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (6018)

  • How to restream IPTV playlist with Nginx RTMP, FFmpeg, and Python without recording, but getting HTTP 403 error ? [closed]

    1er avril, par boyuna1720

    I have an IPTV playlist from a provider that allows only one user to connect and watch. I want to restream this playlist through my own server without recording it and in a lightweight manner. I’m using Nginx RTMP, FFmpeg, and Python TCP for the setup, but I keep getting an HTTP 403 error when trying to access the stream.

    


    Here’s a summary of my setup :

    


    Nginx RTMP : Used for streaming.

    


    FFmpeg : Used to handle the video stream.

    


    Python TCP : Trying to handle the connection between my server and the IPTV source.

    


    #!/usr/bin/env python3&#xA;&#xA;import sys&#xA;import socket&#xA;import threading&#xA;import requests&#xA;import time&#xA;&#xA;def accept_connections(server_socket, clients, clients_lock):&#xA;    """&#xA;    Continuously accept new client connections, perform a minimal read of the&#xA;    client&#x27;s HTTP request, send back a valid HTTP/1.1 response header, and&#xA;    add the socket to the broadcast list.&#xA;    """&#xA;    while True:&#xA;        client_socket, addr = server_socket.accept()&#xA;        print(f"[&#x2B;] New client connected from {addr}")&#xA;        threading.Thread(&#xA;            target=handle_client,&#xA;            args=(client_socket, addr, clients, clients_lock),&#xA;            daemon=True&#xA;        ).start()&#xA;&#xA;def handle_client(client_socket, addr, clients, clients_lock):&#xA;    """&#xA;    Read the client&#x27;s HTTP request minimally, send back a proper HTTP/1.1 200 OK header,&#xA;    and then add the socket to our broadcast list.&#xA;    """&#xA;    try:&#xA;        # Read until we reach the end of the request headers&#xA;        request_data = b""&#xA;        while b"\r\n\r\n" not in request_data:&#xA;            chunk = client_socket.recv(1024)&#xA;            if not chunk:&#xA;                break&#xA;            request_data &#x2B;= chunk&#xA;&#xA;        # Send a proper HTTP response header to satisfy clients like curl&#xA;        response_header = (&#xA;            "HTTP/1.1 200 OK\r\n"&#xA;            "Content-Type: application/octet-stream\r\n"&#xA;            "Connection: close\r\n"&#xA;            "\r\n"&#xA;        )&#xA;        client_socket.sendall(response_header.encode("utf-8"))&#xA;&#xA;        with clients_lock:&#xA;            clients.append(client_socket)&#xA;        print(f"[&#x2B;] Client from {addr} is ready to receive stream.")&#xA;    except Exception as e:&#xA;        print(f"[!] Error handling client {addr}: {e}")&#xA;        client_socket.close()&#xA;&#xA;def read_from_source_and_broadcast(source_url, clients, clients_lock):&#xA;    """&#xA;    Continuously connect to the source URL (following redirects) using custom headers&#xA;    so that it mimics a curl-like request. In case of connection errors (e.g. connection reset),&#xA;    wait a bit and then try again.&#xA;    &#xA;    For each successful connection, stream data in chunks and broadcast each chunk&#xA;    to all connected clients.&#xA;    """&#xA;    # Set custom headers to mimic curl&#xA;    headers = {&#xA;        "User-Agent": "curl/8.5.0",&#xA;        "Accept": "*/*"&#xA;    }&#xA;&#xA;    while True:&#xA;        try:&#xA;            print(f"[&#x2B;] Fetching from source URL (with redirects): {source_url}")&#xA;            with requests.get(source_url, stream=True, allow_redirects=True, headers=headers) as resp:&#xA;                if resp.status_code >= 400:&#xA;                    print(f"[!] Got HTTP {resp.status_code} from the source. Retrying in 5 seconds.")&#xA;                    time.sleep(5)&#xA;                    continue&#xA;&#xA;                # Stream data and broadcast each chunk&#xA;                for chunk in resp.iter_content(chunk_size=4096):&#xA;                    if not chunk:&#xA;                        continue&#xA;                    with clients_lock:&#xA;                        for c in clients[:]:&#xA;                            try:&#xA;                                c.sendall(chunk)&#xA;                            except Exception as e:&#xA;                                print(f"[!] A client disconnected or send failed: {e}")&#xA;                                c.close()&#xA;                                clients.remove(c)&#xA;        except requests.exceptions.RequestException as e:&#xA;            print(f"[!] Source connection error, retrying in 5 seconds: {e}")&#xA;            time.sleep(5)&#xA;&#xA;def main():&#xA;    if len(sys.argv) != 3:&#xA;        print(f"Usage: {sys.argv[0]}  <port>")&#xA;        sys.exit(1)&#xA;&#xA;    source_url = sys.argv[1]&#xA;    port = int(sys.argv[2])&#xA;&#xA;    # Create a TCP socket to listen for incoming connections&#xA;    server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)&#xA;    server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)&#xA;    server_socket.bind(("0.0.0.0", port))&#xA;    server_socket.listen(5)&#xA;    print(f"[&#x2B;] Listening on port {port}...")&#xA;&#xA;    # List of currently connected client sockets&#xA;    clients = []&#xA;    clients_lock = threading.Lock()&#xA;&#xA;    # Start a thread to accept incoming client connections&#xA;    t_accept = threading.Thread(&#xA;        target=accept_connections,&#xA;        args=(server_socket, clients, clients_lock),&#xA;        daemon=True&#xA;    )&#xA;    t_accept.start()&#xA;&#xA;    # Continuously read from the source URL and broadcast to connected clients&#xA;    read_from_source_and_broadcast(source_url, clients, clients_lock)&#xA;&#xA;if __name__ == "__main__":&#xA;    main()&#xA;</port>

    &#xA;

    When i write command python3 proxy_server.py &#x27;http://channelurl&#x27; 9999&#xA;I getting error.

    &#xA;

    [&#x2B;] Listening on port 9999...&#xA;[&#x2B;] Fetching from source URL (with redirects): http://ate91060.cdn-akm.me:80/dc31a19e5a6a/fc5e38e28e/325973&#xA;[!] Got HTTP 403 from the source. Retrying in 5 seconds.&#xA;^CTraceback (most recent call last):&#xA;  File "/home/namepirate58/nginx-1.23.1/proxy_server.py", line 127, in <module>&#xA;    main()&#xA;  File "/home/namepirate58/nginx-1.23.1/proxy_server.py", line 124, in main&#xA;    read_from_source_and_broadcast(source_url, clients, clients_lock)&#xA;  File "/home/namepirate58/nginx-1.23.1/proxy_server.py", line 77, in read_from_source_and_broadcast&#xA;    time.sleep(5)&#xA;KeyboardInterrupt&#xA;</module>

    &#xA;

  • Why is the stream interrupted ?

    7 décembre 2023, par mmrer

    Task : endlessly play video files from the folder to work screens.&#xA;I decided to use Ubuntu Server, Nginx+RTMP_MODULE, Ffmpeg.

    &#xA;

    Ubuntu 22.04.3 LTS Jammy

    &#xA;

    uname -a&#xA;Linux streamserver 5.15.0-89-generic #99-Ubuntu SMP &#xA;

    &#xA;

    /nginx.conf/

    &#xA;

    worker_process 1;&#xA;events {&#xA;    worker_connections 1024;&#xA;}&#xA;&#xA;# RTMP configuration&#xA;rtmp {&#xA;    server{&#xA;        listen 1935;&#xA;        chunk_size 4096;&#xA;        &#xA;        application live {&#xA;            live on;&#xA;            record off;&#xA;        }&#xA;    }&#xA;}&#xA;

    &#xA;

    /bash.sh/

    &#xA;

    #!/bin/bash&#xA;&#xA;directory_video="/home/stream_server/VideoStream"&#xA;stream="rtmp://localhost/live"&#xA;&#xA;while :&#xA;do&#xA;    name_video=$(ls $directory_video|sort -R|head -1) #take video name&#xA;    &#xA;    ffmpeg -re -i $directory_video/$name_video \&#xA;    -b:v 3000k                                 \&#xA;    -f flv -flvflags no_duration_filesize      \&#xA;    rtmp://localhost/live&#xA;done&#xA;

    &#xA;

    When starting the script bash.sh everything goes well.&#xA;The problem arises when the player tries to start the next video.&#xA;For some reason, the player launches only the first few frames after which the picture stops on them.

    &#xA;

    What am I missing ?

    &#xA;

    I tried to launch FFMPEG separately from the script, changed various speed settings, bitrate, and resolution.

    &#xA;

    No matter what I do the problem, it is saved as it is.

    &#xA;

  • Why is the stream stream interrupted ?

    5 décembre 2023, par mmrer

    Task : endlessly play video files from the folder to work screens.&#xA;I decided to use Ubuntu Server, Nginx+RTMP_MODULE, Ffmpeg.

    &#xA;

    Ubuntu 22.04.3 LTS Jammy

    &#xA;

    uname -a&#xA;Linux streamserver 5.15.0-89-generic #99-Ubuntu SMP &#xA;

    &#xA;

    /nginx.conf/

    &#xA;

    worker_process 1;&#xA;events {&#xA;    worker_connections 1024;&#xA;}&#xA;&#xA;# RTMP configuration&#xA;rtmp {&#xA;    server{&#xA;        listen 1935;&#xA;        chunk_size 4096;&#xA;        &#xA;        application live {&#xA;            live on;&#xA;            record off;&#xA;        }&#xA;    }&#xA;}&#xA;

    &#xA;

    /bash.sh/

    &#xA;

    #!/bin/bash&#xA;&#xA;directory_video="/home/stream_server/VideoStream"&#xA;stream="rtmp://localhost/live"&#xA;&#xA;while :&#xA;do&#xA;    name_video=$(ls $directory_video|sort -R|head -1) #take video name&#xA;    &#xA;    ffmpeg -re -i $directory_video/$name_video \&#xA;    -b:v 3000k                                 \&#xA;    -f flv -flvflags no_duration_filesize      \&#xA;    rtmp://localhost/live&#xA;done&#xA;

    &#xA;

    When starting the script bash.sh everything goes well.&#xA;The problem arises when the player tries to start the next video.&#xA;For some reason, the player launches only the first few frames after which the picture stops on them.

    &#xA;

    What am I missing ?

    &#xA;

    I tried to launch FFMPEG separately from the script, changed various speed settings, bitrate, and resolution.

    &#xA;

    No matter what I do the problem, it is saved as it is.

    &#xA;