Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (61)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

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

Sur d’autres sites (3873)

  • Can i limit CPU usage of my Script ? Raspberry pi cpu crashing [duplicate]

    2 novembre 2024, par Mateus Coelho

    I have a script, in python, that converts a video of 11mb, 30fps, 1080p. the code puts 4 imagens into it, with overlay, and rotates 90.
When i run the script into the raspberry pi, it goes off CPU, all the 4 threads go to 100% and it suently reboots.

    


    Raspberry pi 4 b 4gb

    


    I want to limit the cpu to like 60% to the script... its not a problems to be longer in time.

    


    import subprocess
import sys
import time
import psutil
import os

def overlay_images_on_video(input_file, image_files, output_file, positions, image_size=(100, 100), opacity=0.7):
    start_time = time.time()
    process = psutil.Process(os.getpid())

    inputs = ['-i', input_file]
    for image in image_files:
        if image:
            inputs += ['-i', image]
    filter_complex = "[0:v]transpose=2[rotated];"
    current_stream = "[rotated]"
    for i, (x_offset, y_offset) in enumerate(positions):
        filter_complex += f"[{i+1}:v]scale={image_size[0]}:{image_size[1]},format=rgba,colorchannelmixer=aa={opacity}[img{i}];"
        filter_complex += f"{current_stream}[img{i}]overlay={x_offset}:{y_offset}"
        if i < len(positions) - 1:
            filter_complex += f"[tmp{i}];"
            current_stream = f"[tmp{i}]"
        else:
            filter_complex += ""
    command = ['ffmpeg', '-threads', '1'] + inputs + ['-filter_complex', filter_complex, output_file]
    
    try:
        subprocess.run(command, check=True)
        print(f"Vídeo processado com sucesso: {output_file}")
    except subprocess.CalledProcessError as e:
        print(f"Erro ao processar o vídeo: {e}")
    
    # Monitoramento de tempo, memória e CPU
    elapsed_time = time.time() - start_time
    memory_info = process.memory_info()
    cpu_usage = process.cpu_percent(interval=1)
    print(f"Tempo de execução: {elapsed_time:.2f} segundos")
    print(f"Memória usada: {memory_info.rss / (1024 * 1024):.2f} MB")
    print(f"Uso de CPU: {cpu_usage}%")
    
    # Monitoramento de GPU (se disponível)
    try:
        gpu_usage = subprocess.check_output(
            ["nvidia-smi", "--query-gpu=utilization.gpu", "--format=csv,noheader,nounits"]
        ).decode("utf-8").strip()
        print(f"Uso de GPU: {gpu_usage}%")
    except FileNotFoundError:
        print("GPU não detectada ou `nvidia-smi` não está disponível.")

if __name__ == "__main__":
    input_video = sys.argv[1]
    image_files = sys.argv[2:5]
    output_video = sys.argv[5]
    
    positions = [(10, 10), (35, 1630), (800, 1630)]
    overlay_images_on_video(input_video, image_files, output_video, positions, image_size=(250, 250), opacity=0.8)


    


  • Erreur installation de xmp_toolkit sur wheezy

    12 août 2013

    Le script d’installation pour la branche 0.2 échoue sur une distribution Debian Wheezy.

    Déjà une erreur sur la commande svn :

    Et plus loin une erreur pendant la compilation

  • ruby on rails carrierwave-video ffmpeg AWS

    11 mars 2015, par Joseph Han Nim Jang

    I am trying to create an academic site where users can upload lecture videos and other users can view them - similar to a site like Udemy.

    I am using Carrierwave, Carrierwave-video (for encoding videos), AWS to make this happen. AWS configuration has been done, and it’s working.

    However, I am getting this error. (By the way, I am testing this video feature in a Yelpdemo site, so I am trying to have users upload videos to restaurants for now.)

    rails points the error to @restaurant = Restaurant.new(restaurant_params)

    Errno::ENOENT in RestaurantsController#create

    No such file or directory - ffmpeg

    # POST /restaurants.json
    def create
    @restaurant = Restaurant.new(restaurant_params)

    respond_to do |format|
     if @restaurant.save

    This is my video_uploader.rb

    # encoding: utf-8

    class VideoUploader < CarrierWave::Uploader::Base

     include CarrierWave::Video
     include CarrierWave::Video::Thumbnailer

     process encode_video: [:mp4]

     include CarrierWave::MiniMagick

     storage :fog

     def store_dir
       "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
     end

      version :thumb do
         process thumbnail: [{format: 'png', quality: 10, size: 192, strip: true, logger: Rails.logger}]
         def full_filename for_file
           png_name for_file, version_name
         end
     end

       def png_name for_file, version_name
         %Q{#{version_name}_#{for_file.chomp(File.extname(for_file))}.png}
       end
    end

    I have manually (added a file to the model) created video.rb in the model - not sure if this is the right way to do it..

    class Video < ActiveRecord::Base

     attr_accessor :user_id, :video,, :type, :filename, :path, :filesize, :width, :height, :duration, :bit_rate

     belongs_to :restaurant
     belongs_to :user

     mount_uploader :video, VideoUploader
    end

    in app/views/restaurants/show.html.erb for showing the video. Right now, without the encoding done, I can see like an image of the video. When I right lick and copy the code - it gives me the AWS URL which means AWS configuration is in place

           <p>
               <strong>Video:</strong>
               &lt;%= video_tag @restaurant.video_url %>
           </p>

    I am trying to show videos like this.

    I have downloaded FFMPEG (both ffmpeg-2.6 and SnowLeopard_Lion_Mountain_Yosemite_17) - not sure which one’s the right one.. And I have read somewhere that you need to place FFMPEG in your usr/local/bin -> So do you have to physically place ffmpeg exec file in your respective folder ?

    Need your expert help please.

    Thank you in advance !