Recherche avancée

Médias (1)

Mot : - Tags -/vidéo

Autres articles (43)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • Contribute to translation

    13 avril 2011

    You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
    To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
    MediaSPIP is currently available in French and English (...)

Sur d’autres sites (5683)

  • avcodec/mpegvideo_dec : Move memcpy'ing ctx to mpeg4videodec.c

    29 avril, par Andreas Rheinhardt
    avcodec/mpegvideo_dec : Move memcpy'ing ctx to mpeg4videodec.c
    

    When the destination MpegEncContext in ff_mpeg_update_thread_context()
    is not initialized, the source MpegEncContext is simply copied
    over it before (potentially) calling ff_mpv_common_init().
    This leads to data races when this code is executed which is why
    it should be replaced with only copying the necessary fields
    (this is for future commits).

    Given that the RV30 and RV40 decoders always call said function
    with an already initialized MpegEncContext (they use context_reinit
    in case of frame size changes), they don't need this ugly
    initialization (and are therefore race-free). This means that
    this code can be moved to the only decoder that actually needs it :
    MPEG-4. This commit does so.

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

    • [DH] libavcodec/mpeg4videodec.c
    • [DH] libavcodec/mpegvideo_dec.c
  • ffmpeg video streaming issue

    20 avril, par Personboiii

    I am trying to embed an adb video stream into an html site with flask, and the code I have keeps on returning this same error :

    &#xA;

    FFmpeg: [mjpeg @ 0x156631c10] Could not find codec parameters for stream 0 (Video: mjpeg, none(bt470bg/unknown/unknown)): unspecified size&#xA;FFmpeg: Consider increasing the value for the &#x27;analyzeduration&#x27; (1000000) and &#x27;probesize&#x27; (5000000) options&#xA;FFmpeg: Input #0, mjpeg, from &#x27;pipe:0&#x27;:&#xA;FFmpeg:   Duration: N/A, bitrate: N/A&#xA;FFmpeg:   Stream #0:0: Video: mjpeg, none(bt470bg/unknown/unknown), 25 fps, 1200k tbr, 1200k tbn&#xA;FFmpeg: Output #0, mpegts, to &#x27;pipe:1&#x27;:&#xA;FFmpeg: [out#0/mpegts @ 0x156632110] Output file does not contain any stream&#xA;FFmpeg: Error opening output file pipe:1.&#xA;FFmpeg: Error opening output files: Invalid argument&#xA;

    &#xA;

    this is my code :

    &#xA;

    &#xA;from flask import Flask, Response&#xA;import subprocess&#xA;import json&#xA;import threading&#xA;&#xA;app = Flask(__name__)&#xA;&#xA;with open("data_file.json", "r") as f:&#xA;    config_data = json.load(f)&#xA;&#xA;user = config_data["Users"]["Test User 1"]&#xA;&#xA;&#xA;def log_ffmpeg_errors(proc):&#xA;    for line in iter(proc.stderr.readline, b&#x27;&#x27;):&#xA;        if line:&#xA;            print("FFmpeg:", line.decode(), end=&#x27;&#x27;)&#xA;&#xA;&#xA;def connect_device(ip, port):&#xA;    try:&#xA;        # Reconnect if device is offline&#xA;        subprocess.run(["adb", "tcpip", str(port)])&#xA;        subprocess.run(["adb", "connect", ip])&#xA;        # Check if the device is online&#xA;        devices = subprocess.check_output(["adb", "devices"]).decode()&#xA;        if "offline" in devices:&#xA;            raise Exception("Device is offline")&#xA;    except Exception as e:&#xA;        print(f"Error connecting device: {e}")&#xA;&#xA;&#xA;def generate_video_stream():&#xA;    adb_cmd = ["adb", "exec-out", "screenrecord", "--output-format=mjpeg"]  # Use MJPEG output&#xA;    ffmpeg_cmd = [&#xA;        "ffmpeg",&#xA;        "-f", "mjpeg",&#xA;        "-analyzeduration", "1000000", &#xA;        "-probesize", "5000000",  &#xA;        "-i", "pipe:0", &#xA;        "-q:v", "5",&#xA;        "-r", "10",&#xA;        "-vcodec", "mjpeg",  &#xA;        "-s", "1280x720", &#xA;        "-f", "mpegts", &#xA;        "pipe:1" &#xA;    ]&#xA;&#xA;    adb_proc = subprocess.Popen(adb_cmd, stdout=subprocess.PIPE)&#xA;    ffmpeg_proc = subprocess.Popen(ffmpeg_cmd, stdin=adb_proc.stdout, stdout=subprocess.PIPE, stderr=subprocess.PIPE)&#xA;&#xA;    threading.Thread(target=log_ffmpeg_errors, args=(ffmpeg_proc,), daemon=True).start()&#xA;&#xA;    try:&#xA;        while True:&#xA;            frame = ffmpeg_proc.stdout.read(4096)&#xA;            if not frame:&#xA;                break&#xA;            yield (b&#x27;--frame\r\n&#x27;&#xA;                   b&#x27;Content-Type: image/jpeg\r\n\r\n&#x27; &#x2B; frame &#x2B; b&#x27;\r\n&#x27;)&#xA;&#xA;    finally:&#xA;        adb_proc.terminate()&#xA;        ffmpeg_proc.terminate()&#xA;&#xA;@app.route(&#x27;/video_feed&#x27;)&#xA;def video_feed():&#xA;    return Response(generate_video_stream(), mimetype=&#x27;multipart/x-mixed-replace; boundary=frame&#x27;)&#xA;&#xA;if __name__ == "__main__":&#xA;    connect_device(user["IP"], user["port"])&#xA;    app.run(debug=True, host=&#x27;0.0.0.0&#x27;, port=8080)&#xA;&#xA;

    &#xA;

    I also changed it so that it is adb_cmd = ["adb","exec-out","screenrecord", "-output-format=h264","-"] and the error left but now the site header just keeps on loading and the embed in the html shows nothing. (ngrok for the site page says 200 ok)

    &#xA;

  • 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.

    &#xA;

    Here’s a summary of my setup :

    &#xA;

    Nginx RTMP : Used for streaming.

    &#xA;

    FFmpeg : Used to handle the video stream.

    &#xA;

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

    &#xA;

    #!/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;