
Recherche avancée
Autres articles (23)
-
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
Sur d’autres sites (5940)
-
avfilter/scale_cuda : add support for rgb32/bgr32 conversions
16 juin 2023, par Philip Langdaleavfilter/scale_cuda : add support for rgb32/bgr32 conversions
As we are introducing two new formats and supporting conversions
between them, and also with the existing 0rgb32/0bgr32 formats, we get
a combinatorial explosion of kernels. I introduced a few new macros to
keep the things mostly managable.The conversions are all simple, following existing patterns, with four
specific exceptions. When converting from 0rgb32/0bgr32 to rgb32/bgr32,
we need to ensure the alpha value is set to 1. In all other cases, it
can just be passed through, either to be used or ignored. -
Node.js, fluent-ffmpeg : Generate thumbnails with size dependent on if the video is wider or taller
13 mars 2020, par Bone JonesI am trying to use fluent-ffmpeg to generate thumbnails in Node.js. These thumbnails need to be no wider/taller than 150px and maintain the original aspect ratio of the video. For example, if the width of the video is greater than the height the size should be
150xSmallerHeight
and if the video is tallerSmallerWidthx150
.This is my current code :
var ffmpeg = require('fluent-ffmpeg');
...
ffmpeg(fileName)
.thumbnail({
timestamps: [0],
folder: outFolder,
filename: outName,
size: '150x150' // Generates a 150px square thumbnail as expected, but is not the desired behavior
})
.on('end', function () {
console.log('Screenshot taken');
});From what I can see in the fluent-ffmpeg docs these are the only options to control the size of a thumbnail :
- 640x480: set a fixed output frame size. Unless autopad() is called, this may result in the video being stretched or squeezed to fit the requested size.
- 640x?: set a fixed width and compute height automatically. If aspect() is also called, it is used to compute video height; otherwise it is computed so that the input aspect ratio is preserved.
- ?x480: set a fixed height and compute width automatically. If aspect() is also called, it is used to compute video width; otherwise it is computed so that the input aspect ratio is preserved.
- 50%: rescale both width and height to the given percentage. Aspect ratio is always preserved.I don’t believe any of these options would allow me to generate the thumbnail described unless I had access to the video’s original width and height, for example :
...
size: `${video.width >= video.height ? '150' : '?'}x${video.height >= video.width ? '150' : '?'}`
...How can I create a thumbnail as described using fluent-ffmpeg ?
-
Pyinstaller exe works halfway on another computer
5 novembre 2022, par At BayI wrote a code which uses FFMPEG and os, subprocess, datetime, speechrecognition, and xlsxwriter libraries. Below a brief sketch of the code - it goes through a directory of wav files and creates a transcription for X seconds in length and saves it into an excel sheet.
import os
import subprocess
import datetime
import speech_recognition as sr
import xlsxwriter


def ffmpeg():
 #create clip
 subprocess.run(["ffmpeg", "-ss", starti, "-t", lengthi, "-i", filepathO, filepathNEW1])

 #convert to mono
 subprocess.run(["ffmpeg", "-i", filepathNEW1, "-ac", "1", filepathNEW2])
 
 #compres to 44.1 kHZ
 subprocess.run(["ffmpeg", "-i", filepathNEW2, "-ar", "44100", filepathNEW3])

def transcription():
 with sr.AudioFile(os.path.abspath(clippath)) as source:
 audio = r.record(source) # read the entire audio file
 transcriptstring = str(r.recognize_google(audio, language = 'en', show_all=True))
 worksheet.write(tcol, transcriptstring)


#call functions in this order
for filename in os.listdir(ufolder):
 if (filename.endswith(".wav")):
 ffmpeg() #cuts clips, compresses to mono and 44.1 khz
 transcription() 

workbook.close()




When I try to run the exe created by pyinstaller, I get the following error :


Enter directory of wav files: C:\Users\myname\Downloads\
Enter clip start (seconds): 0
Enter desired clip length (seconds): 5
Traceback (most recent call last):
 File "cliptranscript.py", line 134, in <module>
 File "cliptranscript.py", line 47, in ffmpeg
 File "subprocess.py", line 503, in run
 File "subprocess.py", line 971, in __init__
 File "subprocess.py", line 1440, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified
[13304] Failed to execute script 'cliptranscript' due to unhandled exception!
</module>


Below is a partial view of the folder created by pyinstaller :