
Recherche avancée
Autres articles (67)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (6401)
-
Android YouTube Live v3 rtmp streaming via ffmpeg won't show preview
14 décembre 2017, par Ariel YustHi everyone I’m breaking my head over this issue here,
I’m developing an Android App for streaming content from the user’s device camera (back/front) to a live streaming on YouTube.Problem :
YouTube Live shows "The health is good." in (Live Streaming->Events) but there’s nothing showing in the preview... in fact when I press play it tells me "An error has occurred, please try again later".Why is this happening ? what could be the problem ?
What I’m doing :
using google’s Oauth 2.0 and google api for login.
YouTube V3 data api’s for creating a new broadcast and stream or use an opened stream - I’m using RTMP.I’m opening Camera Api1 and capturing the video into a SurfaceTexture, then I encode images and audio (MIC) using Android’s MediaCodec, save a 3+- seconds *.mp4 file locally and then once the muxer is done I stream the file with ffpmeg.
String[] cmd = {
"-i", filePath, //local file path (video is playable with vlc)
"-strict", "experimental",
"-acodec", "aac",
"-ac", "1",
"-ar", "44100",
"-vcodec", "libx264",
"-pix_fmt", "yuv420p",
"-r", "30",
"-g", "60",
"-vb", "512k",
"-profile:v", "main",
"-preset", "medium",
"-f", "flv",
"-s", "1280x720",
CreateBroadcast.rtmpUrl
};
ffmpeg.execute(cmd, responseHandler); //responseHandler notify me to send next file
//how I set a new rtmpUrl, in CreateBroadcast.java
rtmpUrl =
returnedStream.getCdn().getIngestionInfo().getIngestionAddress() +
File.separator +
returnedStream.getCdn().getIngestionInfo().getStreamName();next file
Using this ffmpeg library.
ffmpeg process log :
10:40:08.967 7..8/c.k.r D/Send: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers, built with gcc 4.8 (GCC)
10:40:08.968 7..8/c.k.r D/Send: 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=
10:40:08.969 7..8/c.k.r D/Send: onProgress -> libavutil 55. 17.103 / 55. 17.103
10:40:08.969 7..8/c.k.r D/Send: onProgress -> libavcodec 57. 24.102 / 57. 24.102
10:40:08.969 7..8/c.k.r D/Send: onProgress -> libavformat 57. 25.100 / 57. 25.100
10:40:08.970 7..8/c.k.r D/Send: onProgress -> libavdevice 57. 0.101 / 57. 0.101
10:40:08.970 7..8/c.k.r D/Send: onProgress -> libavfilter 6. 31.100 / 6. 31.100
10:40:08.971 7..8/c.k.r D/Send: onProgress -> libswscale 4. 0.100 / 4. 0.100
10:40:08.971 7..8/c.k.r D/Send: onProgress -> libswresample 2. 0.101 / 2. 0.101
10:40:08.971 7..8/c.k.r D/Send: onProgress -> libpostproc 54. 0.100 / 54. 0.100
10:40:09.202 7..8/c.k.r D/Send: onProgress -> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Movies/realPoll_0.mp4':
10:40:09.203 7..8/c.k.r D/Send: onProgress -> Metadata:
10:40:09.203 7..8/c.k.r D/Send: onProgress -> major_brand : mp42
10:40:09.204 7..8/c.k.r D/Send: onProgress -> minor_version : 0
10:40:09.204 7..8/c.k.r D/Send: onProgress -> compatible_brands: isommp42
10:40:09.204 7..8/c.k.r D/Send: onProgress -> creation_time : 2017-08:40:08
10:40:09.205 7..8/c.k.r D/Send: onProgress -> com.android.version: 6.0.1
10:40:09.205 7..8/c.k.r D/Send: onProgress -> Duration: 00:00:02.79, start: 0.000000, bitrate: 4080 kb/s
10:40:09.206 7..8/c.k.r D/Send: onProgress -> Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720, 4166 kb/s, SAR 1:1 DAR 16:9, 30.60 fps, 90k tbr, 90k tbn, 180k tbc (default)
10:40:09.206 7..8/c.k.r D/Send: onProgress -> Metadata:
10:40:09.207 7..8/c.k.r D/Send: onProgress -> creation_time : 2017-08:40:08
10:40:09.207 7..8/c.k.r D/Send: onProgress -> handler_name : VideoHandle
10:40:09.208 7..8/c.k.r D/Send: onProgress -> Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 59 kb/s (default)
10:40:09.208 7..8/c.k.r D/Send: onProgress -> Metadata:
10:40:09.209 7..8/c.k.r D/Send: onProgress -> creation_time : 2017-08:40:08
10:40:09.209 7..8/c.k.r D/Send: onProgress -> handler_name : SoundHandle
10:40:10.312 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] using SAR=1/1
10:40:10.324 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] using cpu capabilities: none!
10:40:10.457 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] profile Main, level 3.1
10:40:10.458 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - 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=60 keyint_min=6 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=512 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
10:40:10.494 7..8/c.k.r D/Send: onProgress -> Output #0, flv, to 'rtmp://a.rtmp.youtube.com/live2/b2mb-vjew-2205-8w39':
10:40:10.495 7..8/c.k.r D/Send: onProgress -> Metadata:
10:40:10.496 7..8/c.k.r D/Send: onProgress -> major_brand : mp42
10:40:10.499 7..8/c.k.r D/Send: onProgress -> minor_version : 0
10:40:10.500 7..8/c.k.r D/Send: onProgress -> compatible_brands: isommp42
10:40:10.502 7..8/c.k.r D/Send: onProgress -> com.android.version: 6.0.1
10:40:10.504 7..8/c.k.r D/Send: onProgress -> encoder : Lavf57.25.100
10:40:10.505 7..8/c.k.r D/Send: onProgress -> Stream #0:0(eng): Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 512 kb/s, 30 fps, 1k tbn, 30 tbc (default)
10:40:10.507 7..8/c.k.r D/Send: onProgress -> Metadata:
10:40:10.509 7..8/c.k.r D/Send: onProgress -> creation_time : 2017-08:40:08
10:40:10.510 7..8/c.k.r D/Send: onProgress -> handler_name : VideoHandle
10:40:10.511 7..8/c.k.r D/Send: onProgress -> encoder : Lavc57.24.102 libx264
10:40:10.512 7..8/c.k.r D/Send: onProgress -> Side data:
10:40:10.512 7..8/c.k.r D/Send: onProgress -> unknown side data type 10 (24 bytes)
10:40:10.514 7..8/c.k.r D/Send: onProgress -> Stream #0:1(eng): Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, mono, fltp, 69 kb/s (default)
10:40:10.521 7..8/c.k.r D/Send: onProgress -> Metadata:
10:40:10.522 7..8/c.k.r D/Send: onProgress -> creation_time : 2017-08:40:08
10:40:10.522 7..8/c.k.r D/Send: onProgress -> handler_name : SoundHandle
10:40:10.522 7..8/c.k.r D/Send: onProgress -> encoder : Lavc57.24.102 aac
10:40:10.523 7..8/c.k.r D/Send: onProgress -> Stream mapping:
10:40:10.523 7..8/c.k.r D/Send: onProgress -> Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
10:40:10.524 7..8/c.k.r D/Send: onProgress -> Stream #0:1 -> #0:1 (aac (native) -> aac (native))
10:40:10.524 7..8/c.k.r D/Send: onProgress -> Press [q] to stop, [?] for help
10:40:11.017 7..8/c.k.r D/Send: onProgress -> frame= 0 fps=0.0 q=0.0 size= 0kB time=00:00:00.92 bitrate= 4.3kbits/s speed=1.82x
10:40:11.300 7..8/c.k.r D/Send: onProgress -> Past duration 0.912331 too large
10:40:11.342 7..8/c.k.r D/Send: onProgress -> Past duration 0.874321 too large
10:40:11.376 7..8/c.k.r D/Send: onProgress -> Past duration 0.903664 too large
10:40:11.411 7..8/c.k.r D/Send: onProgress -> Past duration 0.884666 too large
10:40:11.545 7..8/c.k.r D/Send: onProgress -> frame= 12 fps= 12 q=0.0 size= 0kB time=00:00:01.03 bitrate= 3.9kbits/s dup=0 drop=2 speed= 1x
10:40:12.105 7..8/c.k.r D/Send: onProgress -> frame= 25 fps= 16 q=0.0 size= 0kB time=00:00:01.03 bitrate= 3.9kbits/s dup=0 drop=2 speed=0.667x
[ 10:40:12.379 191: 191 E/ ]
invalid crash request of size 4 (from pid=7244 uid=0)
10:40:12.598 7..8/c.k.r D/Send: onProgress -> frame= 32 fps= 15 q=0.0 size= 0kB time=00:00:02.02 bitrate= 2.0kbits/s dup=0 drop=2 speed=0.98x
10:40:12.598 7..8/c.k.r D/Send: onProgress -> Past duration 0.792656 too large
10:40:12.675 7..8/c.k.r D/Send: onProgress -> Past duration 0.710991 too large
10:40:12.708 7..8/c.k.r D/Send: onProgress -> Past duration 0.688332 too large
10:40:12.725 7..8/c.k.r D/Send: onProgress -> Past duration 0.710655 too large
10:40:12.760 7..8/c.k.r D/Send: onProgress -> Past duration 0.716331 too large
10:40:12.775 7..8/c.k.r D/Send: onProgress -> Past duration 0.713661 too large
10:40:12.791 7..8/c.k.r D/Send: onProgress -> Past duration 0.688332 too large
10:40:12.825 7..8/c.k.r D/Send: onProgress -> Past duration 0.633659 too large
10:40:12.857 7..8/c.k.r D/Send: onProgress -> Past duration 0.661324 too large
10:40:12.876 7..8/c.k.r D/Send: onProgress -> Past duration 0.670998 too large
10:40:12.942 7..8/c.k.r D/Send: onProgress -> Past duration 0.640327 too large
10:40:17.761 7..8/c.k.r D/Send: onProgress -> frame= 47 fps=6.7 q=0.0 size= 0kB time=00:00:02.02 bitrate= 2.0kbits/s dup=0 drop=2 speed=0.288x
10:40:17.929 7..8/c.k.r D/Send: onProgress -> Past duration 0.605324 too large
10:40:17.997 7..8/c.k.r D/Send: onProgress -> Past duration 0.614998 too large
10:40:18.520 7..8/c.k.r D/Send: onProgress -> frame= 51 fps=6.6 q=42.0 size= 4kB time=00:00:02.02 bitrate= 17.0kbits/s dup=0 drop=2 speed=0.263x
10:40:18.520 7..8/c.k.r D/Send: onProgress -> Past duration 0.605995 too large
10:40:19.607 7..8/c.k.r D/Send: onProgress -> Past duration 0.608986 too large
10:40:19.843 7..8/c.k.r D/Send: onProgress -> frame= 53 fps=5.8 q=42.0 size= 9kB time=00:00:02.02 bitrate= 34.8kbits/s dup=0 drop=2 speed=0.223x
10:40:20.365 7..8/c.k.r D/Send: onProgress -> Past duration 0.614326 too large
10:40:20.710 7..8/c.k.r D/Send: onProgress -> frame= 56 fps=5.7 q=41.0 size= 16kB time=00:00:02.02 bitrate= 66.2kbits/s dup=0 drop=2 speed=0.206x
10:40:21.348 7..8/c.k.r D/Send: onProgress -> frame= 58 fps=5.5 q=41.0 size= 20kB time=00:00:02.02 bitrate= 82.1kbits/s dup=0 drop=2 speed=0.193x
10:40:22.419 7..8/c.k.r D/Send: onProgress -> frame= 61 fps=5.2 q=41.0 size= 27kB time=00:00:02.02 bitrate= 108.3kbits/s dup=0 drop=2 speed=0.173x
10:40:23.232 7..8/c.k.r D/Send: onProgress -> frame= 64 fps=5.1 q=41.0 size= 33kB time=00:00:02.02 bitrate= 133.1kbits/s dup=0 drop=2 speed=0.161x
10:40:24.659 7..8/c.k.r D/Send: onProgress -> frame= 67 fps=4.8 q=40.0 size= 38kB time=00:00:02.02 bitrate= 154.5kbits/s dup=0 drop=2 speed=0.145x
10:40:25.591 7..8/c.k.r D/Send: onProgress -> frame= 69 fps=4.7 q=40.0 size= 42kB time=00:00:02.02 bitrate= 169.5kbits/s dup=0 drop=2 speed=0.138x
10:40:26.137 7..8/c.k.r D/Send: onProgress -> frame= 71 fps=4.6 q=39.0 size= 45kB time=00:00:02.02 bitrate= 183.6kbits/s dup=0 drop=2 speed=0.132x
10:40:26.913 7..8/c.k.r D/Send: onProgress -> frame= 73 fps=4.5 q=39.0 size= 46kB time=00:00:02.02 bitrate= 187.6kbits/s dup=0 drop=2 speed=0.125x
10:40:27.234 7..8/c.k.r D/Send: onProgress -> frame= 76 fps=4.5 q=38.0 size= 49kB time=00:00:02.48 bitrate= 162.7kbits/s dup=0 drop=2 speed=0.149x
10:40:27.295 7..8/c.k.r D/Send: onProgress -> Past duration 0.686333 too large
10:40:27.801 7..8/c.k.r D/Send: onProgress -> Past duration 0.840324 too large
10:40:28.269 7..8/c.k.r D/Send: onProgress -> frame= 78 fps=4.5 q=37.0 size= 53kB time=00:00:02.54 bitrate= 171.5kbits/s dup=0 drop=2 speed=0.147x
10:40:28.269 7..8/c.k.r D/Send: onProgress -> Past duration 0.739662 too large
10:40:28.336 7..8/c.k.r D/Send: onProgress -> Past duration 0.671333 too large
10:40:28.373 7..8/c.k.r D/Send: onProgress -> frame= 80 fps=4.5 q=37.0 size= 59kB time=00:00:02.54 bitrate= 188.7kbits/s dup=0 drop=2 speed=0.143x
10:40:41.320 7..8/c.k.r D/Send: onProgress -> [flv @ 0xb5ba9600] Failed to update header with correct duration.
10:40:41.321 7..8/c.k.r D/Send: onProgress -> [flv @ 0xb5ba9600] Failed to update header with correct filesize.
10:40:41.321 7..8/c.k.r D/Send: onProgress -> frame= 80 fps=2.6 q=-1.0 Lsize= 155kB time=00:00:02.70 bitrate= 468.9kbits/s dup=0 drop=2 speed=0.0877x
10:40:41.322 7..8/c.k.r D/Send: onProgress -> video:128kB audio:23kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.617489%
10:40:41.332 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] frame I:2 Avg QP:28.63 size: 3516
10:40:41.333 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] frame P:62 Avg QP:28.45 size: 1878
10:40:41.333 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] frame B:16 Avg QP:29.68 size: 400
10:40:41.334 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] consecutive B-frames: 71.2% 5.0% 3.8% 20.0%
10:40:41.334 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] mb I I16..4: 98.8% 0.0% 1.2%
10:40:41.334 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] mb P I16..4: 17.8% 0.0% 0.1% P16..4: 17.0% 0.2% 0.7% 0.0% 0.0% skip:64.2%
10:40:41.335 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] mb B I16..4: 0.1% 0.0% 0.0% B16..8: 11.9% 0.0% 0.0% direct: 1.0% skip:87.0% L0:16.0% L1:84.0% BI: 0.0%
10:40:41.335 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] final ratefactor: 30.20
10:40:41.336 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] coded y,uvDC,uvAC intra: 1.4% 20.4% 0.0% inter: 0.4% 14.0% 0.0%
10:40:41.338 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] i16 v,h,dc,p: 66% 22% 7% 4%
10:40:41.339 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 7% 19% 53% 4% 4% 3% 5% 2% 2%
10:40:41.339 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] i8c dc,h,v,p: 71% 16% 12% 0%
10:40:41.340 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] Weighted P-Frames: Y:6.5% UV:6.5%
10:40:41.340 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] ref P L0: 85.6% 4.5% 7.7% 2.2% 0.0%
10:40:41.341 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] ref B L0: 99.3% 0.7%
10:40:41.341 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] ref B L1: 97.0% 3.0%
10:40:41.342 7..8/c.k.r D/Send: onProgress -> [libx264 @ 0xb5b84800] kb/s:384.88
10:40:41.421 7..8/c.k.r D/Send: onProgress -> [aac @ 0xb5b85000] Qavg: 1561.786
10:40:41.423 7..8/c.k.r D/Send: onSuccess -> 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=
10:40:41.423 7..8/c.k.r D/Send: libavutil 55. 17.103 / 55. 17.103
10:40:41.423 7..8/c.k.r D/Send: libavcodec 57. 24.102 / 57. 24.102
10:40:41.423 7..8/c.k.r D/Send: libavformat 57. 25.100 / 57. 25.100
10:40:41.423 7..8/c.k.r D/Send: libavdevice 57. 0.101 / 57. 0.101
10:40:41.424 7..8/c.k.r D/Send: libavfilter 6. 31.100 / 6. 31.100
10:40:41.424 7..8/c.k.r D/Send: libswscale 4. 0.100 / 4. 0.100
10:40:41.424 7..8/c.k.r D/Send: libswresample 2. 0.101 / 2. 0.101
10:40:41.424 7..8/c.k.r D/Send: libpostproc 54. 0.100 / 54. 0.100
10:40:41.424 7..8/c.k.r D/Send: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Movies/realPoll_0.mp4':
10:40:41.424 7..8/c.k.r D/Send: Metadata:
10:40:41.424 7..8/c.k.r D/Send: major_brand : mp42
10:40:41.424 7..8/c.k.r D/Send: minor_version : 0
10:40:41.424 7..8/c.k.r D/Send: compatible_brands: isommp42
10:40:41.424 7..8/c.k.r D/Send: creation_time : 2017-08:40:08
10:40:41.424 7..8/c.k.r D/Send: com.android.version: 6.0.1
10:40:41.424 7..8/c.k.r D/Send: Duration: 00:00:02.79, start: 0.000000, bitrate: 4080 kb/s
10:40:41.424 7..8/c.k.r D/Send: Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720, 4166 kb/s, SAR 1:1 DAR 16:9, 30.60 fps, 90k tbr, 90k tbn, 180k tbc (default)
10:40:41.424 7..8/c.k.r D/Send: Metadata:
10:40:41.424 7..8/c.k.r D/Send: creation_time : 2017-08:40:08
10:40:41.424 7..8/c.k.r D/Send: handler_name : VideoHandle
10:40:41.424 7..8/c.k.r D/Send: Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 59 kb/s (default)
10:40:41.424 7..8/c.k.r D/Send: Metadata:
10:40:41.424 7..8/c.k.r D/Send: creation_time : 2017-08:40:08
10:40:41.424 7..8/c.k.r D/Send: handler_name : SoundHandle
10:40:41.425 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] using SAR=1/1
10:40:41.425 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] using cpu capabilities: none!
10:40:41.425 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] profile Main, level 3.1
10:40:41.425 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - 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=60 keyint_min=6 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=512 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
10:40:41.425 7..8/c.k.r D/Send: Output #0, flv, to 'rtmp://a.rtmp.youtube.com/live2/b2mb-vjew-2205-8w39':
10:40:41.425 7..8/c.k.r D/Send: Metadata:
10:40:41.425 7..8/c.k.r D/Send: major_brand : mp42
10:40:41.425 7..8/c.k.r D/Send: minor_version : 0
10:40:41.425 7..8/c.k.r D/Send: compatible_brands: isommp42
10:40:41.425 7..8/c.k.r D/Send: com.android.version: 6.0.1
10:40:41.425 7..8/c.k.r D/Send: encoder : Lavf57.25.100
10:40:41.425 7..8/c.k.r D/Send: Stream #0:0(eng): Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 512 kb/s, 30 fps, 1k tbn, 30 tbc (default)
10:40:41.425 7..8/c.k.r D/Send: Metadata:
10:40:41.425 7..8/c.k.r D/Send: creation_time : 2017-08:40:08
10:40:41.425 7..8/c.k.r D/Send: handler_name : VideoHandle
10:40:41.425 7..8/c.k.r D/Send: encoder : Lavc57.24.102 libx264
10:40:41.425 7..8/c.k.r D/Send: Side data:
10:40:41.425 7..8/c.k.r D/Send: unknown side data type 10 (24 bytes)
10:40:41.425 7..8/c.k.r D/Send: Stream #0:1(eng): Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, mono, fltp, 69 kb/s (default)
10:40:41.426 7..8/c.k.r D/Send: Metadata:
10:40:41.426 7..8/c.k.r D/Send: creation_time : 2017-08:40:08
10:40:41.426 7..8/c.k.r D/Send: handler_name : SoundHandle
10:40:41.426 7..8/c.k.r D/Send: encoder : Lavc57.24.102 aac
10:40:41.426 7..8/c.k.r D/Send: Stream mapping:
10:40:41.426 7..8/c.k.r D/Send: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
10:40:41.427 7..8/c.k.r D/Send: Stream #0:1 -> #0:1 (aac (native) -> aac (native))
10:40:41.427 7..8/c.k.r D/Send: Press [q] to stop, [?] for help
10:40:41.427 7..8/c.k.r D/Send: frame= 0 fps=0.0 q=0.0 size= 0kB time=00:00:00.92 bitrate= 4.3kbits/s speed=1.82x
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.912331 too large
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.874321 too large
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.903664 too large
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.884666 too large
10:40:41.427 7..8/c.k.r D/Send: frame= 12 fps= 12 q=0.0 size= 0kB time=00:00:01.03 bitrate= 3.9kbits/s dup=0 drop=2 speed= 1x
10:40:41.427 7..8/c.k.r D/Send: frame= 25 fps= 16 q=0.0 size= 0kB time=00:00:01.03 bitrate= 3.9kbits/s dup=0 drop=2 speed=0.667x
10:40:41.427 7..8/c.k.r D/Send: frame= 32 fps= 15 q=0.0 size= 0kB time=00:00:02.02 bitrate= 2.0kbits/s dup=0 drop=2 speed=0.98x
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.792656 too large
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.710991 too large
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.688332 too large
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.710655 too large
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.716331 too large
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.713661 too large
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.688332 too large
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.633659 too large
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.661324 too large
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.670998 too large
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.640327 too large
10:40:41.427 7..8/c.k.r D/Send: frame= 47 fps=6.7 q=0.0 size= 0kB time=00:00:02.02 bitrate= 2.0kbits/s dup=0 drop=2 speed=0.288x
10:40:41.427 7..8/c.k.r D/Send: Past duration 0.605324 too large
10:40:41.428 7..8/c.k.r D/Send: Past duration 0.614998 too large
10:40:41.428 7..8/c.k.r D/Send: frame= 51 fps=6.6 q=42.0 size= 4kB time=00:00:02.02 bitrate= 17.0kbits/s dup=0 drop=2 speed=0.263x
10:40:41.428 7..8/c.k.r D/Send: Past duration 0.605995 too large
10:40:41.428 7..8/c.k.r D/Send: Past duration 0.608986 too large
10:40:41.428 7..8/c.k.r D/Send: frame= 53 fps=5.8 q=42.0 size= 9kB time=00:00:02.02 bitrate= 34.8kbits/s dup=0 drop=2 speed=0.223x
10:40:41.428 7..8/c.k.r D/Send: Past duration 0.614326 too large
10:40:41.428 7..8/c.k.r D/Send: frame= 56 fps=5.7 q=41.0 size= 16kB time=00:00:02.02 bitrate= 66.2kbits/s dup=0 drop=2 speed=0.206x
10:40:41.428 7..8/c.k.r D/Send: frame= 58 fps=5.5 q=41.0 size= 20kB time=00:00:02.02 bitrate= 82.1kbits/s dup=0 drop=2 speed=0.193x
10:40:41.428 7..8/c.k.r D/Send: frame= 61 fps=5.2 q=41.0 size= 27kB time=00:00:02.02 bitrate= 108.3kbits/s dup=0 drop=2 speed=0.173x
10:40:41.428 7..8/c.k.r D/Send: frame= 64 fps=5.1 q=41.0 size= 33kB time=00:00:02.02 bitrate= 133.1kbits/s dup=0 drop=2 speed=0.161x
10:40:41.428 7..8/c.k.r D/Send: frame= 67 fps=4.8 q=40.0 size= 38kB time=00:00:02.02 bitrate= 154.5kbits/s dup=0 drop=2 speed=0.145x
10:40:41.428 7..8/c.k.r D/Send: frame= 69 fps=4.7 q=40.0 size= 42kB time=00:00:02.02 bitrate= 169.5kbits/s dup=0 drop=2 speed=0.138x
10:40:41.428 7..8/c.k.r D/Send: frame= 71 fps=4.6 q=39.0 size= 45kB time=00:00:02.02 bitrate= 183.6kbits/s dup=0 drop=2 speed=0.132x
10:40:41.428 7..8/c.k.r D/Send: frame= 73 fps=4.5 q=39.0 size= 46kB time=00:00:02.02 bitrate= 187.6kbits/s dup=0 drop=2 speed=0.125x
10:40:41.428 7..8/c.k.r D/Send: frame= 76 fps=4.5 q=38.0 size= 49kB time=00:00:02.48 bitrate= 162.7kbits/s dup=0 drop=2 speed=0.149x
10:40:41.428 7..8/c.k.r D/Send: Past duration 0.686333 too large
10:40:41.428 7..8/c.k.r D/Send: Past duration 0.840324 too large
10:40:41.428 7..8/c.k.r D/Send: frame= 78 fps=4.5 q=37.0 size= 53kB time=00:00:02.54 bitrate= 171.5kbits/s dup=0 drop=2 speed=0.147x
10:40:41.428 7..8/c.k.r D/Send: Past duration 0.739662 too large
10:40:41.429 7..8/c.k.r D/Send: Past duration 0.671333 too large
10:40:41.429 7..8/c.k.r D/Send: frame= 80 fps=4.5 q=37.0 size= 59kB time=00:00:02.54 bitrate= 188.7kbits/s dup=0 drop=2 speed=0.143x
10:40:41.429 7..8/c.k.r D/Send: [flv @ 0xb5ba9600] Failed to update header with correct duration.
10:40:41.429 7..8/c.k.r D/Send: [flv @ 0xb5ba9600] Failed to update header with correct filesize.
10:40:41.429 7..8/c.k.r D/Send: frame= 80 fps=2.6 q=-1.0 Lsize= 155kB time=00:00:02.70 bitrate= 468.9kbits/s dup=0 drop=2 speed=0.0877x
10:40:41.429 7..8/c.k.r D/Send: video:128kB audio:23kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.617489%
10:40:41.429 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] frame I:2 Avg QP:28.63 size: 3516
10:40:41.429 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] frame P:62 Avg QP:28.45 size: 1878
10:40:41.429 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] frame B:16 Avg QP:29.68 size: 400
10:40:41.429 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] consecutive B-frames: 71.2% 5.0% 3.8% 20.0%
10:40:41.429 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] mb I I16..4: 98.8% 0.0% 1.2%
10:40:41.429 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] mb P I16..4: 17.8% 0.0% 0.1% P16..4: 17.0% 0.2% 0.7% 0.0% 0.0% skip:64.2%
10:40:41.429 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] mb B I16..4: 0.1% 0.0% 0.0% B16..8: 11.9% 0.0% 0.0% direct: 1.0% skip:87.0% L0:16.0% L1:84.0% BI: 0.0%
10:40:41.429 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] final ratefactor: 30.20
10:40:41.429 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] coded y,uvDC,uvAC intra: 1.4% 20.4% 0.0% inter: 0.4% 14.0% 0.0%
10:40:41.429 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] i16 v,h,dc,p: 66% 22% 7% 4%
10:40:41.429 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 7% 19% 53% 4% 4% 3% 5% 2% 2%
10:40:41.429 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] i8c dc,h,v,p: 71% 16% 12% 0%
10:40:41.430 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] Weighted P-Frames: Y:6.5% UV:6.5%
10:40:41.430 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] ref P L0: 85.6% 4.5% 7.7% 2.2% 0.0%
10:40:41.430 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] ref B L0: 99.3% 0.7%
10:40:41.430 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] ref B L1: 97.0% 3.0%
10:40:41.430 7..8/c.k.r D/Send: [libx264 @ 0xb5b84800] kb/s:384.88
10:40:41.430 7..8/c.k.r D/Send: [aac @ 0xb5b85000] Qavg: 1561.786Thanks for your time and insights !
-
C++ OpenCV 3.4 / FFMPEG 3.4.1 VideoWriter and MP4 Output File Format
11 janvier 2019, par PhilBotI’m running on an ARM BeagleBone X-15 Debian machine with Linux Kernel 4.9.35-ti-r44. In my C++ ( Qt 5 ) application, I want to save my cv::Mat frames to an MP4 format video. I have libx264 installed and compiled from scratch both ffmpeg and OpenCv. I can successfully record and view video with MJPEG with the AVI video container type but not MP4. Whenever I try to write an MP4 video, I get run time errors of the form :
OpenCV: FFMPEG: tag 0x44495658/'XVID' is not supported with codec id 13 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x00000020/' ???'I’ve tried various Google answers but none have worked.
Relevant code :
cv::Size frameSize = frame.size();
qDebug() << "Initializing Video Recording to save Video file here: " << destinationFileName;
std::string filename = destinationFileName.toStdString();
//int fcc = CV_FOURCC('M','J','P','G');
//int fcc = CV_FOURCC('X','2','6','4');
int fcc = CV_FOURCC('X','V','I','D');
int fps = 1;
videoRecorder = new cv::VideoWriter(filename,fcc,fps,frameSize);
...
videoRecorder->write(frame);I’ve downloaded and built the latest OpenCV 3.4 but the problem persists.
How can I write to an MP4 File with OpenCV’s video writer ?When I try the ’X’,’2’,’6’,’4’ format I get the error :
Initializing Video Recording to save Video file here: "/tmp/Garage.mp4"
OpenCV: FFMPEG: tag 0x34363258/'X264' is not supported with codec id 28 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x31637661/'avc1'
[h264_v4l2m2m @ 0x81042020] Could not find a valid device
[h264_v4l2m2m @ 0x81042020] can't configure encoder
Could not open codec 'h264_v4l2m2m': Unspecified error
StartingWhen I try the ’X’,’V’,’I’,’D’ format I get the error :
Initializing Video Recording to save Video file here: "/tmp/Garage.mp4"
OpenCV: FFMPEG: tag 0x44495658/'XVID' is not supported with codec id 13 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'
StartingWhen I try the ’M’,’P’,’E’,’G’ format I get the error :
Initializing Video Recording to save Video file here: "/tmp/Garage.mp4"
OpenCV: FFMPEG: tag 0x4745504d/'MPEG' is not supported with codec id 2 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'
StartingWhen I try the ’H’,’2’,’6’,’4’ format I get the error :
OpenCV: FFMPEG: tag 0x34363248/'H264' is not supported with codec id 28 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x31637661/'avc1'
[h264_v4l2m2m @ 0x7fdde340] Could not find a valid device
[h264_v4l2m2m @ 0x7fdde340] can't configure encoder
Could not open codec 'h264_v4l2m2m': Unspecified error
StartingWhen I try the ’M’,’P’,’4’,’V’ format I get the error :
Initializing Video Recording to save Video file here: "/tmp/Garage.mp4"
OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 13 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'
StartingWhen I try the ’A’,’V’,’C’,’1’ format I get the error :
Initializing Video Recording to save Video file here: "/tmp/Garage.mp4"
OpenCV: FFMPEG: tag 0x31435641/'AVC1' is not supported with codec id 28 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x31637661/'avc1'
[h264_v4l2m2m @ 0x810f5f50] Could not find a valid device
[h264_v4l2m2m @ 0x810f5f50] can't configure encoder
Could not open codec 'h264_v4l2m2m': Unspecified error
StartingWhen I try the ’D’,’I’,’V’,’X’ format I get the error :
Initializing Video Recording to save Video file here: "/tmp/Garage.mp4"
OpenCV: FFMPEG: tag 0x58564944/'DIVX' is not supported with codec id 13 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'
StartingWhen I try the 0x21 format I get the error :
Initializing Video Recording to save Video file here: "/tmp/Garage.mp4"
OpenCV: FFMPEG: tag 0x00000021/'!???' is not found (format 'mp4 / MP4 (MPEG-4 Part 14)')'
StartingHere is my complete class which shows all tried formats :
#include "downloader.h"
Downloader::Downloader(QString url, QString destinationFile) : downloadUrl(url) , destinationFileName(destinationFile)
{
didInitializeVideoWriter = false;
qDebug() << "Initialized Downloader...";
}
Downloader::~Downloader() {
videoRecorder->release();
delete videoRecorder;
}
void Downloader::doDownload()
{
networkManager = new QNetworkAccessManager(this);
connect(networkManager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(replyFinished(QNetworkReply*)));
networkManager->get(QNetworkRequest(QUrl(downloadUrl)));
}
void Downloader::writeFrame(cv::Mat frame) {
QMutexLocker locker(&videoFrameMutex);
videoRecorder->write(frame);
}
void Downloader::replyFinished(QNetworkReply *reply)
{
if(reply->error())
{
qDebug() << "ERROR!";
qDebug() << reply->errorString();
}
else
{
//qDebug() << reply->header(QNetworkRequest::ContentTypeHeader).toString();
//qDebug() << reply->header(QNetworkRequest::LastModifiedHeader).toDateTime().toString();
//qDebug() << reply->header(QNetworkRequest::ContentLengthHeader).toULongLong();
qDebug() << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
qDebug() << reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString();
QString tempFileName = destinationFileName;
QString jpegTempFilename = QString("%1").arg(tempFileName.replace("mp4","jpeg"));
qDebug() << "Overwriting: " << jpegTempFilename;
QFile *file = new QFile(jpegTempFilename);
if(file->open(QFile::WriteOnly))
{
file->write(reply->readAll());
file->flush();
file->close();
}
delete file;
cv::Mat frame = imread(jpegTempFilename.toStdString(), CV_LOAD_IMAGE_COLOR); // CV_LOAD_IMAGE_COLOR (>0) loads the image in the BGR format
cv::cvtColor(frame,frame,CV_BGR2RGB);
// Now lazy load the recorder
if ( !didInitializeVideoWriter ) {
cv::Size frameSize = frame.size();
qDebug() << "Initializing Video Recording to save Video file here: " << destinationFileName;
std::string filename = destinationFileName.toStdString();
//int fcc = CV_FOURCC('M','J','P','G');
int fcc = CV_FOURCC('X','2','6','4');
//int fcc = CV_FOURCC('X','V','I','D');
//int fcc = CV_FOURCC('M','P','E','G');
//int fcc = CV_FOURCC('H','2','6','4');
//int fcc = CV_FOURCC('M','P','4','V');
//int fcc = CV_FOURCC('A','V','C','1');
//int fcc = CV_FOURCC('D','I','V','X');
//int fcc = 0x21;
//int fcc = 0x00000021;
int fps = 1;
videoRecorder = new cv::VideoWriter(filename,fcc,fps,frameSize);
qDebug() << "Starting";
frameCounter = 1;
performanceTimer.start();
didInitializeVideoWriter = true;
}
cv::putText(frame,"[REC]",cv::Point(50,50),5,1,cv::Scalar(0,0,225));
QFuture<void> backgroundRun = QtConcurrent::run(this, &Downloader::writeFrame, frame);
//backgroundRun.waitForFinished();
}
reply->deleteLater();
qDebug() << "RequestTimer: " << performanceTimer.elapsed() << frameCounter;
// Requests Again
networkManager->get(QNetworkRequest(QUrl(downloadUrl)));
frameCounter++;
performanceTimer.restart();
}
</void>Update - I tried ’a’,’v’,’c’,’1’ and unfortunately that also does not work :
Initializing Video Recording to save Video file here: "/tmp/Garage.mp4"
[h264_v4l2m2m @ 0x810f6aa0] Could not find a valid device
[h264_v4l2m2m @ 0x810f6aa0] can't configure encoder
Could not open codec 'h264_v4l2m2m': Unspecified error
(qt-downloader:6234): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
OpenCV Error: Unspecified error (GStreamer: cannot link elements
) in CvVideoWriter_GStreamer::open, file /media/usb/opencv/modules/videoio/src/cap_gstreamer.cpp, line 1635
VIDEOIO(cvCreateVideoWriter_GStreamer (filename, fourcc, fps, frameSize, is_color)): raised OpenCV exception:
/media/usb/opencv/modules/videoio/src/cap_gstreamer.cpp:1635: error: (-2) GStreamer: cannot link elements
in function CvVideoWriter_GStreamer::openWhen I try the X264 FOURCC, the mp4 file is 48 bytes and never grows :
Initializing Video Recording to save Video file here: "/tmp/Garage.mp4"
OpenCV: FFMPEG: tag 0x34363258/'X264' is not supported with codec id 27 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x31637661/'avc1'Static Size :
debian@BeagleBoard-X15:/tmp$ ls -lrt Garage.*
-rw-r--r-- 1 debian debian 48 Dec 24 21:13 Garage.mp4
-rw-r--r-- 1 debian debian 100424 Dec 24 21:14 Garage.jpeg
debian@BeagleBoard-X15:/tmp$ hexdump Garage.mp4
0000000 0000 2000 7466 7079 7369 6d6f 0000 0002
0000010 7369 6d6f 7369 326f 7661 3163 706d 3134
0000020 0000 0800 7266 6565 0000 0000 646d 7461
0000030Here is my ffmpeg build conf :
debian@BeagleBoard-X15:/tmp$ ffmpeg -buildconf
ffmpeg version N-89524-g74f408cc8e Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18) 20170516
configuration: --enable-gpl --enable-libx264 --enable-pthreads --enable-static --extra-cflags=-I./x264/include --extra-ldflags=-L./x264/lib --extra-libs=-ldl
libavutil 56. 6.100 / 56. 6.100
libavcodec 58. 8.100 / 58. 8.100
libavformat 58. 3.100 / 58. 3.100
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 7.100 / 7. 7.100
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
configuration:
--enable-gpl
--enable-libx264
--enable-pthreads
--enable-static
--extra-cflags=-I./x264/include
--extra-ldflags=-L./x264/lib
--extra-libs=-ldl -
How to measure the performance of a newsletter (or any email) with Piwik
19 décembre 2017, par InnoCraft — CommunityTo be able to grow your business, it is crucial to track all your marketing efforts. This includes all newsletters and emails that you share with people outside of your business. Otherwise, you won’t be able to know which of your daily efforts are yielding results.
Are you wondering if it is possible to track the performance of an emailing campaign in Piwik efficiently ? Would you like to know if it is technically easy ? No worries, here is a “How to” tutorial showing you how easily you can track an emailing in Piwik properly.
Different tracking levels for different needs
There are many things that you may be interested to track, for example :
- How many users opened your email
- How many users interacted with the links in your email
- How many users interacted on your website through your email
Let’s have a look at each of these levels.
Step 1 – Tracking email and newsletter openings in Piwik
Tracking email openings requires to add an HTML code to your newsletter. It works through what we call a tracking pixel, a tiny image of 1×1 that is transparent so the user will not be able to see it.
In order to install it, here is an example of what this code looks like :<img src="https://piwik.example.com/piwik.php?idsite=YOUR_PIWIK_WEBSITE_ID&rec=1&bots=1&url=https%3A%2F%2Fexample.com%2Femail-opened%2Fnewsletter_XYZ&action_name=Email%20opened&_rcn=internal%20email%20name&_rck=newsletter_XYZ" style="border:0;” alt="" />
The Piwik tracking pixel explained
The above URL is composed of the following URL parameters which are part of our Tracking API :
- idsite : Corresponds to the ID of the website you would like to track.
- rec : You need to have rec=1 in order for the request to be actually recorded.
- bots : Set it to 1 to include all the connections made to this request, bots included.
- url : corresponds to the URL you would like to display in Piwik every time the email is opened.
- action_name : This is the page name you would like to be tracked when the email is opened.
- _rcn : The name you would like to give to your campaign.
- _rck : The keyword you may like to use in order to summarize the content of your newsletter.
You may have noticed some special characters here such as “%20”, “%2F”. That’s because the URL is encoded. We strongly recommend you to do so in order for your tracking not to break. Many tools are available on the web in order to encode your URLs such as https://www.urlencoder.org/.
If you would like to access the previous tracking code easily, keep in mind that you can always find the tracking code generator within the “Piwik admin panel → Tracking code” :
You can find more information about it on our guide at : How do I track how many users open and read my newsletter emails (using a pixel / beacon) ?
As a result, the information will be pushed as following for any user who opens your email :
To not bias your regular page views on your website with newsletter openings, we recommend tracking newsletter openings into a new website.
Tracking even more data : the user ID example
You can go deeper in your URL tracking by inserting other parameters such as the user id if you have this information within your emailing database. One of the main benefit of tracking the User ID is to connect data across multiple devices and browsers for a given user.
You only need to add the following parameter &uid=XXX where XXX equals the dynamic value of the user ID :
Make sure that UID from your emailing provider is the same as the one used on your website in order for your data to be consistent.
Important note : some email providers are loading email messages by default which results in an opening even if the user did not actually open the email.
Step 2 – Measure the clicks within your emailing
Tracking clicks within an email lets you know with which content readers interacted the most. We recommend tracking all links in all your emails as a campaign, whether it is a newsletter, a custom support email, an email invoice, etc. You might be surprised to see which of your emails lead to conversions and if they don’t, try to tweak those emails, so they might in the future.
Tracking clicks This works thanks to URL campaign tracking. In order to perform this action, you will need to add Piwik URL parameters to all your existing link URLs :
- Website URL : for example “www.your-website.com”.
- Campaign name : for example “pk_campaign=emailing”. Represents the name you would like to give to your campaign.
- Campaign keyword : for example “pk_keyword=name-of-your-article”. Represents the name you would like to give to your content.
- Campaign source : for example “pk_source=newsletter”. Represents the name of the referrer.
- Campaign medium : for example “pk_medium=email”. Represents the type of referrer you are using.
- Campaign content : for example “pk_content=title”. Represents the type of content.
You can find more information about campaign url tracking in our “Tracking marketing campaigns with Piwik” guide.
Here is a sample showing you how you can differentiate some links in a newsletter, all pointing to the same URL :
Once you have added these URL parameters to each of your link, Piwik will clearly indicate the referrer of this specific campaign when a user clicks on a link in the newsletter and visits your website.
Important note : if you do not track your campaigns, it will result in a bad interpretation of your data within Piwik as you will get webmail services or direct entries as referrer instead of your newsletter campaign.
Step 3 – Measure emailing performances on your website
Thanks to Piwik URL campaign parameters, you can now clearly identify the traffic brought through your emailing. You can now specifically isolate users who come from emails by creating a segment :
Once done, you can either have a look at each user specifically through the visitor log report or analyze it as a whole within the rest of the reports.
You can even measure your return on investment directly if goals have been defined. In order to know more about how to track goals within Piwik.
Did you like this article ?
If you enjoyed reading this article, do not hesitate to share it around you. Moreover, if there are any topics you would like to write us about in particular, just drop us an email and we will be more than happy to write about it.