
Recherche avancée
Médias (91)
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
-
USGS Real-time Earthquakes
8 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
SWFUpload Process
6 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
-
Creativecommons informational flyer
16 mai 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (75)
-
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 ;
-
Ecrire une actualité
21 juin 2013, parPré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 ) (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (9959)
-
Use the referer protocol+host only for the redirect match.
12 juin 2015, par blueimpUse the referer protocol+host only for the redirect match.
-
avutil/tx_template : Don't waste space for inexistent factors
22 octobre 2022, par Andreas Rheinhardtavutil/tx_template : Don't waste space for inexistent factors
It is possible to avoid the factors array for the power-of-two
tables for which said array is unused by using a different
structure for initialization for power-of-two tables than for
non-power-of-two-tables. This saves 3*15*16B from .data.Reviewed-by : Lynne <dev@lynne.ee>
Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com> -
Getting Error message Unknown encoder 'libx264' , any help appreciated
16 janvier 2022, par Alex.FosterI am trying to compress videos files to a target size within python using ffmpeg-python for an A level project as part of my coursework, I keep getting this error saying it doesn't know the encoder. Not sure what I'm meant to do as this is literally an entirely new space to me. Am I meant to have installed the codec or something, or is there an alternative I can use ?


import os, ffmpeg
##import section:this part is where I import all of the modules I will use
import tkinter
import shutil
from tkinter import filedialog
import os


def fileSelect(): #start of fileSelect function
 global startingLocation #declares startingLocation as global variable
 global originalName #declares originalName as global variable
 global fileType #declares fileType as global variable
 startingLocation = filedialog.askopenfilename(initialdir="/", title="Select file", #tkinter function that opens file explorer, lets user select file saves the file path as a variable
 filetypes=(("video files", "*.mp4"),("images", "*.jpg*")))
 originalName = os.path.basename(startingLocation) #os function that gets the actaul file name from the path string
 print (originalName) #print statement to check if originalName has been found
 fileType = startingLocation.split('.') #splits original name where any full stop in found and saves array as variable
 fileType = fileType[-1] #changes variable to have the str value of the final item in the array; the file type
 fileType = '.' + fileType #adds fullstop to the start of the file type so i dont have to repeatedly do it
 print (fileType) #print statement to check file type is found correctly

def outputSelect(): #start of outputSelect function
 global outputLocation #declares outputLocation as global variable
 outputLocation = filedialog.askdirectory(initialdir="/", title="Select folder") #tkinter function that opens file explorer, lets the user select of folder as saves the folder path as a variable

def fileNewName(): #start of fileNewName function
 global customName #declares customName as global variable
 customName = input("Enter the end name of your file") #simple code assigning user input to the custom name vairable
 customName = customName + fileType #add the fileType onto the end of the custom name

def compress(): #start of compress function
 fileSelect() #calls the fileSelect function
 outputSelect() #calls the outputSelect function
 fileNewName()
 global src
 global dst #calls the fileNewName function
 src = startingLocation #assigns startingLocation str as src, so the shutil module is able to use it in a cleaner way
 dst = outputLocation #assigns outputLocation dst as src, so the shutil module is able to use it in a cleaner way
 shutil.copy(src, dst) #shutil command that copies the file from src to dst
 src = outputLocation + '/' + originalName #reassigns src as the location of the file copy
 dst = outputLocation + '/' + customName #reassigns dst as the location of the file copy but with a new name
 shutil.move(src,dst)


def compress_video(video_full_path, output_file_name, target_size):
 # Reference: https://en.wikipedia.org/wiki/Bit_rate#Encoding_bit_rate
 min_audio_bitrate = 32000
 max_audio_bitrate = 256000

 probe = ffmpeg.probe(video_full_path)
 # Video duration, in s.
 duration = float(probe['format']['duration'])
 # Audio bitrate, in bps.
 audio_bitrate = float(next((s for s in probe['streams'] if s['codec_type'] == 'audio'), None)['bit_rate'])
 # Target total bitrate, in bps.
 target_total_bitrate = (target_size * 1024 * 8) / (1.073741824 * duration)

 # Target audio bitrate, in bps
 if 10 * audio_bitrate > target_total_bitrate:
 audio_bitrate = target_total_bitrate / 10
 if audio_bitrate < min_audio_bitrate < target_total_bitrate:
 audio_bitrate = min_audio_bitrate
 elif audio_bitrate > max_audio_bitrate:
 audio_bitrate = max_audio_bitrate
 # Target video bitrate, in bps.
 video_bitrate = target_total_bitrate - audio_bitrate

 i = ffmpeg.input(video_full_path)
 ffmpeg.output(i, os.devnull,
 **{'c:v': 'libx264', 'b:v': video_bitrate, 'pass': 1, 'f': 'mp4'}
 ).overwrite_output().run()
 ffmpeg.output(i, output_file_name,
 **{'c:v': 'libx264', 'b:v': video_bitrate, 'pass': 2, 'c:a': 'aac', 'b:a': audio_bitrate}
 ).overwrite_output().run()

compress()
compress_video(dst, outputLocation, 3 * 1000)