
Recherche avancée
Médias (91)
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
-
USGS Real-time Earthquakes
8 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
SWFUpload Process
6 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
-
Creativecommons informational flyer
16 mai 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (81)
-
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Automated installation script of MediaSPIP
25 avril 2011, parTo overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
The documentation of the use of this installation script is available here.
The code of this (...)
Sur d’autres sites (11947)
-
Installing codecs for mov to mp4 conversion ffmpeg [closed]
19 juillet 2014, par user1503606I have been trying to convert a .mov file to a .mp4 file for a while now i think this is the correct code to do it.
ffmpeg -i P1010989.MOV -vcodec copy -acodec copy out.mp4
But here is my output
FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
built on Jan 29 2012 23:55:02 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'P1010989.MOV':
Duration: 00:00:01.00, start: 0.000000, bitrate: 11584 kb/s
Stream #0.0(eng): Video: mjpeg, yuvj420p, 640x480, 11315 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
Stream #0.1(eng): Audio: pcm_s16be, 16000 Hz, 1 channels, s16, 256 kb/s
File 'out.mp4' already exists. Overwrite ? [y/N] y
[mp4 @ 0x95b0080]track 1: could not find tag, codec not currently supported in container
Output #0, mp4, to 'out.mp4':
Metadata:
encoder : Lavf52.64.2
Stream #0.0(eng): Video: mjpeg, yuvj420p, 640x480, q=2-31, 11315 kb/s, 30 tbn, 30 tbc
Stream #0.1(eng): Audio: pcm_s16be, 16000 Hz, 1 channels, 256 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Could not write header for output file #0 (incorrect codec parameters ?)So i am trying to install the correct codecs and im a bit lost and do with some help.
Do i need to install the codecs separately and where do i download and install them from ?
Code really do with some help thanks.
-
MoviePy write_videofile is very slow. Why ?
5 novembre 2024, par RukshanJSI've seen multiple questions on SO relating with this, but couldn't find a solid answer. The following is my code.


async def write_final_video(clip, output_path, results_dir):
 cpu_count = psutil.cpu_count(logical=False)
 threads = max(1, min(cpu_count - 1, 16))

 os.makedirs(results_dir, exist_ok=True)

 output_params = {
 "codec": await detect_hardware_encoder(),
 "audio_codec": "aac",
 "fps": 24,
 "threads": threads,
 "preset": "medium",
 "bitrate": "5000k",
 "audio_bitrate": "192k",
 }

 logger.info(f"Starting video writing process with codec: {output_params['codec']}")
 try:
 await asyncio.to_thread(
 clip.write_videofile,
 output_path,
 **output_params,
 )
 except Exception as e:
 logger.error(f"Error during video writing with {output_params['codec']}: {str(e)}")
 logger.info("Falling back to libx264 software encoding")
 output_params["codec"] = "libx264"
 output_params["preset"] = "medium"
 try:
 await asyncio.to_thread(
 clip.write_videofile,
 output_path,
 **output_params,
 )
 except Exception as e:
 logger.error(f"Error during fallback video writing: {str(e)}")
 raise
 finally:
 logger.info("Video writing process completed")

 # Calculate and return the relative path
 relative_path = os.path.relpath(output_path, start=os.path.dirname(ARTIFACTS_DIR))
 return relative_path



and the helper function to get encoder is below


async def detect_hardware_encoder():
 try:
 result = await asyncio.to_thread(
 subprocess.run,
 ["ffmpeg", "-encoders"],
 capture_output=True,
 text=True
 )

 # Check for hardware encoders in order of preference
 if "h264_videotoolbox" in result.stdout:
 return "h264_videotoolbox"
 elif "h264_nvenc" in result.stdout:
 return "h264_nvenc"
 elif "h264_qsv" in result.stdout:
 return "h264_qsv"

 return "libx264" # Default software encoder
 except Exception:
 logger.warning("Failed to check for hardware acceleration. Using default encoder.")
 return "libx264"



This code makes the rendering of a 15s video around 6min+ which is not acceptable.


t: 62%|██████▏ | 223/361 [04:40<03:57, 1.72s/it, now=None]


My config is MPS (Apple Silicon Metal Performance Shader), but also should work with NVIDIA CUDA.


How can I reduce the time to write the video ? How to actually reduce this long time to write the file ?


The question is about optimizing MoviePy's video processing pipeline, not just FFmpeg :


- 

clip
is a MoviePy VideoFileClip object handling video processing before FFmpeg encodingwrite_videofile()
is MoviePy's method that manages the entire rendering pipeline including :
- 

- Frame extraction and processing
- Memory management
- Multiprocessing coordination
- Audio synchronization
















Source - https://zulko.github.io/moviepy/getting_started/videoclips.html#video-files-mp4-webm-ogv


Other places where this is asked,


- 

- https://github.com/Zulko/moviepy/issues/2039




-
ffmpeg : Encoder (codec amr_nb) not found for output stream #0:1
23 mars 2017, par m.qayyumI’m using this command to convert
flv to 3gp
ffmpeg -y -i in.flv -ar 8000 -b:a 12.20k -ac 1 -s 176x144 out.3gp
And it’s giving this error
Encoder (codec amr_nb) not found for output stream #0:1
I have searched for
amr_nb
packages onyum
but didn’t able to find it.I’m on CentOS 7
ffmpeg -version
ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfaac --enable-nonfree --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100I’m not sure what’s missing.
Edit :
I followed this guide https://s3bubble.com/installing-ffmpeg-on-centos-6-6-in-usrlocalbin/ + alijandro’s advice.