
Recherche avancée
Médias (1)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
Autres articles (63)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications 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 (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette 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.
Sur d’autres sites (7903)
-
Building FFMPEG library for iOS5.1 ARMv7 Processor
26 octobre 2012, par JimmyI cleaned up my question a little bit, when I wrote it the first time I was flustered. Now I can be more clear after taking a small break.
I'm trying to use the FFMPEG library in an XCode 4.5.1 project. And I'm trying to build it for ARMv7. What I'm looking for is the exact process, and some explanation. I understand that this is not a well documented problem. But I know that other pople have had the same problem as me.
What I have been able to do.
I have been able to build the library for xCode. here Is what I have been able to do step by step.
1) I have been able to clone ffmpeg. For beginners this will get you started by creating a directory with the ffmpeg source. (Kudos to the guys who wrote it)
git clone git ://source.ffmpeg.org/ffmpeg.git ffmpeg
2) I have been able to write a config file that doesn't have any errors. We will go back to this part later. This is the command I attach to ./configure
./configure
—disable-doc
—disable-ffmpeg
—disable-ffplay
—disable-ffserver
—enable-cross-compile
—arch=arm
—target-os=darwin
—cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/arm-apple-darwin10-llvm-gcc-4.2—as='gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/arm-apple-darwin10-llvm-gcc-4.2'
—sysroot=/applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk
—cpu=cortex-a8
—extra-ldflags='-arch=armv7 -isysroot /applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk'
—enable-pic —disable-bzlib —disable-gpl —disable-shared —enable-static —disable-mmx —disable-debug —disable-neon —extra-cflags='-pipe -Os -gdwarf-2 -isysroot /applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
-m$thumb_opt :-no-thumb -mthumb-interwork'These are some things to note.
- I had to download ( https://github.com/yuvi/gas-preprocessor ) copy the file gas-preprocessor.pl at /usr/local/bin. Set permissions to read write (777)
- Make sure I'm using the right GCC compiler : /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/arm-apple-darwin10-llvm-gcc-4.2
- Make sure I'm using the right SDK : /applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
- —extra-cflags="-arch armv7" causes : error : unrecognized command line option “-arch”
Here in lies the problem.
When I include the library and the declaration. Everything works fine ! (You will want to make sure your library paths in xcode are properly written if it can't find the library. There are plenty of people with this problem, stackover flow has a wealth of knowledge here)
But when I started to write the encoder. I received this warning, and countless errors.
ignoring file /Users/Jimmy/Development/source.ffmpeg/Library/libavutil.a, file was built for archive which is not the architecture being linked (armv7s) : /Users/Jimmy/Development/source.ffmpeg/Library/libavutil.a
That means that I didn't build for ARMv7 and that -arch configuration I took out is actually essential.
What I'm looking for is someone whose done it before, to walk all of us through the process of building FFMPEG for iOS5.1 and ARMv7 and the majority of things to look out for. If no one comes forth, in time I'll answer my own question and hopefully help out others who are struggling too.
-
Cutting multiple videos with x amount of time from the end (ffmpeg ?)
25 octobre 2020, par Jack FitzpatrickI have no history with ffmpeg, but I am assuming this would be the right tool for the job. I am trying to cut a folder of videos with different lengths. I want to cut them all to be 12 seconds from the end. That is : on a 30 second video I would be left with 00:18 - 00:30. 00:00-00:17 would be deleted.


I am on mac OS Mojave. It seems that ffmpeg is the right tool for the job to batch edit these videos. Can someone walk me through this ? I have some basic understanding but will need the code/script explained so that I can apply it to my own use. Thank you very much.


-
How to queue ffmpeg jobs for transcoding ?
25 juillet 2019, par sujit patelThis scripts below check
ftp
fro any media file and starts transcoding usingffmpeg
. Problem is it starts so manyffmpeg
process simultaneously. since so manyffmpeg
process running servers becomes too slow and takes heavy amount of time to transcodes videos. Sometimes server stops working.How to put jobs in a queue ?
#!/usr/bin/env python3
import os, sys, time, threading, subprocess
import logging
from config import MEDIA_SERVER, MEDIA_SERVER_USERNAME, MEDIA_DIRS, LOCAL_MEDIA_DIR_ROOT, TRANSCODING_SERVER, TRANSCODING_SERVER_USERNAME, RSYNC_SERVER, RSYNC_USERNAME, RSYNC_DIR, PROCESSING_DIR, PROCESSING_GPU_SCRIPT, PROCESSING_CPU_SCRIPT, EMAIL_SEND_TO, EMAIL_SEND_FROM
from send_email import sendEmail
import sqlite3
logger = logging.getLogger(__name__)
class FuncThread(threading.Thread):
def __init__(self, target, *args):
self._targett = target
self._argst = args
threading.Thread.__init__(self)
def run(self):
self._targett(*self._argst)
class Automator(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.sleepTime=60
self.lastSMILFileCheckTime = 0
self.newlastSMILFileCheckTime = 0
self.lastMediaFileCheckTime = 0
self.newLastMediaFileCheckTime = 0
self.db = None
self.fluid_threads = []
self.scriptRoot = os.path.dirname(os.path.realpath(__file__))
def fluid_thread_add(self, thd):
self.fluid_threads.append(thd)
thd.start()
def processFluidThreads(self):
fluid_cond = [x.is_alive() for x in self.fluid_threads]
finished_threads = [x for x, y in zip(self.fluid_threads, fluid_cond) if not y]
self.fluid_threads = [x for x, y in zip(self.fluid_threads, fluid_cond) if y]
if len(finished_threads) > 0:
logger.info('Fluid threads finished: %s (joining on them now...)' % str(len(finished_threads)))
[thd.join() for thd in finished_threads]
logger.info('Joined finished threads successfully')
if len(self.fluid_threads) > 0:
logger.info('Fluid threads remaining: %s' % str(len(self.fluid_threads)))
def run(self):
self.setupDB()
self.fetchlastCheckTime()
while True:
self.process()
time.sleep(self.sleepTime)
def process(self):
logger.debug("process")
try:
self.handleNewSMILFiles()
self.rsyncFromRemote()
self.handleNewSourceFiles()
# fluid_thread_add(FuncThread(start_single_task, user, task_name, task_path, selected_region))
self.processFluidThreads()
self.updatelastCheckTimes()
except Exception as e:
print(e)
logger.error("Something went wrong while running this")
def handleNewSourceFiles(self):
logger.info("Looking for medial files since " + str(self.lastMediaFileCheckTime))
for root, dirs, filenames in os.walk(PROCESSING_DIR):
for subdir in dirs:
pass
for f in filenames:
if (f.lower().endswith("complete")):
file_path = os.path.join(root, f)
mod_time = self.modification_date(file_path)
if (mod_time > self.lastMediaFileCheckTime):
logger.info("Found a new media File " + file_path)
relDir = os.path.relpath(root, PROCESSING_DIR)
f_name = root.split("/")[-1]
new_output_localdir = os.path.join(LOCAL_MEDIA_DIR_ROOT, relDir)
new_output_localdir = os.path.abspath(os.path.join(new_output_localdir, os.pardir))
new_output_remotedir = new_output_localdir
if new_output_remotedir.startswith(LOCAL_MEDIA_DIR_ROOT):
new_output_remotedir = new_output_remotedir[len(LOCAL_MEDIA_DIR_ROOT):]
if(self.startATranscodingThread(root, new_output_localdir, new_output_remotedir, f_name+".mp4")):
if(mod_time > self.newLastMediaFileCheckTime):
self.newLastMediaFileCheckTime = mod_time
def startATranscodingThread(self, inputFile, outputLocalDIR, outputRemoteDIR, fileName):
self.fluid_thread_add(FuncThread(self.runTranscoder, inputFile, outputLocalDIR, outputRemoteDIR, fileName, MEDIA_SERVER))
return True
def handleNewSMILFiles(self):
if (MEDIA_SERVER != TRANSCODING_SERVER):
logger.info("Media server is separate, fetching last 24 hours SMIL files from " + MEDIA_SERVER)
self.rsyncSMILFiles()
logger.info("Looking for SMIL files since " + str(self.lastSMILFileCheckTime) + " in " + LOCAL_MEDIA_DIR_ROOT)
for root, dirs, filenames in os.walk(LOCAL_MEDIA_DIR_ROOT):
for subdir in dirs:
pass
for f in filenames:
file_path = os.path.join(root, f)
if (f.lower().endswith("stream.smil")):
file_path = os.path.join(root, f)
mod_time = self.modification_date(file_path)
if(mod_time > self.lastSMILFileCheckTime):
logger.info("Found a new SMIL File " + file_path)
relDir = os.path.relpath(root, LOCAL_MEDIA_DIR_ROOT)
f = f.split(".")[0]
new_dir_name = os.path.splitext(os.path.basename(f))[0]
new_dir_name = os.path.join(relDir, new_dir_name)
if(self.createARemoteDirectory(new_dir_name)):
if(mod_time > self.newlastSMILFileCheckTime):
self.newlastSMILFileCheckTime = mod_time
def modification_date(self, filename):
t = os.path.getmtime(filename)
return t
def createARemoteDirectory(self, dirName):
HOST = RSYNC_SERVER
DIR_NAME=RSYNC_DIR + "/" + dirName
COMMAND = "ssh {}@{} mkdir -p {}".format(RSYNC_USERNAME, RSYNC_SERVER, DIR_NAME)
logger.info("Going to execute :-- " + COMMAND)
rv = subprocess.check_call(COMMAND, shell=True)
return True
def rsyncSMILFiles(self):
HOST = RSYNC_SERVER
for MEDIA_DIR in MEDIA_DIRS:
epoch_time = int(time.time())
TEMP_FILE="/tmp/rsync_files.{}".format(epoch_time)
COMMAND = "ssh -o ConnectTimeout=10 {}@{} \"cd {} && find . -mtime -3 -name *.stream.smil > {} && rsync -azP --files-from={} . {}@{}:{}/{}\"".format(MEDIA_SERVER_USERNAME, MEDIA_SERVER, MEDIA_DIR, TEMP_FILE, TEMP_FILE, TRANSCODING_SERVER_USERNAME, TRANSCODING_SERVER, LOCAL_MEDIA_DIR_ROOT, MEDIA_DIR)
logger.info("Going to execute :-- " + COMMAND)
try:
rv = subprocess.check_call(COMMAND, shell=True)
except Exception as e:
logger.error("Unable to connect to media server")
return True
def rsyncFromRemote(self):
HOST = RSYNC_SERVER
COMMAND="rsync -azP --delete {}@{}:{} {} ".format(RSYNC_USERNAME, RSYNC_SERVER, RSYNC_DIR+"/", PROCESSING_DIR)
logger.info("Going to execute :-- " + COMMAND)
rv = subprocess.check_call(COMMAND, shell=True)
return True
def runTranscoder(self, inputDIR, outputLocalDIR, outputRemoteDIR, fileName, media_server):
HOST = RSYNC_SERVER
COMMAND="bash {} {} {} {} {} {}".format(PROCESSING_CPU_SCRIPT, inputDIR, outputLocalDIR, outputRemoteDIR, fileName, media_server)
# if (len(self.fluid_threads)>2):
# COMMAND="bash {} {} {} {} {} {}".format(PROCESSING_CPU_SCRIPT, inputDIR, outputLocalDIR, outputRemoteDIR, fileName, media_server)
logger.info("Going to execute :-- " + COMMAND)
#sendEmail(EMAIL_SEND_TO, EMAIL_SEND_FROM, "Transcoding started for file" + fileName.replace('_','-').replace('/','-'), outputRemoteDIR+fileName)
# sendEmail(EMAIL_SEND_TO, EMAIL_SEND_FROM, "Transcoding started for file" , outputRemoteDIR+fileName)
try:enter code here
rv = subprocess.check_call(COMMAND, shell=True)
# if (rv !=0):
# sendEmail(EMAIL_SEND_TO, EMAIL_SEND_FROM, "Transcoding Failed for a file", outputRemoteDIR+fileName)
except Exception as e:
logger.error("Transcoding Failed for a file :- " + outputRemoteDIR+fileName);
# sendEmail(EMAIL_SEND_TO, EMAIL_SEND_FROM, "Transcoding Failed for a file", outputRemoteDIR+fileName+"\n contact dev@example.com")
return True
def setupDB(self):
self.db = sqlite3.connect('automator.db', detect_types=sqlite3.PARSE_DECLTYPES | sqlite3.PARSE_COLNAMES)
sql = "create table if not exists last_smil_check (last_check_time int)"
self.db.execute(sql)
self.db.commit()
sql = "create table if not exists last_mediafile_check(last_check_time int)"
self.db.execute(sql)
self.db.commit()
def fetchlastCheckTime(self):
cursor = self.db.execute("select * from last_smil_check")
count = 0
for row in cursor:
logger.info(row)
count = count+1
self.lastSMILFileCheckTime = row[0]
self.newlastSMILFileCheckTime = self.lastSMILFileCheckTime
cursor = self.db.execute("select * from last_mediafile_check")
count = 0
for row in cursor:
logger.info(row)
count = count+1
self.lastMediaFileCheckTime = row[0]
self.newLastMediaFileCheckTime = self.lastMediaFileCheckTime
def updatelastCheckTimes(self):
self.lastSMILFileCheckTime = self.newlastSMILFileCheckTime
self.lastMediaFileCheckTime = self.newLastMediaFileCheckTime
cursor = self.db.execute("select * from last_smil_check")
count = 0
for row in cursor:
count = count +1
if(count == 0):
sql_query = "insert into last_smil_check values ({})".format(self.lastSMILFileCheckTime)
logger.info("Executing " + sql_query)
self.db.execute(sql_query)
else:
self.db.execute("update last_smil_check set last_check_time ={}".format(self.lastSMILFileCheckTime))
self.db.commit()
cursor = self.db.execute("select * from last_mediafile_check")
logger.info(cursor)
count = 0
for row in cursor:
count = count +1
if(count == 0):
sql_query = "insert into last_mediafile_check values ({})".format(self.lastMediaFileCheckTime)
logger.info("Executing " + sql_query)
self.db.execute(sql_query)
else:
sql_query = "update last_mediafile_check set last_check_time ={}".format(self.lastMediaFileCheckTime)
logger.info("Executing " + sql_query)
self.db.execute(sql_query)
self.db.commit()
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
automator = Automator()
automator.start()
enter code here