Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

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

Autres articles (91)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (3558)

  • MJPEG Stream works in Firefox but not in Chrome

    11 décembre 2019, par Maoration

    We have a system that contains cameras and we want to stream them to multiple clients.
    Behind the scenes on the server we get connections from cameras, we keep everything related to that camera in a CameraContainer, which also includes a mpegtsToMjpegStream that extends Duplex (both Readable and Writable Stream).

    after a camera connects, we open an ffmpeg process to work on the incoming mpegts stream, and output an MJPEG stream :

         '-map', '0:v', '-c:v', 'mjpeg','-f', 'mjpeg', `-`,

    ** we are doing this because we are also mapping to other outputs, like writing files.


    On the ’serving’ side, we are currently testing a simple API to GET an mjpeg stream with a camera id :

     async getCameraStream(@Param('cameraId') cameraId: string, @Res() res): Promise<any> {
    const cameraContainer = this.cameraBridgeService.getCameraContainer(cameraId);
    if (!cameraContainer) {
     throw new Error(`Camera with id: ${cameraId} was not found`);
    }

    if (!cameraContainer.mpegtsToMjpegStream) {
     throw new Error('ERROR: mpegtsToMjpegStream stream does not exist on this camera container');
    }

    const writable = new Writable({
     write: (chunk, encoding, callback) => {
       res.write(`Content-Type: image/jpeg\r\nContent-Length: ${chunk.length}\r\n\r\n`);
       res.write(chunk);
       res.write('\r\n--ffmpeg_streamer\r\n');
       callback();
     },
    });

    res.set('Content-Type', 'multipart/x-mixed-replace;boundary=ffmpeg_streamer');
    res.write('--ffmpeg_streamer\r\n');

    cameraContainer.mpegtsToMjpegStream.pipe(writable, { end: false });

    res.once('close', () => {
     if (cameraContainer.mpegtsToMjpegStream &amp;&amp; writable) {
       cameraContainer.mpegtsToMjpegStream.unpipe(writable);
     }
     res.destroy();
    });
    </any>

    The problem is this code works very nicely when accessing the stream with Firefox- after 1-2 seconds we get a stable, high quality, low latency stream.
    With Chrome however, the same code does not behave- the video output is corrupted, disappears into a black screen all the time, and we have to keep refreshing the page constantly just to view a few seconds of the stream until it disappears again.

    Any suggestions as to why this happens and how can I fix it ?

  • Shell script works fine from shell but doesn’t work as expected when executed via PHP “shell_exec” code

    9 décembre 2019, par Eric Feillant

    This record.sh script shell is here and works fine on command line to record an MP4 file from a local flv live stream :

    DATE=`date +"%d-%m-%Y-%T"`
    if [ -s NAMESTREAM ]
    then
    cat config.php | dos2unix | grep auth | grep username | \
    awk -F ' ' '{print $3}' | sed "s/'//g" | sed "s/;//g" | while read VAR
    do echo $VAR > RECSTREAM
    echo "Starting recording ..."
    ffmpeg -i "rtmp://localhost/hls/$VAR" -crf 19 videos/"$VAR"_"$DATE".mp4
    done
    else
    echo "Streaming is not started, please start it before"
    fi

    I send a shell_exec to call the last shell script in a php script like this :

    $old_path = getcwd();
    chdir('/usr/local/nginx/html/mydir');
    $output = shell_exec('nohup ./record.sh >/dev/null 2>/dev/null &amp;');
    chdir($old_path);

    The MP4 video files are generated but unreadable with VLC, etc… It seems that the problem is due to my PHP script but I am not able to know why.

    When executing from the shell command line : PHP myphpscript.php works fine, MP4 video files are OK. But from the PHP web page, the MP4 video files are corrupted.

    Any ideas ? Any param to test in FFmpeg to have a good mp4 video file ?

  • Rails 5 with Carrierwave and S3 - creating multiple video formats for DASH streaming works but mpd file breaks

    22 novembre 2019, par Milind

    what I am doing -
    i have a Rails 5 app for video streaming(DASH MPEG) that uses FFMPEG to get encoded stream videos by converting any single video into multiple videos of multiple bit rates/size and primarily also MPD FILE that can be played easily on html video player, which i have already tested by manually running the ffmpeg scripts on the console that generates all the files.However, I want to automate this process and hence carrierwave comes into the pictures.
    Here, i use carrierwave to generate different versions(size/bitrate) of videos(mp4/webm) to upload to s3 but during running the version, where all the versions are successfully created in tmp folder, only the last version(mpd) that needs to create .mpd file, carrierwave creates a mp4 video file and just replaces the extension instead of actually creating the mpd file.

    So in the aws s3(screenshot added below), i can see my all versions and mpd file , but that mpd file which must be xml file is actually a mp4 video file or uploaded version file itself.
    I have also tried to create new file during the process, but it never works.
    Has some one encountered this problem ?

    any help will be greatly appreciated ?

    Ny code snippets below - model,uploader,output of script on the console during upload, s3 screenshot

      ##### models/video.rb ##########

       mount_uploader :video, VideoUploader  

      ####### uploaders/video_uploader.rb #########

       class VideoUploader &lt; CarrierWave::Uploader::Base


       include CarrierWave::MiniMagick
       include CarrierWave::Video
       include CarrierWave::Video::Thumbnailer
       include ::CarrierWave::Backgrounder::Delay

       ####### for streaming ..first get the audio and then convert the input video into multiple bitrates/scale #######

       ###first get audio and then get all different versions of same video
       version :video_audio do
         process :get_audio

         def get_audio
           `ffmpeg -y -i "#{file.path}" -c:a aac -ac 2 -ab 128k -vn video_audio.mp4`
         end

           def full_filename(for_file)
             "video_audio.mp4"
           end

           def filename
             "video_audio.mp4"
           end        
       end

       ####### similar to the above i have various version like ...#########

       version :video_1080 do...end
       version :video_720 do... end
       version :video_480 do ...end
       ...and so on..and all these versions are successfully created and uploaded to s3, however..in next version ...show it also creates a video file whereas i need a simple mpd file ONLY.

            ###this is where even after everything works, in S3, i can see a video file of version mpd and not actual mpd file
            version :mpd  do
              process :get_manifest
                 ###here in the command below, the video.mpd file is successfully obtained but its uploaded as video.mpd file of added/uploaded video file and not a new mpd file
                 ###tried with ffmpeg -f webm_dash_manifest -i too, but s3 still shows a mp4 file
                 `MP4Box -dash 1000 -rap -frag-rap -profile onDemand -out video.mpd video_1080.mp4 video_720.mp4 video_480.mp4 video_360.mp4 video_240.mp4 video_audio.mp4 `

              end
             end

            ######### sidekiq console output - successful mpd is generated ################
                 DASH-ing files - single segment
                 Subsegment duration 1.000 - Fragment duration: 1.000 secs
                 Splitting segments and fragments at GOP boundaries
                 DASHing file video_1080.mp4
                 DASHing file video_720.mp4                                  
                 DASHing file video_480.mp4                                  
                 DASHing file video_360.mp4                                  
                 DASHing file video_240.mp4                                  
                 DASHing file video_audio.mp4                                
                \[DASH\] Generating MPD at time 2019-11-22T00:01:59.872Z      
                 mpd_1mb.mp4
                 mpd_video.mpd

    this is what the uploaded files looks on s3, notice the video.mpd, its a mp4 video file just like others which should have been a simple mpd file of not more than 2kb.

    Is there something that I am missing ?
    Can Carrierwave do this or is it not made for this ?
    Do I have to write a callback and then programmatically upload files to s3, if carrierwave is not helping in this regard ?

    Kindly provide any suggestion or useful advice so that I can move ahead.

    aws s3 list