Recherche avancée

Médias (3)

Mot : - Tags -/image

Autres articles (55)

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

  • 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

Sur d’autres sites (8874)

  • Nginx can't record live streaming results for medium resolution

    1er juillet 2021, par firman alislami

    when i finished live streaming, the live streaming result file was not recorded for medium resolution...

    


       rtmp {
server {
    listen 1935;
    chunk_size 4096;            
application live {
    live on;
    exec_push /usr/bin/ffmpeg -re -i rtmp://localhost/live/$name 
   -async 1 -vsync -1
    -c:v libx264 -c:a aac -b:v 200k  -b:a 34k  -vf "scale=240:trunc(ow/a/2)*2"  -tune zerolatency -preset superfast -crf 23 -f flv rtmp://localhost/hls/$name_low
    -c:v libx264 -c:a aac -b:v 300k  -b:a 64k  -vf "scale=360:trunc(ow/a/2)*2"  -tune zerolatency -preset superfast -crf 23 -f flv rtmp://localhost/hls/$name_low360
    -c:v libx264 -c:a aac -b:v 800k  -b:a 64k  -vf "scale=480:trunc(ow/a/2)*2"  -tune zerolatency -preset superfast -crf 23 -f flv rtmp://localhost/hls/$name_low480
    -c:v libx264 -c:a aac -b:v 1800k  -b:a 128k -vf "scale=720:trunc(ow/a/2)*2"  -tune zerolat#-acodec  copy -vcodec copy -f flv rtmp://localhost/hls/$name;
}
application hls {
    live on;
    deny play all;
    hls on;
    hls_fragment 4;
    hls_playlist_length 20;
    hls_path /mnt/hls;
    hls_variant _mid BANDWIDTH=1800000,RESOLUTION=1280x720; 
    hls_variant _low480 BANDWIDTH=80000,RESOLUTION=858x480;
    hls_variant _low360 BANDWIDTH=300000,RESOLUTION=480x360;
    hls_variant _low BANDWIDTH=200000,RESOLUTION=352x240; 
    hls_nested on;
        record all;
        record_path /mnt/record/;
        record_unique on;
            exec_record_done ffmpeg -y -i $path -acodec libmp3lame -ar 44100 -ac 1 -vcodec libx264 $dirname/$basename.mp4;
            }
    }
    


    


    }ency -preset superfast -crf 23 -f flv rtmp ://localhost/hls/$name_mid ;
#-c:v libx264 -c:a aac -b:v 1024k -b:a 128k -vf "scale=1080:trunc(ow/a/2)*2" -tune zerolatency -preset superfast -crf 23 -f flv rtmp ://localhost/hls/$name_high
#-c copy -f flv rtmp ://localhost/hls/$name_src ;

    


  • add watermark to video with FFMPEG and convert to HLS for all resolution

    25 juin 2021, par sina

    I'm using this package : aminyazdanpanah/PHP-FFmpeg-video-streaming. I try to add a watermark to a video and I am using "hls" after adding a watermark method. The problem is the watermark is apply just for one resolution and the other representations does not work.

    


    For example, I use this method :

    


    $video ->filters() ->watermark('sample.png', [ 'position' => 'relative', 'bottom' => 50, 'right' => 50, ]);

$video->hls() ->setFormat($format) ->autoGenerateRepresentations([144,360,480]) ->save('sample.m3u8');


    


    In this case only the default representation is save (depend on video resolution) and other quality not generate.

    


    Is there a way to add watermark to hls (all quality) ?

    


  • Is there any way to switch the resolution on the fly when streaming with RTMP ?

    25 mai 2021, par wwd

    I built nginx with nginx-http-flv-module as the RTMP server. And I used ffmpeg-python to upload the stream. I have searched a lot about "how to switch the resolution on the fly". However, it seems like that nobody do something like that.

    


    So, I did a test by periodically rerunning a new ffmpeg uploading process while the client(opencv-python) keeps receiving the data.
I found that the resolution was switched successfully, but the frame near the switch was often broken. And opencv sometimes exits without any logs.

    


    Is there any way to achieve this ?

    


    Here is the test code of my streamer :

    


    import cv2
import ffmpeg


if __name__ == "__main__":
    cap1 = cv2.VideoCapture("videos/1944x960/video.mp4")
    cap2 = cv2.VideoCapture("videos/972x480/video.mp4")

    pushing_process = None
    count = 0
    hr = True

    while True:
        ret1, frame1 = cap1.read()
        ret2, frame2 = cap2.read()
        if not ret1 or not ret2:
            break

        if hr:
            if pushing_process is None:
                pushing_process = ffmpeg.input("pipe:", format="rawvideo", pix_fmt="bgr24",
                                               s=f"{1944}x{960}") \
                    .output("rtmp://127.0.0.1:1935/myapp/s", pix_fmt="yuv420p", f="flv", vcodec="h264",
                            loglevel="error") \
                    .global_args("-re").run_async(pipe_stdin=True)

            frame = frame1
        else:
            if pushing_process is None:
                pushing_process = ffmpeg.input("pipe:", format="rawvideo", pix_fmt="bgr24",
                                               s=f"{972}x{480}") \
                    .output("rtmp://127.0.0.1:1935/myapp/s", pix_fmt="yuv420p", f="flv", vcodec="h264",
                            loglevel="error") \
                    .global_args("-re").run_async(pipe_stdin=True)
            frame = frame2
        pushing_process.stdin.write(frame.tobytes())
        count += 1
        if count == 60:
            hr = not hr
            pushing_process.stdin.close()
            pushing_process.wait()
            pushing_process = None
            count = 0

    pushing_process.stdin.close()
    pushing_process.wait()



    


    And the client :

    


    import cv2

if __name__ == "__main__":
    cap = cv2.VideoCapture("http://127.0.0.1/live?app=myapp&stream=s")
    while True:
        ret, frame = cap.read()
        if not ret:
            break
        cv2.imshow("frame", cv2.resize(frame, (1944, 960), interpolation=cv2.INTER_CUBIC))
        cv2.waitKey(0)