
Recherche avancée
Médias (1)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (111)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)
Sur d’autres sites (9991)
-
Combining JavaCV and openCV
13 juin 2014, par mister-viperI have the following problem :
I have an Android application which uses native OpenCV code. In a first step, the frames which were edited by OpenCV came from the camera. Then they were processed and drawn on the display.However, my requirements now have changed. The frames which have to be edited come from a video file stored on the SD card. They must be processed by the openCV code and then stored in a new video file.
After reading some a lot of stuff, I recognized that Android has no built-in stuff for correctly reading a video file frame by frame and allowing to process the frames while doing so. On a computer OpenCV has the VideoCapture function. But this does not work on Android as openCV has no ffmpeg that comes with it.
After reading more stuff, I found that JavaCV comes with an FFMPEGFrameGrabber and also an FFMPEGFrameRecorder. So, I implemented everything which now allows me to grab single frames from a video, obtain an IplImage frame and store this frame in a new video.
Now the problem :
During obtaining and storing the IplImage frame must be processed using the original OpenCV code as it is not feasible to port the complete code to JavaCV.So in a first place I wrote a small test JNI function which gets the address of a MAT object and draws a small circle on it.
extern "C" {
JNIEXPORT void JNICALL Java_de_vion_postprocessing_step2_EyeTracking_editFrame(
JNIEnv*, jobject, jlong thiz, jlong addrRgba) {
//Convert the mat addresses into the objects
Mat& rgbFrame = *(Mat*) addrRgba;
Point2i scaledSmoothPoint(100,100);
circle(rgbFrame, scaledSmoothPoint, 20, YELLOW, -1);
}As I read that IplImage extends CvArr I just call the function within in my code as follows :
captured_frame = grabber.grab();
if (captured_frame == null) {
// no new frames
break;
}
editFrame(captured_frame .address());However, I now get the following error :
06-12 18:58:23.135: E/cv::error()(6498): OpenCV Error: Assertion failed (cn <= 4) in
void cv::scalarToRawData(const Scalar&, void*, int, int), file
/home/reports/ci/slave_desktop/50-SDK/opencv/modules/core/src/matrix.cpp, line 845
06-12 18:58:23.135: A/libc(6498): Fatal signal 6 (SIGABRT) at 0x00001962 (code=-6),
thread 6526 (AsyncTask #1)Finally, me question :
How can I process the IplImage frame using nativeOpenCV and finally store this IplImage frame then in the video recorder.I am also open to new Ideas which do not necessarily require JavaCV as long as I do not have to write the FrameGrabber and FrameRecorder my self.
Best regards,
André -
FFMPEG and -crf on Android
12 juin 2014, par mister-viperyesterday I managed to build a newer Version of FFMPEG for Android. I directly created a binary which allows me to invoke commands per commandline. I builded the Version using NDK r9d and the 4.8 linux_x86_x64 toolchain.
After including everything in my Application my goal was to execute the command for which I did the whole effort.
My goal is to run :
ffmpeg -i example.mp4 -r 30 -vcodec libx264 -crf 0 output.mp4
Running this command on the command line via python works absolutly fine. However, running this command on Android does not work.
1) I get the error that I have to add
-strict experimental
After reading FFMPEG docu I found out, that this is due to the libx264. However, I do not understand why I have not to add this comment in the Python version.
2) After adding the parameter above, I was able to convert the video. However, the result was horrible. The transcoded images were just some noisy blinking green stuff. Thus, I looked for the problem. The problem is the parameter :
-crf 0
Due to this parameter, the result was so horrible. However, if I change the parameter to
-crf 1
everything is working as expected. BUT : I really want a lossless encoding here. That was the reason for choosing -crf 0. Moreover, this parameter works fine in my python version.
Can anybody explain to me :
1) What are I’m doing wrong ?
2) How can I use -crf 0 on Android ?Best regards,
André//Edit :
Requested Logoutput :06-12 19:23:04.841: I/System.out(8983): Starting process
06-12 19:23:04.871: D/dalvikvm(8983): GC_FOR_ALLOC freed 294K, 4% free 9260K/9592K, paused 17ms, total 18ms
06-12 19:23:04.871: I/System.out(8983): ffmpeg version N-63698-g22d1b24 Copyright (c) 2000-2014 the FFmpeg developers
06-12 19:23:04.871: I/System.out(8983): built on Jun 11 2014 13:17:16 with gcc 4.8 (GCC)
06-12 19:23:04.871: I/System.out(8983): configuration: --target-os=linux --cross-prefix=arm-linux-androideabi- --arch=arm --cpu=armv7-a --sysroot=/home/andre/Desktop/android-ndk-r9d/platforms/android-9/arch-arm --disable-avdevice --disable-decoder=h264_vdpau --enable-libx264 --enable-gpl --prefix=build/armeabi-v7a-neon --extra-cflags='-I../x264 -DANDROID -I${ANDROID_NDK_ROOT_PATH}/sources/cxx-stl/system/include -march=armv7-a -mfloat-abi=softfp -mfpu=neon' --extra-ldflags='-L../x264 -Wl,--fix-cortex-a8 -L../android-libs -Wl,-rpath-link,../android-libs' --extra-cxxflags='-Wno-multichar -fno-exceptions -fno-rtti'
06-12 19:23:04.871: I/System.out(8983): libavutil 52. 89.100 / 52. 89.100
06-12 19:23:04.871: I/System.out(8983): libavcodec 55. 66.100 / 55. 66.100
06-12 19:23:04.871: I/System.out(8983): libavformat 55. 42.100 / 55. 42.100
06-12 19:23:04.871: I/System.out(8983): libavfilter 4. 5.100 / 4. 5.100
06-12 19:23:04.871: I/System.out(8983): libswscale 2. 6.100 / 2. 6.100
06-12 19:23:04.871: I/System.out(8983): libswresample 0. 19.100 / 0. 19.100
06-12 19:23:04.881: I/System.out(8983): libpostproc 52. 3.100 / 52. 3.100
06-12 19:23:04.971: I/System.out(8983): Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/screen_recording.mp4':
06-12 19:23:04.971: I/System.out(8983): Metadata:
06-12 19:23:04.971: I/System.out(8983): major_brand : isom
06-12 19:23:04.971: I/System.out(8983): minor_version : 0
06-12 19:23:04.971: I/System.out(8983): compatible_brands: isomiso2avc1
06-12 19:23:04.971: I/System.out(8983): creation_time : 2014-06-12 11:52:00
06-12 19:23:04.971: I/System.out(8983): Duration: 00:00:09.39, start: 0.000000, bitrate: 597 kb/s
06-12 19:23:04.971: I/System.out(8983): Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 720x1280, 593 kb/s, SAR 65536:65536 DAR 9:16, 34.07 fps, 90k tbr, 90k tbn, 180k tbc (default)
06-12 19:23:04.971: I/System.out(8983): Metadata:
06-12 19:23:04.971: I/System.out(8983): creation_time : 2014-06-12 11:51:56
06-12 19:23:04.971: I/System.out(8983): [libx264 @ 0x171c930] using SAR=1/1
06-12 19:23:04.981: I/System.out(8983): [libx264 @ 0x171c930] using cpu capabilities: ARMv6 NEON
06-12 19:23:04.991: I/System.out(8983): [libx264 @ 0x171c930] profile High 4:4:4 Predictive, level 3.1, 4:2:0 8-bit
06-12 19:23:04.991: I/System.out(8983): [libx264 @ 0x171c930] 64 - core 142 - 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=0 mixed_ref=1 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=0
06-12 19:23:04.991: I/System.out(8983): Output #0, mp4, to '/storage/emulated/0/screen_recording_out.mp4':
06-12 19:23:05.001: I/System.out(8983): Metadata:
06-12 19:23:05.001: I/System.out(8983): major_brand : isom
06-12 19:23:05.001: I/System.out(8983): minor_version : 0
06-12 19:23:05.001: I/System.out(8983): compatible_brands: isomiso2avc1
06-12 19:23:05.001: I/System.out(8983): encoder : Lavf55.42.100
06-12 19:23:05.001: I/System.out(8983): Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 720x1280 [SAR 65536:65536 DAR 9:16], q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
06-12 19:23:05.001: I/System.out(8983): Metadata:
06-12 19:23:05.001: I/System.out(8983): creation_time : 2014-06-12 11:51:56
06-12 19:23:05.001: I/System.out(8983): encoder : Lavc55.66.100 libx264
06-12 19:23:05.001: I/System.out(8983): Stream mapping:
06-12 19:23:05.001: I/System.out(8983): Stream #0:0 -> #0:0 (h264 -> libx264)
06-12 19:23:05.001: I/System.out(8983): Press [q] to stop, [?] for help
06-12 19:23:05.662: I/System.out(8983): frame= 14 fps=0.0 q=0.0 size= 51kB time=00:00:00.23 bitrate=1789.0kbits/s dup=0 drop=7
06-12 19:23:06.022: I/System.out(8983): frame= 20 fps= 20 q=0.0 size= 127kB time=00:00:00.43 bitrate=2395.1kbits/s dup=0 drop=14
06-12 19:23:06.602: I/System.out(8983): frame= 25 fps= 16 q=0.0 size= 195kB time=00:00:00.60 bitrate=2659.2kbits/s dup=0 drop=16
06-12 19:23:07.103: I/System.out(8983): frame= 30 fps= 14 q=0.0 size= 262kB time=00:00:00.76 bitrate=2803.4kbits/s dup=0 drop=21
06-12 19:23:07.674: I/System.out(8983): frame= 50 fps= 19 q=0.0 size= 276kB time=00:00:01.43 bitrate=1575.9kbits/s dup=0 drop=35
06-12 19:23:08.174: I/System.out(8983): frame= 70 fps= 22 q=0.0 size= 277kB time=00:00:02.10 bitrate=1079.1kbits/s dup=0 drop=35
06-12 19:23:08.725: I/System.out(8983): frame= 90 fps= 24 q=0.0 size= 278kB time=00:00:02.76 bitrate= 821.8kbits/s dup=0 drop=35
06-12 19:23:09.245: I/System.out(8983): frame= 109 fps= 26 q=0.0 size= 291kB time=00:00:03.40 bitrate= 700.3kbits/s dup=0 drop=42
06-12 19:23:09.746: I/System.out(8983): frame= 125 fps= 27 q=0.0 size= 299kB time=00:00:03.93 bitrate= 622.1kbits/s dup=0 drop=43
06-12 19:23:10.236: I/System.out(8983): frame= 144 fps= 28 q=0.0 size= 300kB time=00:00:04.56 bitrate= 537.4kbits/s dup=0 drop=44
06-12 19:23:11.117: I/System.out(8983): frame= 160 fps= 28 q=0.0 size= 337kB time=00:00:05.10 bitrate= 542.1kbits/s dup=0 drop=55
06-12 19:23:11.277: I/System.out(8983): frame= 162 fps= 26 q=0.0 size= 378kB time=00:00:05.16 bitrate= 598.6kbits/s dup=0 drop=58
06-12 19:23:11.828: I/System.out(8983): frame= 178 fps= 26 q=0.0 size= 428kB time=00:00:05.70 bitrate= 614.6kbits/s dup=0 drop=59
06-12 19:23:12.318: I/System.out(8983): frame= 198 fps= 27 q=0.0 size= 429kB time=00:00:06.36 bitrate= 551.6kbits/s dup=0 drop=68
06-12 19:23:12.829: I/System.out(8983): frame= 214 fps= 27 q=0.0 size= 431kB time=00:00:06.90 bitrate= 511.6kbits/s dup=0 drop=69
06-12 19:23:13.339: I/System.out(8983): frame= 233 fps= 28 q=0.0 size= 432kB time=00:00:07.53 bitrate= 469.6kbits/s dup=0 drop=70
06-12 19:23:14.690: I/System.out(8983): frame= 262 fps= 27 q=-1.0 Lsize= 457kB time=00:00:08.73 bitrate= 428.4kbits/s dup=18 drop=76
06-12 19:23:14.690: I/System.out(8983): video:455kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.401494%
06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] frame I:2 Avg QP: 0.00 size: 11390
06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] frame P:260 Avg QP: 0.00 size: 1702
06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] mb I I16..4: 97.5% 0.2% 2.3%
06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] mb P I16..4: 5.9% 0.3% 0.1% P16..4: 0.9% 0.1% 0.0% 0.0% 0.0% skip:92.8%
06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] 8x8 transform intra:3.6% inter:31.8%
06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] coded y,uvDC,uvAC intra: 17.3% 9.6% 9.2% inter: 0.4% 0.3% 0.3%
06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] i16 v,h,dc,p: 69% 30% 1% 0%
06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 49% 29% 0% 0% 0% 0% 0% 0%
06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 46% 31% 14% 1% 2% 2% 2% 1% 1%
06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] i8c dc,h,v,p: 80% 16% 3% 0%
06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] Weighted P-Frames: Y:5.4% UV:4.6%
06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] ref P L0: 74.9% 4.1% 19.6% 1.3% 0.0%
06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] kb/s:426.18
06-12 19:23:14.740: I/System.out(8983): Finished
06-12 19:23:14.740: I/System.out(8983): Finished Process -
doc/example/muxing : fix video timestamps
2 décembre 2011, par Michael Niedermayerdoc/example/muxing : fix video timestamps