Recherche avancée

Médias (3)

Mot : - Tags -/Valkaama

Autres articles (75)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (4497)

  • ffmpeg ignoring framerate settings when trancsoding mp4 to mxf

    5 avril 2024, par Matt B

    I'm using ffmpeg to transcode an mp4 file to an mxf file for proxies.

    


    The main problem : ffmpeg ignores my framerate settings and always encodes the output video at 59.9 fps instead of the requested 58.

    


    In this case, the input video has an FPS of 58 (actually an avg framerate of 57442500/996461 as reported by an ffmpeg probe), and I require the output to match, but ffmpeg overrides me and sets it to 59.9.

    


    No matter what I try, I cannot get ffmpeg to write the output file at 58 fps. I've tried the -r and -framerate arguments and I've tried the fps=58 option with vf. I've also tried setting -vsync cfr, but no luck. I've also tried using the average framerate from the probe (57442500/996461), but again, no change. I've also tried specifying the framerate in the input to match that reported by the probe (no luck).

    


    Here's my code in ffmpeg-python.

    


    in_video = 'video.mp4'
out_video = 'video.mxf'

(
    ffmpeg
    .input(
        in_video,
    )
    .output(
        out_video,
        r=58,
    )
    .global_args('-report')
    .run()
)


    


    And here is the raw command, which I've tried manually entering as well.

    


    ffmpeg -i "video.mp4" -r 58 "video.mxf" -report


    


    Despite my output settings, the resulting video has an output framerate of 60000/10001 instead of 58/1 or 57442500/996461.

    


    Is there something obious I'm missing ? Does the mxf format require certain framerates ?

    


    The source video was recorded with my phone, a Google Pixel 6a, if that matters. The r_frame_rate reported by the probe is 60000/1001 while the avg_frame_rate is the aforementioned 57442500/996461, which is what my editor reports as well.

    


    Alternatively, I'm open to other proxy format suggestions. Though I'll say that .mxf files seem to be the best trade in file size and editing latency I've seen so far. Unfortunately, DaVinci Resolve, my editor, requires the proxy to have the same framerate as the source.

    


    Edit to add report for Gyan

    


    Source code

    


    from pathlib import Path
import ffmpeg

src = Path(
    r"K:\StackO\vid.mp4"
)
dest = src.with_suffix('.mxf')


(
    ffmpeg
    .input(
        str(src),
    )
    .output(
        str(dest),
        r=58,
    )
    .global_args('-report')
    .run()
)


    


    Report on pastebin. It was too large to post on SO, and even too large for pasetbin, so I omitted the middle 8,000 lines starting at line 884. Hopefully I only removed superfluous stuff.

    


  • Streaming fails when I activate hls

    4 avril 2024, par yieniggu

    I'm currently testing a local server with nginx and the rtmp module in order to receive video streams. It's working just fine, but I want to add hls/dash in order to reproduce the streams on html. However, when I add this functionality to the config file the sources start complaining about the server and stop streaming.

    


    For example, if am streaming through OBS I got a message that is attempting to reconnect every 2 seconds with no success.

    


    If I use ffmpeg as :

    


    ffmpeg -re -i 'pescado.mp4' -c:v libx264 -preset slower -tune zerolatency -c:a aac -f flv rtmp://localhost/live/pescado


    


    The error I have is :

    


    av_interleaved_write_frame(): Broken pipeB time=00:00:00.00 bitrate=16592.0kbits/s speed=0.00225x    
[flv @ 0x5d3f03942cc0] Failed to update header with correct duration.
[flv @ 0x5d3f03942cc0] Failed to update header with correct filesize.
Error writing trailer of rtmp://localhost/live/pescado: Broken pipe


    


    This is my nginx config file :

    


    ser www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}


#mail {
#       # See sample authentication script at:
#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#       # auth_http localhost/auth.php;
#       # pop3_capabilities "TOP" "USER";
#       # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#       server {
#               listen     localhost:110;
#               protocol   pop3;
#               proxy      on;
#       }
#
#       server {
#               listen     localhost:143;
#               protocol   imap;
#               proxy      on;
#       }
#}


rtmp {
        server {
                listen 1935;
                chunk_size 4096;

                allow publish 127.0.0.1;
                allow publish 10.33.6.235;
                deny publish all;

                application live {
                        live on;
                        record off;

                        hls on;
                        hls_path /var/www/html/stream/hls;
                        hls_fragment 3;
                        hls_playlist_length 60;
                        hls_cleanup off;

                        dash on;
                        dash_path /var/www/html/stream/dash;
                        dash_cleanup off;
                }
        }
}


    


    I've been following the tutorials from How To Set Up a Video Streaming Server using Nginx-RTMP on Ubuntu 22.04

    


  • #0 does not contain any stream [closed]

    18 juillet 2024, par Test Dev

    ffmpeg exited with code 1 : Output #0, mp4, to 'D :\billion-view\video-compilation-electron-app.billionviews\simple_audio\yt-video-best-short-motivational-speech-video-24-hours-1-minute-motivation-2-fLeJJPxua3E-15-30.mp4' :
Output file #0 does not contain any stream

    


    

const videoFormats = info.formats.filter(
    (format: videoFormat) =>
      format.container === "mp4" && format.hasVideo && format.videoCodec && format.videoCodec.includes("avc1")
  );

  videoFormats.sort((a: videoFormat, b: videoFormat) => (b.height || 0) - (a.height || 0));
  const bestVideoFormat =
    videoFormats.find((format: videoFormat) => (format.qualityLabel = "1080p")) || videoFormats[0];

  const readableVideo = ytdl.downloadFromInfo(info, {
    format: bestVideoFormat,
    // requestOptions: { agent },
  });
  const readableAudio = ytdl(media.location, {
    quality: "highestaudio", // Ref: https://github.com/fent/node-ytdl-core#ytdlchooseformatformats-options
    // requestOptions: { agent },
  });

  readableVideo.on("progress", (_, downloaded: number, total: number) => {
    progressHandler?.({
      eventType: MediaProgressEventType.Download,
      timeStamp: new Date().toISOString(),
      culminationType: MediaProgressCulminationType.Running,
      media,
      percent: (100 * downloaded) / total,
    });
  });
  readableAudio.on("progress", (_, downloaded: number, total: number) => {
    progressHandler?.({
      eventType: MediaProgressEventType.Download,
      timeStamp: new Date().toISOString(),
      culminationType: MediaProgressCulminationType.Running,
      media,
      percent: (100 * downloaded) / total,
    });
  });

  agent?.destroy(); // Destroy the proxy agent.

  const writableVideo = createWriteStream(outputVideoPath);
  const writableAudio = createWriteStream(outputAudioPath);

  await pipeline(readableVideo, writableVideo);
  await pipeline(readableAudio, writableAudio);

  readableVideo.on('end', () => console.log('Video stream downloaded successfully.'));
  readableAudio.on('end', () => console.log('Audio stream downloaded successfully.'));
  writableVideo.on('finish', () => console.log('Video written to file successfully.'));
  writableAudio.on('finish', () => console.log('Audio written to file successfully.'));

  readableVideo.destroy();
  writableVideo.destroy();
  readableAudio.destroy();
  writableAudio.destroy();`