
Recherche avancée
Médias (29)
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (49)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...)
Sur d’autres sites (5723)
-
avformat/internal : Move ff_read_line_to_bprint_overwrite to avio_internal.h
23 juillet 2021, par Andreas Rheinhardtavformat/internal : Move ff_read_line_to_bprint_overwrite to avio_internal.h
It only uses an AVIOContext and an AVBPrint.
When doing so, it turned out that several non-users of
ff_read_line_to_bprint_overwrite() and ff_bprint_to_codecpar_extradata()
relied on libavformat/internal.h to include bprint.h or avstring.h
for them. In order to avoid a repeat of this and in order to reduce
unnecessary dependencies, a forward declaration of struct AVBPrint is
used instead of including bprint.h.Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
- [DH] libavdevice/v4l2.c
- [DH] libavformat/aadec.c
- [DH] libavformat/argo_asf.c
- [DH] libavformat/argo_cvg.c
- [DH] libavformat/au.c
- [DH] libavformat/avio_internal.h
- [DH] libavformat/concatdec.c
- [DH] libavformat/dashdec.c
- [DH] libavformat/dashenc.c
- [DH] libavformat/flacenc.c
- [DH] libavformat/framecrcenc.c
- [DH] libavformat/hlsenc.c
- [DH] libavformat/internal.h
- [DH] libavformat/librist.c
- [DH] libavformat/mxfdec.c
- [DH] libavformat/ttmlenc.c
- [DH] libavformat/utils.c
-
How to use ffmpeg in flask server to convert between audio formats without writing files to disk ?
14 avril 2020, par AthwulfI have successfully managed to use ffmpeg in python to convert the format of some audio files like this :



command = "ffmpeg -i audio.wav -vn -acodec pcm_s16le output.wav"
subprocess.call(command, shell=True)




However I want to do this in memory and avoid saving the input and output files to disk.



I have found the follwing code to do such a thing (Passing python’s file like object to ffmpeg via subprocess) :



command = ['ffmpeg', '-y', '-i', '-', '-f', 'wav', '-']
process = subprocess.Popen(command, stdin=subprocess.PIPE)
wav, errordata = process.communicate(file)




But I am struggeling to use this in my context.



I am receiving the file on a server as part of a multipart/form-data request.



@server.route("/api/getText", methods=["POST"])
def api():
 if "multipart/form-data" not in request.content_type:
 return Response("invalid content type: {}".format(request.content_type))
 # check file format
 file = request.files['file']
 if file:
 print('**found file', file.filename)




Now I have the file as a FileStorage Object (https://tedboy.github.io/flask/generated/generated/werkzeug.FileStorage.html). This object has a stream, which can be accessed by using the read method. So I thought I might be able to use this as input for ffmpeg like so :



f = file.read()
command = ['ffmpeg', '-y', '-i', '-', '-f', 'wav', '-']
process = subprocess.Popen(command, stdin=subprocess.PIPE)
wav, errordata = process.communicate(f)




However this yields the the following error :



AssertionError: Given audio file must be a filename string or a file-like object




I have also tried another approach which I found online, using io.BytesIO, to which I can't find the source anymore :



memfile = io.BytesIO() # create file-object
memfile.write(file.read()) # write in file-object
memfile.seek(0) # move to beginning so it will read from beginning




And then trying this again :



command = ['ffmpeg', '-y', '-i', '-', '-f', 'wav', '-']
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
wav, errordata = process.communicate(memfile)




This gets me the following error :



TypeError: a bytes-like object is required, not '_io.BytesIO'




Does anyone have an idea of how to do this ?



Update



The first error message is actually not a error message thrown by ffmpeg. As v25 pointed out correctly in his answer the first approach also returns a bytes object and is also a valid solution.



The error message got thrown by a library (speech_recognition) when trying to work with the modified file. In the unlikely case of someone coming across the same problem here the solution :



The bytes objected returned by ffmpeg (variable wav) has to be turned into a file-like object as the error message implies. This can easily be done like this :



memfileOutput = io.BytesIO(wav)


-
Video encoder & segmenter for HLS VoD poor quality
10 juillet 2017, par MuriloI am trying to encode and segment video for HLS on demand(VoD).
I am using the following code for such :ffmpeg -i 20170706_174314.mp4 -c 24 \
-vcodec libx264 -acodec aac -ac 1 -strict -2 -b:v 128k \
-profile:v baseline -maxrate 400k -bufsize 1835k \
-hls_time 10 -hls_playlist_type vod -vsync 1 \
video_chunks/index1.m3u8 \
-c 24 -vcodec libx264 -acodec aac -ac 1 -strict -2 -b:v 128k \
-profile:v baseline -maxrate 700k -bufsize 1835k \
-hls_time 10 -hls_playlist_type vod -vsync 1 \
video_chunks/index2.m3u8I tried this other code also just for segmenting but had the same exactly problem :
ffmpeg -i 20170706_174314.mp4 \
-c:a libmp3lame -ar 48000 -ab 64k -c:v libx264 -b:v 128k -flags \
-global_header -map 0 -f segment \
-segment_list video_chunks/test.m3u8 -segment_time 10 -segment_format mpegts \
video_chunks/segment_%05d.tsLater on I create another playlist with bandwidth separators to call on the two other playlists generated with the code above.
This code was working great on some videos but yesterday I recorded a video with my Samsung J7 Prime phone to test since the videos will be generated by phone and this video was poorly encoded. The quality sucks and some parts of the video turned Black&White.
Another thing I noticed on this video is that the following message kept appearing in loop until the end of the encoding&segmenting process.
Past duration X too large
Where X is a decimal really close to
0.675316
The link to the video is below :
My FFmpeg version :
ffmpeg --version
ffmpeg version N-86482-gbc40674 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 66.100 / 55. 66.100
libavcodec 57. 99.100 / 57. 99.100
libavformat 57. 73.100 / 57. 73.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 92.100 / 6. 92.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100SO : Windows 10
EDIT1 : Link to the output
If you see the output it might be worth saying I am also seeing the messageVBV underflow(Frame X, -Y bits)