
Recherche avancée
Autres articles (69)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (12963)
-
high memory & cpu usage in ffmpeg C sample when muxing audio and video
24 juin 2016, par chanduI am using the
muxing.c
example provided with ffmpeg 3.0 version to create an MP4 file (H.264 & AAC) with VS 2013.The sample is working fine with default width & height for video, but when I changed the width to 1920 and height to 1080, the sample is taking nearly 400MB & 60-70% cpu usage (using task manager & in Release mode) throughout the program. I have used multi threading also.
I tried to free the encoded packet after calling
write_frame()
, but to no success.
The memory is being released only after callingavcodec_close()
.Could anybody please tell me what I am doing wrong ?
I am adding link (https://drive.google.com/open?id=0B75_-V7se7tmWUhyM0ItS0kzUVk) to code I tested with VS 2013.
The screenshot link https://drive.google.com/open?id=0B75_-V7se7tmVm4tUjFtSnNNSHc
The
STREAM_DURATION
value in the sample is set to 120 seconds (even tested with 600 seconds) and I changed default Height & Width values of AVCodecContext inadd_stream
function for video type to 1080 & 1920 respectively. Through out program, it is taking 355 MB, not changing at all. I think, once frame is encoded usingavcodec_encode_video2
and written to the file, the memory should be released.Please correct me if I am wrong.
-
InnoSetup python subprocess Popen ffmpeg
1er juillet 2023, par Chris PIn my code i have this line :


self.p1 = Popen([self.ffmpeg_path,'-y','-loglevel','quiet','-i',self.retransmition_url,'epalxeis-radio.mp3'],stdin=PIPE,stdout=PIPE,stderr=PIPE, bufsize=1)



which read an web radio stream and saves it locally with filename "epalxeis-radio.mp3"


Using python to launch the script - works !
Using pyinstaller to launch the exe - works !
Using InnoSetup to launch the exe after installation - not working :(.


The problem is that there is no epalxeis-radio.mp3 created when i try the third case (innosetup).


The ffmpeg_path is :
self.ffmpeg_path = os.path.abspath("extra/ffmpeg.exe")

and there is the extra folder in the same directory which is the innosetup exe.

From Windows task manager there is no ffmpeg.exe shown in the tasks list.


What wrong ?


Edit : I used a smaller script to test the error :


from subprocess import Popen, DEVNULL, STDOUT, PIPE
import os
import time
ffmpeg_path = os.path.abspath("extra/ffmpeg.exe")
retransmition_url = "http://shaincast.caster.fm:40636/listen.mp3?authn76260dc1cdf44a9132c0b63f85d9c67a"
with Popen([ffmpeg_path,'-y','-loglevel','quiet','-i',retransmition_url,'epalxeis-radio.mp3'],stdin=PIPE,stdout=PIPE,stderr=PIPE) as p1:
 time.sleep(1)



in pyinstaller exe runs, but in innosetup exe stop immediately.


-
FFMPEG in thread error : Thread was being aborted
21 juillet 2018, par swabygwI’m using FFMPEG to convert video files from one file type to another. I do it via an ASP.NET web interface where a user can upload their file and the conversion happens in a .NET "thread", like this :
trd = New Thread(Sub(sender) TestSub(folder,interv,objCounter,fname,fversource,fverdest,fext,fhost))
trd.Priority = ThreadPriority.Lowest
trd.StartWhile the conversion is happening, I’m logging the progress of the conversion by using the FFMPEG "-progress" argument.
If I don’t use a thread, I get a complete log that looks like the output below. But when I run it in a thread, the conversion happens successfully still, but I get this error message from .NET : "Thread was being aborted." right after line #46...regardless of the file type, file size, etc., it always errors after line #46. I need to capture the rest of the output from the execution in the thread (just like when it was run outside of the thread). Can anyone help ?
P.S., I have tried extending the server timeout, like this (it didn’t help) : httpRuntime executionTimeout = "600", in the web.config file.
P.P.S, found something interesting. I’m using a StreamReader to capture the output, and I log each line of the StreamReader to an output file, like this :
Dim ffReader As StreamReader
prcFFMPEG.Start
ffReader = prcFFMPEG.StandardError
While Not ffReader.EndOfStream
strFFOUT = "Test:" & ffReader.ReadLine
LogConversion(fhost,"strFFOUT(ffReader.ReadLine): " & (strFFOUT).ToString)
End WhileHere’s the odd part : In the While/EndWhile loop, if I print out just "Test" instead of ffReader.ReadLine, it runs, I get a lot more lines, and the thread aborts but I see FFMPEG still running in Task Manager. If I leave it running in Task Manager and rerun the code with ffReader.ReadLine, it will print out everything with no errors/aborts. But, if I end the background task in Task Manager, I get the same problem and error again.
strFFOUT(0): ffmpeg version N-67331-g547fce9 Copyright (c) 2000-2014 the FFmpeg developers
strFFOUT(1): built on Nov 1 2014 22:01:52 with gcc 4.9.1 (GCC)
strFFOUT(2): configuration: --enable-gpl --enable-version3 --disable-w32threads --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-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-zlib
strFFOUT(3): libavutil 54. 11.100 / 54. 11.100
strFFOUT(4): libavcodec 56. 10.101 / 56. 10.101
strFFOUT(5): libavformat 56. 12.100 / 56. 12.100
strFFOUT(6): libavdevice 56. 2.100 / 56. 2.100
strFFOUT(7): libavfilter 5. 2.101 / 5. 2.101
strFFOUT(8): libswscale 3. 1.101 / 3. 1.101
strFFOUT(9): libswresample 1. 1.100 / 1. 1.100
strFFOUT(10): libpostproc 53. 3.100 / 53. 3.100
strFFOUT(11): [mov,mp4,m4a,3gp,3g2,mj2 @ 02a28700] overread end of atom 'colr' by 1 bytes
strFFOUT(12): Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\inetpub\wwwroot\site\short_sample.mp4':
strFFOUT(13): Metadata:
strFFOUT(14): major_brand : mp42
strFFOUT(15): minor_version : 0
strFFOUT(16): compatible_brands: mp42isomavc1
strFFOUT(17): creation_time : 2010-03-20 21:29:11
strFFOUT(18): encoder : HandBrake 0.9.4 2009112300
strFFOUT(19): Duration: 00:00:05.57, start: 0.000000, bitrate: 551 kb/s
strFFOUT(20): Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 560x320, 465 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc (default)
strFFOUT(21): Metadata:
strFFOUT(22): creation_time : 2010-03-20 21:29:11
strFFOUT(23): encoder : JVT/AVC Coding
strFFOUT(24): Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 83 kb/s (default)
strFFOUT(25): Metadata:
strFFOUT(26): creation_time : 2010-03-20 21:29:11
strFFOUT(27): [libx264 @ 02a2e840] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
strFFOUT(28): [libx264 @ 02a2e840] profile High, level 2.1
strFFOUT(29): [libx264 @ 02a2e840] 264 - core 142 r2479 dd79a61 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=23 ip_ratio=1.40 pb_ratio=1.30 aq=0
strFFOUT(30): Output #0, mp4, to 'C:\inetpub\wwwroot\site\short_sample3.mp4':
strFFOUT(31): Metadata:
strFFOUT(32): major_brand : mp42
strFFOUT(33): minor_version : 0
strFFOUT(34): compatible_brands: mp42isomavc1
strFFOUT(35): encoder : Lavf56.12.100
strFFOUT(36): Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 480x320, q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
strFFOUT(37): Metadata:
strFFOUT(38): creation_time : 2010-03-20 21:29:11
strFFOUT(39): encoder : Lavc56.10.101 libx264
strFFOUT(40): Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, s16, 128 kb/s (default)
strFFOUT(41): Metadata:
strFFOUT(42): creation_time : 2010-03-20 21:29:11
strFFOUT(43): encoder : Lavc56.10.101 libvo_aacenc
strFFOUT(44): Stream mapping:
strFFOUT(45): Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
strFFOUT(46): Stream #0:1 -> #0:1 (aac (native) -> aac (libvo_aacenc))
strFFOUT(47): frame= 96 fps=0.0 q=23.0 size= 146kB time=00:00:03.37 bitrate= 355.3kbits/s
strFFOUT(48): frame= 166 fps=0.0 q=-1.0 Lsize= 274kB time=00:00:05.58 bitrate= 401.7kbits/s
strFFOUT(49):
strFFOUT(50): video:179kB audio:87kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.677233%
strFFOUT(51): [libx264 @ 02a2e840] frame I:1 Avg QP:20.00 size: 19154
strFFOUT(52): [libx264 @ 02a2e840] frame P:48 Avg QP:23.00 size: 1976
strFFOUT(53): [libx264 @ 02a2e840] frame B:117 Avg QP:24.63 size: 588
strFFOUT(54): [libx264 @ 02a2e840] consecutive B-frames: 3.6% 0.0% 21.7% 74.7%
strFFOUT(55): [libx264 @ 02a2e840] mb I I16..4: 46.2% 21.2% 32.7%
strFFOUT(56): [libx264 @ 02a2e840] mb P I16..4: 1.1% 0.3% 0.2% P16..4: 29.1% 7.5% 7.3% 0.0% 0.0% skip:54.3%
strFFOUT(57): [libx264 @ 02a2e840] mb B I16..4: 0.0% 0.0% 0.1% B16..8: 17.5% 3.6% 1.2% direct: 1.1% skip:76.4% L0:39.0% L1:49.6% BI:11.4%
strFFOUT(58): [libx264 @ 02a2e840] 8x8 transform intra:21.9% inter:51.2%
strFFOUT(59): [libx264 @ 02a2e840] coded y,uvDC,uvAC intra: 40.4% 70.7% 40.6% inter: 5.8% 10.3% 3.0%
strFFOUT(60): [libx264 @ 02a2e840] i16 v,h,dc,p: 0% 25% 1% 74%
strFFOUT(61): [libx264 @ 02a2e840] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 9% 36% 14% 5% 7% 4% 13% 4% 8%
strFFOUT(62): [libx264 @ 02a2e840] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 25% 12% 4% 8% 8% 13% 6% 8%
strFFOUT(63): [libx264 @ 02a2e840] i8c dc,h,v,p: 49% 35% 10% 6%
strFFOUT(64): [libx264 @ 02a2e840] Weighted P-Frames: Y:0.0% UV:0.0%
strFFOUT(65): [libx264 @ 02a2e840] ref P L0: 65.7% 5.6% 18.5% 10.3%
strFFOUT(66): [libx264 @ 02a2e840] ref B L0: 79.0% 14.9% 6.0%
strFFOUT(67): [libx264 @ 02a2e840] ref B L1: 91.1% 8.9%
strFFOUT(68): [libx264 @ 02a2e840] kb/s:264.22