
Recherche avancée
Médias (1)
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
Autres articles (100)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains 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 ;
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (12501)
-
No identifiable expectation during counting in python
15 octobre 2022, par ALex BreakI 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 :




-
Streaming images as video on the fly using ffmpeg and ffserver
1er décembre 2017, par AstrOneI have an OpenGL application that renders a 3D scene, and in every frame, it captures the OpenGL frame buffer, and saves it to a series of files (frame_1.png, frame_2.png, etc). I want to convert those images into a video stream and serve/broadcast it. From what I have read so far one solution would be to use ffmpeg and ffserver.
There are several similar questions on StackOverflow but each one is a bit different, and they don’t ask exactly what I want. For example there are solutions to generate videos (but not streams) from images. Some others generate streams but not "live" ones. And so on.
- I want the generated frames to be streamed as soon as possible after they are created. This is because the OpenGL application is supposed to be interactive. Latter on, a remote user should be able to send events (mouse motions and clicks) and interact with the rendered 3D scene.
- I don’t want ffserver to do any kind of buffering because there is nothing to buffer, the frames must be served immediately.
- Given that the frames must be served immediately, I guess I could just write the frames on top of each other. However, in that case there will be a synchronisation problem because the ffmpeg may try to read the image before the OpenGL application has finished writing on it. Any thoughts on that ?
- In case the ffserver and the OpenGL application share the same RAM and not just the filesystem, ideally, I would like to not use files at all for the communication. I guess for my OpenGL application I could use something like mmap or some sort of shared memory, but ffmpeg can’t read from some kind of shared memory, right ?
I would be more than grateful if someone could advice me how I need to setup the ffserver and the ffmpeg command to meet the above requirements (especially the first one).
-
FFMPEG & ScrollMagic : Safari bug
27 novembre 2020, par gusv7I got this site where video playback is linked to scroll position. I'm using a FFMPEG-encoded .mp4 file and ScrollMagic to handle the scroll event. It works perfectly on Chrome, Opera and FF, but crashes on Safari : the animation is delayed and the video disappears once it reaches the end of the playback on Safari OS. It also doesn't show on iOS, not in Safari or Chrome... :/


Here's the markup :


<section class="shaka-container padding-x-lg flex-end">
 <div class="shaka">
 <video src="/assets/maozinha.mp4" type="video/mp4" playsinline="true"></video>
 </div>
</section>



The JS :



<code class="echappe-js"><script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/gsap.min.js"></script>


<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.8/ScrollMagic.min.js" integrity="sha512-8E3KZoPoZCD&#x2B;1dgfqhPbejQBnQfBXe8FuwL4z/c8sTrgeDMFEnoyTlH3obB4/fV&#x2B;6Sg0a0XF&#x2B;L/6xS4Xx1fUEg==" crossorigin="anonymous"></script>


<script>&#xA; // Shaka Animation&#xA; const intro = document.querySelector(&#x27;.shaka&#x27;);&#xA; const video = intro.querySelector(&#x27;video&#x27;);&#xA;&#xA; // SCROLL MAGIC&#xA;&#xA; const controller = new ScrollMagic.Controller();&#xA;&#xA; // Scenes&#xA; const scene = new ScrollMagic.Scene({&#xA; duration: 0,&#xA; triggerElement: intro,&#xA; triggerHook: 0, &#xA; })&#xA; .addTo(controller);&#xA;&#xA; // Video Animation&#xA;&#xA; let accelamount = 0.5;&#xA; let scrollpos = 0;&#xA; let delay = 0;&#xA;&#xA; scene.on(&#x27;update&#x27;, e => {&#xA; scrollpos = e.scrollPos / 1000;&#xA; });&#xA;&#xA; setInterval(() => {&#xA; delay &#x2B;= (scrollpos - delay) * accelamount;&#xA; video.currentTime = delay;&#xA; }, 24);&#xA;</script>



I wonder if the video encoding is the issue or how Safari processes the video playback ? I've used the following encoding for the video :


First :

ffmpeg -i ~/assets/mao-final.mp4 -vf scale=960:-2 -movflags faststart -vcodec libx264 -crf 20 -g 1 -pix_fmt yuv420p mao-final-960.mp4


Then,

ffmpeg -i ~/assets/mao-final.mp4 -vf scale=960:-2 -movflags faststart -vcodec libx264 -crf 20 -g 1 -pix_fmt yuv420p maozinha.mp4


I'm considering changing it to a
canvas
animation if I can't get to a solution. Please help !