
Recherche avancée
Autres articles (17)
-
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community. -
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 (...) -
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)
Sur d’autres sites (5628)
-
Video cropping with FFMpeg on Android is very slow [duplicate]
7 avril 2017, par Rami JemliThis question already has an answer here :
-
Fast Video Compression on Android
2 answers
What i tried :
I am trying to implement video cropping on android using FFMpeg (ffmpeg-android).
Here is the command I use :
String[] complexCommand = {"-i", inputPath, "-strict", "experimental", "-vf", "crop=1080:1080:0:0", "-threads", "5", "-c:v", "libx264", "-preset", "ultrafast", filePath};
The problem :
Video cropping is working, but even though I am using all needed options to make the operation fast, it still takes a 1min long video the same duration to crop.
How can I achieve better speeds ?
Will I need to implement video cropping on server instead of device ?
Is there another way to implement video cropping on Android instead of FFMpeg ?I understand that I can achieve better UX by letting the user edit a cropped TextureView/SurfaceView while doing the actual cropping in background, but I want to avoid this way as it takes more time.
UPDATE
Here is FFMpeg’s log output :
SUCCESS with output : ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8 (GCC)
configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/DCIM/100ANDRO/MOV_0066.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2017-04-02 11:58:58
com.android.version: 6.0.1
Duration: 00:00:59.60, start: 0.000000, bitrate: 17759 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 17498 kb/s, SAR 1:1 DAR 16:9, 29.90 fps, 29.92 tbr, 90k tbn, 180k tbc (default)
Metadata:
rotate : 90
creation_time : 2017-04-02 11:58:58
handler_name : VideoHandle
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 155 kb/s (default)
Metadata:
creation_time : 2017-04-02 11:58:58
handler_name : SoundHandle
[libx264 @ 0xb5bc4400] using SAR=1/1
[libx264 @ 0xb5bc4400] using cpu capabilities: none!
[libx264 @ 0xb5bc4400] profile High 4:4:4 Predictive, level 3.2, 4:2:0 8-bit
[libx264 @ 0xb5bc4400] 64 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0x1 me=dia subme=1 psy=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=5 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=0
Output #0, mp4, to '/storage/emulated/0/Download/compress_video1.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
com.android.version: 6.0.1
encoder : Lavf57.25.100
Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1080x1080 [SAR 1:1 DAR 1:1], q=-1--1, 29.92 fps, 11488 tbn, 29.92 tbc (default)
Metadata:
handler_name : VideoHandle
creation_time : 2017-04-02 11:58:58
encoder : Lavc57.24.102 libx264
Side data:
unknown side data type 10 (24 bytes)
Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : 2017-04-02 11:58:58
handler_name : SoundHandle
encoder : Lavc57.24.102 aac
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 6 fps=0.0 qAny help is greatly appreciated !
-
Fast Video Compression on Android
-
Time FFMPEG takes to encode a video file
1er avril 2020, par amateurI have recently been working with FFMPEG to do some manipulation on video files, becoming aware of the syntax etc and have found it very helpful. I am looking for some feedback though on the speed it takes to encode file. For example, I run the following command against a video file, 1 hour in length, file extension .mov and 4GB in size, and the command takes just over 4 hours to run. It produces a file 2.2GB in size. I am running it on a high spec i7 laptop.



ffmpeg -i "C:\MyInputFile.mov" -b:v 4500k -bufsize 4500k -r 50 -bsf:a aac_adtstoasc -vf scale=1920:1080 "C:\MyOutputFile.mp4"

Please see following the log created at the start of the encoding. I dont have the full log unless I let it run again for 4 hours!

 -i "C:\MyInputFile.mov" -b:v 4500k -bufsize 4500k -r 50 -bsf:a aac_adtstoasc -vf scale=1920:1080 "C:\MyOutputFile.mp4"
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
 built with gcc 9.2.1 (GCC) 20200122
 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-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-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavdevice 58. 8.100 / 58. 8.100
 libavfilter 7. 57.100 / 7. 57.100
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\MyInputFile.mov':
 Metadata:
 major_brand : qt
 minor_version : 537199360
 compatible_brands: qt
 creation_time : 2019-06-24T18:14:35.000000Z
 timecode : 10:00:00:00
 Duration: 01:09:20.12, start: 0.000000, bitrate: 8092 kb/s
 Stream #0:0(eng): Video: mpeg4 (Advanced Simple Profile) (mp4v / 0x7634706D), yuv420p(pc, smpte170m/unknown/smpte170m), 1024x576 [SAR 1:1 DAR 16:9], 6553 kb/s, 25 fps, 25 tbr, 25k tbn, 1k tbc (default)
 Metadata:
 creation_time : 2019-06-24T18:14:35.000000Z
 handler_name : Apple Video Media Handler
 encoder : MPEG-4 Video
 Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
 Metadata:
 creation_time : 2019-06-24T18:14:36.000000Z
 handler_name : Apple Sound Media Handler
 Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
 Metadata:
 creation_time : 2019-06-24T19:32:28.000000Z
 handler_name : Time Code Media Handler
 timecode : 10:00:00:00
Stream mapping:
 Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 000001d8655322c0] VBV maxrate unspecified, assuming CBR
[libx264 @ 000001d8655322c0] using SAR=1/1
[libx264 @ 000001d8655322c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000001d8655322c0] profile High, level 4.2, 4:2:0, 8-bit
[libx264 @ 000001d8655322c0] 264 - core 159 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - 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_lookahead=40 rc=cbr mbtree=1 bitrate=4500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=4500 vbv_bufsize=4500 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to ' C:\MyOutputFile.mp4':
 Metadata:
 major_brand : qt
 minor_version : 537199360
 compatible_brands: qt
 timecode : 10:00:00:00
 encoder : Lavf58.29.100
 Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 4500 kb/s, 0.02 fps, 12800 tbn, 50 tbc (default)
 Metadata:
 creation_time : 2019-06-24T18:14:35.000000Z
 handler_name : Apple Video Media Handler
 encoder : Lavc58.54.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/4500000 buffer size: 4500000 vbv_delay: -1
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 creation_time : 2019-06-24T18:14:36.000000Z
 handler_name : Apple Sound Media Handler
 encoder : Lavc58.54.100 aac
frame= 273 fps= 21 q=31.0 size= 2048kB time=00:00:05.44 bitrate=3084.1kbits/s dup=136 drop=0 speed=0.415x




Is there any modification I can make to the command to encode it in less time ?


-
how to encode 25fps
20 novembre 2020, par Vadik Jonyi am not a programmer, but a part of my job is recoding. The person befor me left a script that recodes videos.
THE CURRENT PROBLEM : i need to add to the script the line to recode any video to 25 fps. I tried adding -filter:v fps=fps=25 to the script and it works BUT it ignores all other recoding settings. So i would be very happy if someone could help. Sorry for my trivial language, as i said - i am not a programmer :(
HERE IS THE SCRIPT :


import os, subprocess


DIR = r"\\server-01\E\_NEW CONTENT\_Current Time\Actual Programs" 


EXP = r"\\server-01\D\_RENDERED CONTENT\Current Time" 
print ( "=-===-=-=-=" )

ALLDIR = os.listdir(DIR)
#ext = ".mp4"
#ext = ".mov"
ext = ".mpg"

FL0 = [x for x in ALLDIR if x.endswith("mpg") or x.endswith("mp4") or x.endswith("mxf") or x.endswith("mov") ]


CL = len(FL0)
print ( "Amount of files: ", CL )



#if pres_scaler
#Deint = True
Deint = False 
crop = False
#crop = True
scale = True
#scale = False
#recode = False
recode = True
interlaced_tff = False
cmdlist = []

for i in range(0, CL):
#for i in range(0, 1):
#for i in range(12, CL):
 vfs = []

cur_name = FL0[i]
print ("Input file path: ", cur_name)

new_name = os.path.splitext(cur_name)[0] + ".mp4"
PATH = DIR + os.sep + cur_name

EXPATH = EXP + os.sep + new_name

if Deint:
 #yadif = " -vf \"yadif=0:0:0\" "
 vfs.append("yadif=0:0:0")
 #vfs.append("drawbox=x=0:y=0:w=720:h=2:color=black:t=max")
 #yadif = " -vf \"yadif=0:0:0,drawbox=x=0:y=0:w=720:h=4:color=black:t=max\" "
else : yadif = ""
if interlaced_tff:
 vfs.append("fieldorder=tff" )
if crop:
 vfs.append("crop=720:432:0:72" )
if scale:
 vfs.append("scale=720x576" )
if len(vfs) > 0:
 vfcmd = "-vf \"" + ",".join(vfs) + "\""
else: vfcmd = ""
print (vfcmd)
cmd = "ffmpeg -hide_banner -i \"" + PATH + "\" " + vfcmd 

if recode:
 
 cmd = cmd + ' -aspect "16:9" -profile:v main -c:v libx264 -pix_fmt yuv420p -filter:v fps=fps=25 '
 if interlaced_tff:
 cmd = cmd + " -flags +ildct+ilme -x264opts tff=1 "
 cmd = cmd + ' -crf 19 -b:a 192k -ar 48000 -ac 2 '
else: 
 cmd = cmd + " -c:v copy " + " -af \"volume=2\" -ar 48000 " 


cmd = cmd + "\"" + EXPATH + "\""

print ( cmd )
cmdlist.append(cmd)
print ( "=-===-=-=-=" )
subprocess.call(cmd)



and here is the text i am getting from FFMPEG :


Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\\server-01\E\_NEW 
CONTENT\_Current Time\Actual Programs\PROG_Detali_80_Robopes_na_zavode_Ford_ 1017.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: mp42mp41
 creation_time : 2020-10-17T05:10:47.000000Z
 Duration: 00:23:22.28, start: 0.000000, bitrate: 15331 kb/s
 Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 14999 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
Metadata:
 creation_time : 2020-10-17T05:10:47.000000Z
 handler_name : ?Mainconcept Video Media Handler
 encoder : AVC Coding
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
 Metadata:
 creation_time : 2020-10-17T05:10:47.000000Z
 handler_name : #Mainconcept MP4 Sound Media Handler
Only '-vf fps=fps=25' read, ignoring remaining -vf options: Use ',' to separate filters
Only '-af (null)' read, ignoring remaining -af options: Use ',' to separate filters
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0000016645a43040] using SAR=1/1
[libx264 @ 0000016645a43040] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0000016645a43040] profile Main, level 4.0, 4:2:0, 8-bit
[libx264 @ 0000016645a43040] 264 - core 159 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 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_lookahead=40 rc=crf mbtree=1 crf=19.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '\\server-01\D\_RENDERED CONTENT\Current Time\PROG_Detali_80_Robopes_na_zavode_Ford_ 1017.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: mp42mp41
 encoder : Lavf58.39.101
 Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
 Metadata:
 creation_time : 2020-10-17T05:10:47.000000Z
 handler_name : ?Mainconcept Video Media Handler
 encoder : Lavc58.73.102 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
 Metadata:
 creation_time : 2020-10-17T05:10:47.000000Z
 handler_name : #Mainconcept MP4 Sound Media Handler
 encoder : Lavc58.73.102 aac
frame= 217 fps= 23 q=24.0 size= 10496kB time=00:00:08.64 bitrate=9951.8kbits/s speed=0.926x