
Recherche avancée
Autres articles (25)
-
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 -
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 (...) -
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 (...)
Sur d’autres sites (3771)
-
Python extract wav from video file
31 octobre 2015, par xolodecRelated :
How to extract audio from a video file using python ?
Extract audio from video as wav
How to rip the audio from a video ?
My question is how could I extract wav audio track from video file, say
video.avi
?
I read many articles and everywhere people suggest to use (from Python)ffmpeg
as a subprocess (because there are no reliable python bindings to ffmpeg - the only hope wasPyFFmpeg
but i found it is unmaintaned now). I don’t know if it is right solution and i am looking for good one.
I looked to gstreamer and found it nice but unable to satisfy my needs — the only way I found to accomplish this from command line looks likegst-launch-0.10 playbin2 uri=file://`pwd`/ex.mp4 audio-sink='identity single-segment=true ! audioconvert ! audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)16000, channels=(int)1 ! wavenc ! filesink location=foo.wav’
But it is not efficient because i need to wait ages while playing video and simultaneously writing to wav file.
ffmpeg
is much better :avconv -i foo.mp4 -ab 160k -ac 1 -ar 16000 -vn ffaudio.wav
But i am unable to launch it from python (not as a command line subprocess). Could you please point me out pros and cons of launching ffmpeg from python as a command line utility ? (I mean using python
multiprocessing
module or something similar).And second question.
What is simple way to cut long wav file into pieces so that i don’t break any words ? i mean pieces of 10-20 sec length with start and end during the pause in sentences/words ?
i know how to break them on arbitrary pieces :
import wave
win= wave.open('ffaudio.wav', 'rb')
wout= wave.open('ffsegment.wav', 'wb')
t0, t1= 2418, 2421 # cut audio between 2413, 2422 seconds
s0, s1= int(t0*win.getframerate()), int(t1*win.getframerate())
win.readframes(s0) # discard
frames= win.readframes(s1-s0)
wout.setparams(win.getparams())
wout.writeframes(frames)
win.close()
wout.close() -
Why do .bss/.rodata symbols stay in binary after strip ?
15 novembre 2014, par BlahGeekAs far as I know, there’s only one kind of symbols in executable binary that is really needed, which is dynamic symbols. These symbols is used in relocation operation because they are dynamic linked. Static linked functions/variables, in the other hand, is not needed so can be stripped.
However, when I was examining the stripped
ffmpeg
binary, this is what I got :>nm -D ffmpeg
...
U __vfprintf_chk
U __vsnprintf_chk
U write
00000000018fa880 B x264_cabac_contexts
0000000001052a40 R x264_cabac_range_lps
0000000001052940 R x264_cabac_transition
0000000001970580 B x264_cabac_transition_unary
0000000001056820 R x264_last_coeff_flag_offset
0000000001056860 R x264_significant_coeff_flag_offset
0000000001056900 R x264_significant_coeff_flag_offset_8x8
U __xpg_strerror_r
U __xstat64
...I can verify that libx264 is static linked to ffmpeg :
> ldd ffmpeg
linux-vdso.so.1 => (0x00007fff26d61000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7c707e7000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7c704e1000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f7c702be000)
libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f7c700ae000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f7c6fe95000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7c6fc76000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7c6f8b0000)
/lib64/ld-linux-x86-64.so.2 (0x00007f7c70b0a000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7c6f69a000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7c6f495000)So, I don’t understand why symbols like
x264_cabac_contexts
is not stripped. (It’s defined in libx264/.../cabac.c) :uint8_t x264_cabac_contexts[4][QP_MAX_SPEC+1][1024];
It bothered me for several hours and I’ve found nothing on google... Hope someone would explain this... Thanks in advance !
-
Creating a recursive ffmpeg converter
23 novembre 2014, par Joe HealeyI’m trying to create a script of some sort that will convert any video files it detects within a folder (also scanning subfolders), to an .avi file of the same name, in the same place, then remove the original file. I’ve not really used cmd much for any programming/scripting so I’m stumbling over what I suspect is some pretty simple syntax issues.
If anyone is familiar with encoding and ffmpeg, please point out whether the encoding options are wrong (I’m stumbling about in the dark at the moment).
Using this thread, I’m working with something currently resembling :
dir/b/s *.(mkv|mp4|m4v|wmv) >listing.txt #Make a list of all the files with certain extensions, for reading.
for /F "delims=;" %%F in (listing.txt) do ffmpeg.exe -i "%%F" -c:v libx264 -preset slow -crf 20 -c:a libvo_aacenc -b:a 128k "%%~na.avi"
#Then to delete original files
for /F "delims=;" %%F in (listing.txt) do del %%F
del listing.txtThe first issue I have is that I’d like to be able to populate the list with all the common video types. I’m imagining cmd has some syntax similar to perl string matching e.g.
A(B|C)
would match AB and AC that I could mimic for matching any video file extension ? (I’ve written it in the code above to illustrate the point but I know it doesn’t work).I hope that is enough to try and illustrate what I’m attempting.