Recherche avancée

Médias (17)

Mot : - Tags -/wired

Autres articles (112)

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

  • No identifiable expectation during counting in python

    15 octobre 2022, par ALex Break

    I want to count the number of scenes(videos_files). I download many videos and cut them by the scene I count the number of videos(scenes) example : video 1 has 10 scenes video 2 has 15 scenes so the count is 25. I have an issue that it is working counting well and just from noting any expectation is to count 0 and it will start counting again I do not know why.
imports :

    


    from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
from pytube import YouTube
from pytube import Channel
import re
import random
import datetime
import time
import os
from scenedetect import open_video, ContentDetector, SceneManager, StatsManager
from pytube import Playlist
import youtube_dl
import requests
from pexels_api import API


    


    find_scenes :

    


    def find_scenes(video_path,):
   

    video_stream = open_video(video_path)
    stats_manager = StatsManager()
    # Construct our SceneManager and pass it our StatsManager.
    scene_manager = SceneManager(stats_manager)

    # Add ContentDetector algorithm (each detector's constructor
    # takes various options, e.g. threshold).
    scene_manager.add_detector(ContentDetector())

    # Save calculated metrics for each frame to {VIDEO_PATH}.stats.csv.
    stats_file_path = '%s.stats.csv' % video_path

    # Perform scene detection.
    scene_manager.detect_scenes(video=video_stream)
    scene_list = scene_manager.get_scene_list()
    n=0
    for i, scene in enumerate(scene_list):
      x=scene[0].get_timecode()
      y= scene[1].get_timecode()
      x = time.strptime(x.split('.')[0],'%H:%M:%S')
      x = datetime.timedelta(hours=x.tm_hour,minutes=x.tm_min,seconds=x.tm_sec).total_seconds()
      y = time.strptime(y.split('.')[0],'%H:%M:%S')
      y=datetime.timedelta(hours=y.tm_hour,minutes=y.tm_min,seconds=y.tm_sec).total_seconds()
      
      if y > 0:
        if y-x > 1:
          ffmpeg_extract_subclip(video_path, x,y, targetname=f"test{n}.mp4")
          print(f"This is a name of video: test{n}.mp4")
          n+=1
    return n


    


    code :

    


    #Sncrape video and find chanells url
c = Channel("https://www.youtube.com/c/BuildEmpire/videos")
for url in c.video_urls[:20]:
  video = YouTube(url)
  description2 = video.description
  try:
    videos_credits = slicer(description2,"Video Credits:")
    videos_credits = reversed_slicer(videos_credits,"Thumbnail:")
    urls = re.findall(r'(https?://[^\s]+)', videos_credits)
  except Exception:
    print("Sorry but I choose bad youtube video I will try it again")

#Scrape videos from chanells
n = 0
youtube_videos_list = []
lens = 0
channel= random.choice(urls)
chanell = Channel(channel)
try:
  for video in chanell.video_urls:
      youtube_videos_list.append(video)
      n+=1
except Exception:
  print(f"Error 404 on chanell{chanell}")

print(f"This is a number of urls: {n}")

#Download and cut by scenes
lens = 0
list_of_videos = []
n = 0
full_count = 0
count_of_scenes_per_video = 0
while lens < 600:
   videos = random.choice(youtube_videos_list)
   list_of_videos.append(videos)
   z = YouTube(videos)
   lenght = z.length
   lens = lens + lenght
   print(F"downolading video: {videos}")
   download(videos,n)
   print("download completed")

   #Just for clear output
   print(" ")
   print(" ")

   print(f"This is a temorary lengt of videos {lens}")
   print(f"This is a count_of_scenes_per_video {count_of_scenes_per_video}")
   count_of_scenes_per_video = find_scenes(f"video{n}.mp4",)
   print(f"This is a count_of_scenes_per_video after find_scenes {count_of_scenes_per_video}")
   n += 1
print(f"This is a full lengt of videos {lens}")


    


    this is happening in the console :

    


    This is the first shot
This is a scene shot after error

    


  • Playback / recording problems

    3 novembre 2024, par Wessiez

    The code I'm working on gives me some errors. This results in frame lost when recording.

    


    The overview : A video is paused in the first frame. When the motion sensor is detected the video is playing a scary scene. After that it pauses again on the first frame.
At the same time when motion is detected the camera starts recording the reaction of the poeple watching the scary scene.

    


    This is my code :

    


    from gpiozero import MotionSensor
from time import sleep
from picamera2 import Picamera2
from picamera2.encoders import H264Encoder
from picamera2.outputs import FfmpegOutput
import vlc
import datetime

# Creating Instance class object
vlc_instance = vlc.Instance()
player = vlc_instance.media_player_new()
player.set_fullscreen(True)
  
# Define Motion Sensor
pir = MotionSensor(4)

# Camera
camera = Picamera2()
video_config = camera.create_video_configuration()
camera.configure(video_config)
camera.rotation = 180
encoder = H264Encoder(bitrate=10000000)
output = FfmpegOutput('/home/wessie/Halloween/Recordings/' + datetime.datetime.now().strftime('%Y-%m-%d_%H.%M.%S.h264'))

print("Sensor loading")
pir.wait_for_no_motion()
sleep(.1)
player.set_mrl("/home/wessie/Halloween/ScareMedia/FemaleScare.mp4")
player.play()
sleep(.1)

while True:
    try:
        print("Ready")
        pir.wait_for_motion()
        sleep(.1)
        print("Motion detected")
        sleep(.1)
        player.set_mrl("/home/wessie/Halloween/ScareMedia/FemaleScare.mp4")
        player.play()
        sleep(.1)
        camera.start_recording(encoder, output)
        sleep(12)
        camera.stop_recording()
        while player.get_state() in playing:
            sleep(.1)
            continue        
        print("Finished")
        sleep(.1)
    except KeyboardInterrupt:
        break
    except:
        continue


    


    After "Motion detected" the message is :
"Application provided invalid non monotonically increasing dts to muxer in stream 0 :"

    


    I've tried to cleanup this code, but everything I do results in other errors.

    


    Is the code in the right order ? The scary scene seems to work, but the recording is not 100%

    


  • JAVAFX. MediaException : UNKNOWN. com.sun.media.jfxmedia.MediaException : Could not create player [duplicate]

    25 avril 2020, par Gin Vu

    i am very new to JAVAFX and i had this problem with my project when i try to play a mp3 file. I had tried install ffmpeg but it doesnt help. the issue is that cannot create player, so any other solution. I am using ubuntu 20.04.

    



    &#xA;    String video=new File(path).getAbsolutePath();&#xA;    Media media=new Media(new File(video).toURI().toString());&#xA;    MediaPlayer mediaPlayer=new MediaPlayer(media);```&#xA;&#xA;```Caused by: MediaException: UNKNOWN : com.sun.media.jfxmedia.MediaException: Could not create player! : com.sun.media.jfxmedia.MediaException: Could not create player!&#xA;    at javafx.media/javafx.scene.media.MediaException.exceptionToMediaException(MediaException.java:146)&#xA;    at javafx.media/javafx.scene.media.MediaPlayer.init(MediaPlayer.java:518)&#xA;    at javafx.media/javafx.scene.media.MediaPlayer.<init>(MediaPlayer.java:421)&#xA;    at sample.control.<init>(control.java:60)&#xA;    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)&#xA;    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)&#xA;    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)&#xA;    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)&#xA;    at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:124)&#xA;    at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:346)&#xA;    at java.base/java.lang.Class.newInstance(Class.java:604)&#xA;    at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:936)&#xA;    at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:980)&#xA;    at javafx.fxml/javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:227)&#xA;    at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:752)&#xA;    at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2722)&#xA;    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2552)&#xA;    ... 64 more```&#xA;</init></init>

    &#xA;