
Recherche avancée
Autres articles (68)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
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 (...) -
Selection of projects using MediaSPIP
2 mai 2011, parThe examples below are representative elements of MediaSPIP specific uses for specific projects.
MediaSPIP farm @ Infini
The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)
Sur d’autres sites (9861)
-
Youtube-dll how to get a direct download link to the merged file without creating a temp file on server
11 juillet 2019, par CeylonDomains SolutionsIs there any way to create a direct download link to the merged file without creating a temp file on the server in youtube-dll ?
youtube-dll -f 255+160 https://youtu.be/p-flvm1szbI
The above code will merge the file and output the merged file.
I want to allow users to directly download the merged file to their computers — without creating any temp file on my server. Is this possible ?
(Creating a temp file and then letting the user download it is already possible.)
-
FileNotFoundError : [WinError 2] The system cannot find the file specified when using moviepy
17 mars 2023, par HamidBeeI am trying to reduce the file size of a .mp4 file using the following code :


import os
import moviepy.editor as mp
import ffmpeg

def compress_video(input_file, output_file, target_size_ratio=0.5):
 if not os.path.exists(input_file):
 raise FileNotFoundError(f"Input file not found: {input_file}")

 if target_size_ratio <= 0 or target_size_ratio >= 1:
 raise ValueError("Target size ratio must be between 0 and 1")

 # Get input video information
 probe = ffmpeg.probe(input_file)
 video_stream = next((stream for stream in probe['streams'] if stream['codec_type'] == 'video'), None)
 bitrate = int(video_stream['bit_rate'])

 # Calculate new bitrate to achieve the target file size
 new_bitrate = int(bitrate * target_size_ratio)

 # Load the video and compress
 input_video = mp.VideoFileClip(input_file)
 input_video.write_videofile(
 output_file,
 bitrate=f"{new_bitrate}k",
 codec="libx264",
 audio_codec="aac",
 threads=4,
 ffmpeg_params=["-strict", "-2"]
 )

input_file = r"C:\Users\Hamid\Downloads\A.mp4"
output_file = r"C:\Users\Hamid\Downloads\B.mp4"
compress_video(input_file, output_file, target_size_ratio=0.5)



But I am getting the following error :


FileNotFoundError: [WinError 2] The system cannot find the file specified



Just a note I have a file in that directory called A.mp4 but currently no file exists called B.mp4.


-
ffmpeg stream mp4 file to Instagram live
31 mars 2022, par raitechI created a live stream session on instafeed.me then used
ffmpeg
to send an MP4 file to the stream. But I get IO error.

The command is


ffmpeg -rtbufsize 256M -re -i "1.mp4" -acodec libmp3lame -ar 44100 -b:a 128k -pix_fmt yuv420p -profile:v baseline -s 504x896 -bufsize 6000k -vb 400k -maxrate 1500k -deinterlace -vcodec libx264 -preset veryfast -g 30 -r 30 -f flv "rtmps://live-upload.instagram.com:443/rtmp/XXXXXXX?s_sw=0&s_vt=ig&a=XXXXXXX"



The output is


ffmpeg version git-2020-05-04-5767a2e Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 9.3.1 (GCC) 20200328
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
 libavutil 56. 43.100 / 56. 43.100
 libavcodec 58. 82.100 / 58. 82.100
 libavformat 58. 42.102 / 58. 42.102
 libavdevice 58. 9.103 / 58. 9.103
 libavfilter 7. 80.100 / 7. 80.100
 libswscale 5. 6.101 / 5. 6.101
 libswresample 3. 6.100 / 3. 6.100
 libpostproc 55. 6.100 / 55. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.42.102
 Duration: 01:05:43.70, start: 0.000000, bitrate: 1729 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 1594 kb/s, 24 fps, 24 tbr, 90k tbn, 48 tbc (default)
 Metadata:
 handler_name : VideoHandler
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 handler_name : SoundHandler
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[libx264 @ 000001cf5ba53300] using SAR=256/81e=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[libx264 @ 000001cf5ba53300] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000001cf5ba53300] profile Constrained Baseline, level 3.1, 4:2:0, 8-bit
[libx264 @ 000001cf5ba53300] 264 - core 159 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=18 lookahead_threads=6 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=30 keyint_min=3 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=abr mbtree=1 bitrate=400 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1500 vbv_bufsize=6000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'rtmps://live-upload.instagram.com:443/rtmp/XXXXX?s_sw=0&s_vt=ig&a=XXXX':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.42.102
 Stream #0:0(und): Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 504x896 [SAR 256:81 DAR 16:9], q=-1--1, 400 kb/s, 30 fps, 1k tbn, 30 tbc (default)
 Metadata:
 handler_name : VideoHandler
 encoder : Lavc58.82.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 1500000/0/400000 buffer size: 6000000 vbv_delay: N/A
 Stream #0:1(und): Audio: mp3 (libmp3lame) ([2][0][0][0] / 0x0002), 44100 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 encoder : Lavc58.82.100 libmp3lame
[tls @ 000001cf5bb3c200] Error in the push function.0:02.90 bitrate= 179.5kbits/s speed=0.957x
av_interleaved_write_frame(): I/O error
 Last message repeated 1 times
[flv @ 000001cf5bd0e980] Failed to update header with correct duration.
[flv @ 000001cf5bd0e980] Failed to update header with correct filesize.
Error writing trailer of rtmps://live-upload.instagram.com:443/rtmp/XXXXXX?s_sw=0&s_vt=ig&a=XXXXXXX: I/O error
frame= 66 fps= 20 q=37.0 Lsize= 89kB time=00:00:03.26 bitrate= 224.1kbits/s speed=0.965x
video:66kB audio:51kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[tls @ 000001cf5bb3c200] The specified session has been invalidated for some reason.
 Last message repeated 1 times
[libx264 @ 000001cf5ba53300] frame I:3 Avg QP:31.09 size: 9012
[libx264 @ 000001cf5ba53300] frame P:63 Avg QP:33.47 size: 1733
[libx264 @ 000001cf5ba53300] mb I I16..4: 78.1% 0.0% 21.9%
[libx264 @ 000001cf5ba53300] mb P I16..4: 11.0% 0.0% 0.6% P16..4: 14.7% 3.6% 0.5% 0.0% 0.0% skip:69.6%
[libx264 @ 000001cf5ba53300] final ratefactor: 30.81
[libx264 @ 000001cf5ba53300] coded y,uvDC,uvAC intra: 16.6% 12.9% 0.9% inter: 1.8% 0.9% 0.0%
[libx264 @ 000001cf5ba53300] i16 v,h,dc,p: 56% 12% 18% 14%
[libx264 @ 000001cf5ba53300] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 43% 7% 26% 4% 3% 9% 1% 6% 1%
[libx264 @ 000001cf5ba53300] i8c dc,h,v,p: 76% 4% 19% 1%
[libx264 @ 000001cf5ba53300] kb/s:389.26
Conversion failed!