Recherche avancée

Médias (91)

Autres articles (50)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (11345)

  • Streaming HLS with Nginx & FFMPEG : How to prevent repeating or skipping scenes (.ts) when playback ?

    31 août 2022, par Fugen

    I set up HLS streaming server using Nginx & FFMPEG, then i watch it using vlc or ffplay on another pc. The problem is sometimes it repeating scenes or skipping scenes for few seconds then it continue like normal, it happens at random but occurs occasionally and not always on the same spots.

    


    Here is sample of ffplay log :

    


    [http @ 000002c6e2611c00] Opening 'http://172.20.120.75:8080/hls/test-3.ts' for reading
[hls @ 000002c6e260bcc0] Skip ('#EXT-X-VERSION:3')sq=    0B f=0/0
[hls @ 000002c6e260bcc0] Skip ('#EXT-X-DISCONTINUITY')
[http @ 000002c6e2614500] Opening 'http://172.20.120.75:8080/hls/test-3.ts' for reading
[http @ 000002c6e2611c00] Opening 'http://172.20.120.75:8080/hls/test-4.ts' for reading
[http @ 000002c6e81c8140] Opening 'http://172.20.120.75:8080/hls/test.m3u8' for reading
[hls @ 000002c6e260bcc0] Skip ('#EXT-X-VERSION:3')sq=    0B f=1/1
[hls @ 000002c6e260bcc0] Skip ('#EXT-X-DISCONTINUITY')
[http @ 000002c6e2614500] Opening 'http://172.20.120.75:8080/hls/test-3.ts' for reading
[http @ 000002c6e2611c00] Opening 'http://172.20.120.75:8080/hls/test-4.ts' for reading
[http @ 000002c6e81c8140] Opening 'http://172.20.120.75:8080/hls/test.m3u8' for reading
[hls @ 000002c6e260bcc0] Skip ('#EXT-X-VERSION:3')sq=    0B f=2/2
[http @ 000002c6e2614500] Opening 'http://172.20.120.75:8080/hls/test-6.ts' for reading
[http @ 000002c6e2611c00] Opening 'http://172.20.120.75:8080/hls/test-7.ts' for reading
[http @ 000002c6e81c8140] Opening 'http://172.20.120.75:8080/hls/test.m3u8' for reading
[hls @ 000002c6e260bcc0] Skip ('#EXT-X-VERSION:3')sq=    0B f=2/2
[http @ 000002c6e2614500] Opening 'http://172.20.120.75:8080/hls/test-7.ts' for reading
[http @ 000002c6e81c8140] Opening 'http://172.20.120.75:8080/hls/test.m3u8' for reading
[hls @ 000002c6e260bcc0] Skip ('#EXT-X-VERSION:3')sq=    0B f=2/2
[http @ 000002c6e2611c00] Opening 'http://172.20.120.75:8080/hls/test-8.ts' for reading


    


    From that log, repeating scenes are : test-3.ts, test-4.ts, test-7.ts, and skipped scene : test-5.ts.
    My question is : how to prevent this ?

    


    When i checked .m3u8 playlist on server side it seems normal, no repeated or skipped .ts file. Here is .m3u8 file :

    


    #EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:17
#EXT-X-TARGETDURATION:4
#EXTINF:3.600,
test-1.ts
#EXTINF:3.560,
test-2.ts
#EXTINF:3.600,
test-3.ts
#EXTINF:3.600,
test-4.ts
#EXTINF:3.600,
test-5.ts
#EXTINF:3.600,
test-6.ts
#EXTINF:3.600,
test-7.ts
#EXTINF:3.520,
test-8.ts
#EXTINF:3.600,


    


    My Nginx Configuration :

    


    worker_processes 4;
events {
        worker_connections 1024;
        use epoll;
        multi_accept on;
}

# RTMP configuration
rtmp {
    server {
        listen 1935; # Listen on standard RTMP port
        chunk_size 4096;

        application show {
            live on;
            # Turn on HLS
            hls on;
            hls_path /tmp/hls/;
            hls_fragment 3;
            hls_playlist_length 60;
            # disable consuming the stream from nginx as rtmp
            deny play all;
        }
    }
}

http {
        sendfile off;
        tcp_nopush on;
        tcp_nodelay on;
        reset_timedout_connection on;
        directio 512;
        default_type application/octet-stream;

    server {
        listen 8080;

        location /hls {
            # Disable cache
            add_header 'Cache-Control' 'no-cache';
            access_log off;
            # CORS setup
            add_header 'Access-Control-Allow-Origin' '*' always;
            add_header 'Access-Control-Expose-Headers' 'Content-Length';
            # allow CORS preflight requests
            if ($request_method = 'OPTIONS') {
                add_header 'Access-Control-Allow-Origin' '*';
                add_header 'Access-Control-Max-Age' 1728000;
                add_header 'Content-Type' 'text/plain charset=UTF-8';
                add_header 'Content-Length' 0;
                return 204;
            }

            types {
                application/dash+xml mpd;
                application/vnd.apple.mpegurl m3u8;
                video/mp2t ts;
            }

            root /tmp/;
        }
location /nginx_status {
        # Turn on stats
        stub_status on;
        allow all;
    }
}
}


    


    My FFMPEG Command :

    


    ffmpeg -re -stream_loop -1 -i 'video1.mp4' -vcodec libx264 -vprofile baseline -g 30 -acodec aac -strict -2 -f flv 'rtmp://172.20.120.75/show/test' &


    


    Thank You for Your Help.

    


  • ffplay : allow borderless playback windows

    1er février 2017, par Lucas Sandery
    ffplay : allow borderless playback windows
    

    For a pure video tile effect, and enabling better integration of playback windows
    into other programs. It would improve the looks in many situations and avoid ugly
    hacks like this : http://stackoverflow.com/q/31465630/315024

    Signed-off-by : Lucas Sandery <lucas-sandery@users.noreply.github.com>
    Signed-off-by : Marton Balint <cus@passwd.hu>

    • [DH] doc/ffplay.texi
    • [DH] ffplay.c
  • How to get frame-by-frame audio from the video in python

    7 juin 2023, par Usman Arshad

    So,first of all the description of my program is that I am viewing a video using opencv and whenever I press "p" the video paused for 5 seconds.At last I am saving that updated video in the same directory.I want to add audio to this video and whenever "p" pressed the audio must also be stopped for 5 second until next frame.

    &#xA;

    import cv2&#xA;&#xA;def save_frames(frames, output_filename, fps):&#xA;    # Get video information from the first frame&#xA;    height, width, _ = frames[0].shape&#xA;&#xA;    # Create a VideoWriter object to save the frames&#xA;    fourcc = cv2.VideoWriter_fourcc(*&#x27;mp4v&#x27;)&#xA;    output = cv2.VideoWriter(output_filename, fourcc, fps, (width, height))&#xA;&#xA;    # Write each frame to the video file&#xA;    for frame in frames:&#xA;        output.write(frame)&#xA;&#xA;    # Release the VideoWriter&#xA;    output.release()&#xA;    &#xA;def main():&#xA;    # Load the video&#xA;    video_path = &#x27;input_video.mp4&#x27;&#xA;    cap = cv2.VideoCapture(video_path)&#xA;&#xA;&#xA;    frames = []&#xA;    fps = cap.get(cv2.CAP_PROP_FPS)&#xA;&#xA;    while cap.isOpened():&#xA;        # Read the current frame&#xA;        ret, frame = cap.read()&#xA;&#xA;        if not ret:&#xA;            break&#xA;&#xA;        # Display the frame&#xA;        cv2.imshow(&#x27;Video&#x27;, frame)&#xA;&#xA;        # Append the frame to the list&#xA;        frames.append(frame)&#xA;        # Wait for key press&#xA;        key = cv2.waitKey(int(1000 / fps))&#xA;&#xA;        if key == ord(&#x27;p&#x27;):&#xA;            # Pause the video for 5 seconds&#xA;            paused = True&#xA;            for _ in range(int(fps * 5)):&#xA;                frames.append(frame)&#xA;                cv2.waitKey(int(1000 / fps))&#xA;            paused = False&#xA;&#xA;    # Release the VideoCapture&#xA;    cap.release()&#xA;&#xA;    # Save the frames to a video file&#xA;    output_filename = &#x27;output.mp4&#x27;&#xA;    save_frames(frames, output_filename, fps)&#xA;&#xA;if __name__ == &#x27;__main__&#x27;:&#xA;    main()&#xA;

    &#xA;