
Recherche avancée
Autres articles (45)
-
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 (...)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)
Sur d’autres sites (6362)
-
ffmpeg-python drawtext after concatenating mp4 videos
2 mars 2020, par user2355051I realize a similar question has been asked here, so before pointing to that question and answer, please understand that my question is different. I’m hoping that someone can point me in the right direction.
In short, I have 5 video segments that I’m concatenating and reordering based on user input. Is there a way that I can drawtext dynamically over the input without having to process the video a second time ?
This is the code that I have which is working, but as you can see, I need to open the concatenated file and apply the text over that version. Then the file is saved as a duplicate.
I’m looking for a more elegant way to accomplish this. Any suggestions would be appreciated.
video1 = ffmpeg.input('./assets/v_1.mp4')
video2 = ffmpeg.input('./assets/v_2.mp4')
video3 = ffmpeg.input('./assets/v_3.mp4')
video4 = ffmpeg.input('./assets/v_4.mp4')
video5 = ffmpeg.input('./assets/v_5.mp4')
print(row)
## IF Row 1 and 2 have values they get all five.
if row[1] == '1' and row[2] == '1':
print("Matches here");
outfile = row[0]+'.mp4'
##DO Stuff
joined = ffmpeg.concat(video1.video,video1.audio,video2.video,video2.audio,video3.video,video3.audio,video4.video,video4.audio,video5.video,video5.audio, v=1,a=1,unsafe=1).node
vj = joined[0]
va = joined[1].filter('volume', 1)
out = ffmpeg.output(vj,va, outfile)
out.run()
## Once Concat Video is finished, then it draws text over the video.
input2 = ffmpeg.input(row[0]+'.mp4').drawtext(fontfile='/Users/jserra/Library/Fonts/Cocogoose-Condensed-Regular-trial.ttf',fontsize='60',timecode='00:00:00:00',r=60,text=row[0],fontcolor='black',escape_text=True)
ffmpeg.output(input2,row[0]+'_1.mp4').run()I’ve tried this and receive the following error :
video1 = ffmpeg.input('./assets/StMarys_1.mp4').drawtext(fontfile='/Users/jserra/Library/Fonts/Cocogoose-Condensed-Regular-trial.ttf',fontsize='60',timecode='00:00:00:00',r=60,text=row[0],fontcolor='black',escape_text=True)
Error :
.virtualenvs/cvtesting/lib/python3.6/site-packages/ffmpeg/_run.py", line 93, in _allocate_filter_stream_names
upstream_node, upstream_label
ValueError: Encountered drawtext(fontcolor='black', fontfile='/Users/jserra/Library/Fonts/Cocogoose-Condensed-Regular-trial.ttf', fontsize='60', r=60, text='jack', timecode='00:00:00:00') <1d2ff6bbf3f0> with multiple outgoing edges with same upstream label None; a `split` filter is probably requiredI’ve also tried chaining it after the videos are concatenated with
joined
. I still receive errors.joined = ffmpeg.concat(video1.video,video1.audio,video2.video,video2.audio,video3.video,video3.audio,video4.video,video4.audio,video5.video,video5.audio, v=1,a=1,unsafe=1).drawtext(fontfile='/Users/jserra/Library/Fonts/Cocogoose-Condensed-Regular-trial.ttf',fontsize='60',timecode='00:00:00:00',r=60,text=row[0],fontcolor='black',escape_text=True).node
Will I need to process these videos twice ? If there are any optimizations that I can make please let me know. Also, if there are any pointers about displaying the drawn text for a certain period of time, the documentation seems kinda spotty as it relates to controlling the duration, I’m not sure what the values mean or how they impact each other.
Thanks
-
shell script : ffmpeg can't either read arguments or filenames, if spaces in path- or filename
9 juillet 2014, par NicolasI’m currently working on a bash shell script on OS X to get a custom tailored Pashua GUI/automatization package, using ffmpeg in the back, to transcode videos, label them, zip them, upload them, organize them and so on. Everything is working like a charm so far.
My problem now is that I can’t make ffmpeg take files or paths that have spaces in them IF I use variables in variables. But that (I think) is a must in order to get ffmpeg to transcode multiple files at once depending on the formats and checkboxes the user ticks on.
I made a little example snippet so you can see my dilemma.
No spaces in path or filename / works great :
#!/bin/bash
infile='/Users/nicolas/Desktop/MASTER_[DE]_Test_140626.mov'
gen_outfile () {
outfile="${1/MASTER/TRANSCODE}"
ffmpeg_cl="-s $2 -c:v libx264 -preset slow -crf 18 -pix_fmt yuv420p -c:a aac -b:a 240k -strict -2 $outfile"
}
gen_outfile "$infile" 1920x1080
./ffmpeg_stat -i "$infile" $ffmpeg_clThe output is as expected and the file is called "TRANSCODE_[DE]_Test_140626.mov"
Filename variable with spaces - directly fed to ffmpeg :
This works as well but isn’t really usable for me because I need to have the option of variable numbers of output files and arguments generated dynamically.
#!/bin/bash
infile_full='/Users/nicolas/Google Drive/encode-o-mat/MASTER_[DE] Test 140626.mov'
gen_outfile () {
outfile="${1/MASTER/TRANSCODE}"
ffmpeg_cl="-s $2 -c:v libx264 -preset slow -crf 18 -pix_fmt yuv420p -c:a aac -b:a 240k -strict -2"
}
gen_outfile "$infile_full" 1920x1080
./ffmpeg_stat -i "$infile_full" $ffmpeg_cl "$outfile"The output is as expected and the file is called "TRANSCODE_[DE] Test 140626.mov".
But this way is just not an option.This here does not work ! Filename is split up and incomplete :
#!/bin/bash
infile_full='/Users/nicolas/Google Drive/encode-o-mat/MASTER_[DE] Test 140626.mov'
gen_outfile () {
outfile="${1/MASTER/TRANSCODE}"
ffmpeg_cl="-s $2 -c:v libx264 -preset slow -crf 18 -pix_fmt yuv420p -c:a aac -b:a 240k -strict -2 $outfile"
}
gen_outfile "$infile_full" 1920x1080
./ffmpeg_stat -i "$infile_full" $ffmpeg_clFfmpeg gives this error : "Unable to find a suitable output format for ’/Users/nicolas/Google’".
Of course.This doesn’t work as well ! Quoting and such :
./ffmpeg_stat -i "$infile_full" "$ffmpeg_cl"
If I put the $ffmpeg_cl variable in various quotes ffmpeg doesn’t understand the arguments anymore ! This is one example output :
"Unrecognized option ’s 1920x1080 -c:v libx264 -preset slow -crf 18 -pix_fmt yuv420p -c:a aac -b:a 240k -strict -2 /Users/nicolas/Google Drive/encode-o-mat/TRANSCODE_[DE] Test 140626.mov’.
Error splitting the argument list : Option not found
Conversion failed !"It’s really important that the script can handle path- and filenames with spaces because I can’t change the environment in which that tool is supposed to run. All ideas and solutions are more than welcome !
-
Revised FATE Test Spec System
9 juin 2010, par Multimedia Mike — FATE ServerFATE involves some database tables that define the test specifications. Like everything else in FATE, the concept could use some improvement. After I prototyped an improved, multithreaded testing client, the next logical revision seemed to be the test spec system.
History
The test spec system has been handled by a single table that includes an FFmpeg command line (with a few possible modifiers thrown in), an integer ID, a human-friendly ID, a description, the expected command line return code, the expected command output, a maximum runtime, and a Boolean to indicate whether the test is to be considered active.Adjunct to this test database is a large corpus of test media named the FATE suite.
At first, the FATE testing script used a direct MySQL database protocol to query the test specs from the server before every build/test cycle. I soon realized this was ludicrously inefficient since the test specs don’t change that often. So I cached the tests in a static file to be retrieved via HTTP, first in Python’s "pickled" (serialized) format, then in an SQLite database.
Planned Upgrades
There are 2 major features I would like to build into the system going forward :- The ability to version the entire suite so that it’s possible to test old branches of FFmpeg
- Another database field to indicate which, if any, other test specs must be executed before this spec can be executed
I think I will take this opportunity to switch the test cache serialization format to JSON. I switched from Python pickling to SQLite because the latter was more portable between languages. JSON has that same benefit. Further, working with JSON data doesn’t require a round trip to disk (i.e., want to generate an SQLite database for sending via HTTP ? It needs to go onto disk first. It’s possible to create and manipulate a database entirely in memory but not fetch the bits).
Things To Research
- Pondering how version control systems operate and what they have to teach regarding how to version this data (including the question of whether I can just use an existing version control mechanism instead of creating my own system)
- Efficient caching mechanism
- Tagging test specs for alternate purposes such as longevity testing
- Learn about web form programming in the 21st century so that it’s not quite as painful to maintain the system.
Preliminary Versioning Concept
Here is one approach I am thinking of : Create test groups. Each test spec is assigned to at least one test group. I can think of at least 2 groups : functional (the base test set in existence that validates functionality) and profiling (the projected test set that will be used for ongoing performance and memory profiling). The web frontend will allow for the creation of labels that will apply to a single group. Doing so will apply that label to all active tests in the group.