
Recherche avancée
Médias (1)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
Autres articles (38)
-
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;
Sur d’autres sites (5785)
-
Run avconv in python and direct stdout/stderr to a file
19 février 2016, par tdkI wish to run Avconv commands and record the logs in a file. In the Ubuntu terminal this can be accomplished using
&>>
operator after the actual command enclosed in parenthesis i.e.(avconv -i SRCFILE -ss 00:15:00 -t 00:30:00 TARGETFILE -threads auto) &>> LOGFILE
The above command works perfectly when run in the terminal.
Now I have a number of such commands to run, and thought running them through Python would be good.
-
I tried using the
os.system(command_string)
way
, which when run does not pack the Avconv output to the LOGFILE, and the avconv command seems to execute after the Python script is done - evidenced by some string outputs I put in for debugging. I’m also getting some permission errors. Here is how the first portion of output looks likeAVCONV COMMAND EXECUTED
sh: 1: : Permission denied
sh: 1: : Permission denied
sh: 1:
PROGRAM DONE
: Permission denied
$ avconv version 11.2-6:11.2-1, Copyright (c) 2000-2014 the Libav developers
built on Jan 18 2015 05:12:33 with gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu2)
Trailing options were found on the commandline.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ... -
I also tried using the
subprocess.call()
method for which I get the following error (NOTE : all files exist)Traceback (most recent call last):
File "/home/usr/cnv.py", line 61, in <module>
main()
File "/home/usr/cnv.py", line 46, in main
subprocess.call(newcmd)
File "/usr/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
</module>
I wish to run multiple (think 50+) commands of Avconv similar to the version shown at the top, and have the logs saved in a file instead of in stdout. How do I do this - in Python or otherwise ?
-
-
pipe youtube-dl to ffmpeg within a script
28 février 2016, par user556068This is an expansion to an earlier question I asked which you can find here. I have been piping youtube-dl into a script via
youtube-dl -iga /path/to/myFile.txt | myscript.sh
which reads a text file of urls and extracts another set of urls to the actual video content being downloaded. Everything works great but there is much room for improvement.Instead of piping youtube-dl into the script I would like to include the youtube-dl command within the script itself. Here is the full script I have up to this point.
#!/bin/bash
inArgs='-i'
outArgs='-c copy -y'
dir="$HOME/Movies/fftest/"
outFile="fftest_${count}"
ext='.mp4'
#### not sure about following 2 lines
youtube-dl -iga /path/to/myFile.txt > /path/to/myFile2.txt
exec 0to/myFile2.txt
count=0
if [ ! -d "${dir}" ];
then
mkdir -p "${dir}"
fi
cd || "${HOME}"
while read lineIn
do
{
(( count ++ ))
echo ffmpeg $inArgs $lineIn $outArgs "$dir$outFile$count$ext" &
sleep 1
}
doneAfter playing around with it a little I added the following lines. Code has been edited to reflect these changes.
youtube-dl -iga /path/to/myFile.txt > /path/to/myFile2.txt
exec 0to/myFile2.txtThis does work but it’s also throwing up some new error from ffmpeg that I haven’t yet encountered until now. I test by placing echo before the ffmpeg command. Everything looks fine doing that so I’m not really sure what the issue is at this point.
So there are a couple things i would like to accomplish that I haven’t been able to figure out.
-
Have I properly redirected the input and do I need to do anything later in the script to put things back as they were before the script was called or will that occur naturally on its own when exiting the script ?
-
As it currently is, the script will overwrite any files previously created every time it is called. This is fine for testing purposes but not ideal beyond that. What I am looking for is a way to start writing the next file in the number sequence based on the last file in the directory. So if one time it creates 8 files named fftest_1.mpr - fftest_8.mp4 the second time when it is called to create 14 new files, it will know to start writing a file labeled fftest_9.mp4 - fftest_22.mp4. This is however beyond my abilities at the moment. Is there a way to do this ?
-
Another issue I’ve had is when trying kill the script as it runs in the background. Ctrl C doesn’t have any effect as far as I can tell. Is there an alternative kill command or key press I can use to ensure an immediate exit if necessary. Or a way to assign such within the script itself ?
-
Also any critiques, suggestions, alternatives or additions to any part of this script are very much welcomed and appreciated. This is all very new for me and I’m trying to learn more everyday. If any part of what I said didn’t make sense I will be happy to clarify.
-
-
Streams mixed when using -filter_complex amerge in FFmpeg
19 juin 2016, par BrainStoneI am currently having issues with ffmpeg and one of its filters.
I am trying to merge 2 audio streams of a video into one. for this purpose I tried this command :
ffmpeg -i /home/maniaplanet/Videos/ManiaPlanet\ 2014-08-21\ 20-09-13-082.avi.output.mkv -filter_complex "[0:1][0:2] amerge=inputs=2"-c:v copy -c:a libvo_aacenc -b:a 256k /var/www/files/output.mp4
But I get this output :
ffmpeg version 1.0.10 Copyright (c) 2000-2014 the FFmpeg developers
built on Jul 25 2014 07:50:40 with gcc 4.7 (Debian 4.7.2-5)
configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libfdk-aac --enable-libdc1394 --disable-altivec --dis libavutil 51. 73.101 / 51. 73.101
libavcodec 54. 59.100 / 54. 59.100
libavformat 54. 29.104 / 54. 29.104
libavdevice 54. 2.101 / 54. 2.101
libavfilter 3. 17.100 / 3. 17.100
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
Input #0, matroska,webm, from '/home/maniaplanet/Videos/ManiaPlanet 2014-08-21 20-09-13-082.avi.output.mkv':
Metadata:
ISRC : Video:RGB24 Audio0:Headset (2- Plantronics .Audio 655 DSP) Audio1:Headset (2- Plantronics .Audio 655 DSP)
ENCODER : Lavf55.37.100
Duration: 01:49:48.47, start: 0.000000, bitrate: 3867 kb/s
Stream #0:0: Video: h264 (High), yuv420p, 1280x1024, SAR 1:1 DAR 5:4, 30 fps, 30 tbr, 1k tbn, 60 tbc (default)
Stream #0:1: Audio: mp3, 48000 Hz, stereo, s16, 320 kb/s (default)
Stream #0:2: Audio: mp3, 48000 Hz, stereo, s16, 320 kb/s (default)
File '/var/www/files/output.mp4' already exists. Overwrite ? [y/N] y
Input channel layouts overlap: output layout will be determined by the number of distinct input channels
[libvo_aacenc @ 0x7ae800] Unable to set encoding parameters
Output #0, mp4, to '/var/www/files/output.mp4':
Metadata:
ISRC : Video:RGB24 Audio0:Headset (2- Plantronics .Audio 655 DSP) Audio1:Headset (2- Plantronics .Audio 655 DSP)
ENCODER : Lavf55.37.100
Stream #0:0: Audio: aac, 48000 Hz, 4.0, s16, 256 kb/s
Stream #0:1: Video: h264, yuv420p, 1280x1024 [SAR 1:1 DAR 5:4], q=2-31, 30 fps, 90k tbn, 1k tbc (default)
Stream mapping:
Stream #0:1 (mp3) -> amerge:in0
Stream #0:2 (mp3) -> amerge:in1
amerge -> Stream #0:0 (libvo_aacenc)
Stream #0:0 -> #0:1 (copy)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or heightI think the important part is at the bottom :
Stream mapping:
Stream #0:1 (mp3) -> amerge:in0
Stream #0:2 (mp3) -> amerge:in1
amerge -> Stream #0:0 (libvo_aacenc)
Stream #0:0 -> #0:1 (copy)It maps the video stream as the second stream and the audio gets first. How do i resolve this ?
-map
did not help. (Maybe I just used it wrong)