Page 2 sur 2

Re: video par mail

Publié : 04 nov. 2016, 09:53
par kassor
Hamtaro06 a écrit : Salut, merci d'avoir partagé ton expérience, ca va m etre utile pour mon portail :)

Juste une chose, tu dis que ca bouffe 50-60% de CPU mais avec quelle machine ? Un Raspberry Pi 3 ?

Penses tu qu'il vaut mieux sur un mini PC de type clé USB ?
désolé j'ai oublié de préciser que mon domoticz était sur un simple rpi b+
donc sur les versions plus récentes ça doit aller bcp mieux

Re: video par mail

Publié : 14 juin 2019, 08:40
par Tryphon
Bonjour à tous,
Kassor, merci pour ton partage.
Perso je cherche à faire quelque chose de similaire, mais mon Rapsberry PI 3+ est à genoux.
J'utilise la commande suivante :

Code : Tout sélectionner

/usr/bin/ffmpeg -i "rtsp://login:mdp@ADR_IP/11" -t 10 -vcodec h264 -s 640x480 -y essai.mp4
Mais j'ai les messages suivants :

Code : Tout sélectionner

Input #0, rtsp, from 'rtsp://login:mdp@ADR_IP/11':
  Metadata:
    title           : 10
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080, 25 tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
[swscaler @ 0x8187e0] deprecated pixel format used, make sure you did set range correctly
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x7f27f0] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x7f27f0] profile High, level 3.0
[libx264 @ 0x7f27f0] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - 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=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[aac @ 0x8082b0] Too many bits 8832.000000 > 6144 per frame requested, clamping to max
Output #0, mp4, to 'essai.mp4':
  Metadata:
    title           : 10
    encoder         : Lavf57.56.101
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p(pc), 640x480, q=-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.64.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 8000 Hz, mono, fltp, 48 kb/s
    Metadata:
      encoder         : Lavc57.64.101 aac
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (pcm_alaw (native) -> aac (native))
Press [q] to stop, [?] for help
[rtsp @ 0x7925c0] max delay reached. need to consume packetbitrate=   0.0kbits/s dup=1 drop=0 speed=0.589x    
[rtsp @ 0x7925c0] RTP: missed 266 packets
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 9 packets
[h264 @ 0x91b640] error while decoding MB 18 58, bytestream -6
[h264 @ 0x91b640] concealing 1231 DC, 1231 AC, 1231 MV errors in I frame
[h264 @ 0x868850] Increasing reorder buffer to 1
[h264 @ 0x850330] error while decoding MB 12 58, bytestream -10
[h264 @ 0x850330] concealing 1237 DC, 1237 AC, 1237 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet bitrate= 487.2kbits/s dup=45 drop=0 speed=0.461x    
[rtsp @ 0x7925c0] RTP: missed 238 packets
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 39 packets
[h264 @ 0x91b640] error while decoding MB 18 58, bytestream -6
[h264 @ 0x91b640] concealing 1231 DC, 1231 AC, 1231 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 42 packets
[h264 @ 0x850330] error while decoding MB 48 59, bytestream -12
[h264 @ 0x850330] concealing 1081 DC, 1081 AC, 1081 MV errors in I frame
[h264 @ 0x969450] error while decoding MB 29 55, bytestream -7
[h264 @ 0x969450] concealing 1580 DC, 1580 AC, 1580 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet bitrate= 238.2kbits/s dup=90 drop=0 speed=0.66x     
[rtsp @ 0x7925c0] RTP: missed 217 packets
[h264 @ 0x969450] error while decoding MB 18 19, bytestream -14
[h264 @ 0x969450] concealing 5911 DC, 5911 AC, 5911 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet bitrate= 255.8kbits/s dup=90 drop=0 speed=0.658x    
[rtsp @ 0x7925c0] RTP: missed 17 packets
[h264 @ 0x969450] error while decoding MB 4 48, bytestream -6
[h264 @ 0x969450] concealing 2445 DC, 2445 AC, 2445 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 11 packets
[h264 @ 0x850330] error while decoding MB 65 56, bytestream -11rate= 190.0kbits/s dup=119 drop=0 speed=0.739x    
[h264 @ 0x850330] concealing 1424 DC, 1424 AC, 1424 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet bitrate= 175.0kbits/s dup=124 drop=0 speed=0.744x    
[rtsp @ 0x7925c0] RTP: missed 173 packets
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 75 packets
[h264 @ 0x969450] error while decoding MB 10 54, bytestream -22
[h264 @ 0x969450] concealing 1719 DC, 1719 AC, 1719 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet bitrate= 206.8kbits/s dup=124 drop=0 speed=0.732x    
[rtsp @ 0x7925c0] RTP: missed 6 packets
[h264 @ 0x91b640] error while decoding MB 4 58, bytestream -14
[h264 @ 0x91b640] concealing 1245 DC, 1245 AC, 1245 MV errors in I frame
[h264 @ 0x850330] error while decoding MB 10 58, bytestream -16
[h264 @ 0x850330] concealing 1239 DC, 1239 AC, 1239 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet bitrate= 171.2kbits/s dup=152 drop=0 speed=0.754x    
[rtsp @ 0x7925c0] RTP: missed 138 packets
[h264 @ 0x868850] error while decoding MB 108 54, bytestream -6
[h264 @ 0x868850] concealing 1621 DC, 1621 AC, 1621 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 11 packets
[h264 @ 0x91b640] error while decoding MB 9 54, bytestream -5
[h264 @ 0x91b640] concealing 1720 DC, 1720 AC, 1720 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet bitrate= 172.4kbits/s dup=152 drop=0 speed=0.716x    
[rtsp @ 0x7925c0] RTP: missed 53 packets
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 67 packets
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 73 packets
frame=  245 fps= 20 q=-1.0 Lsize=     283kB time=00:00:09.68 bitrate= 239.5kbits/s dup=152 drop=0 speed=0.788x    
video:256kB audio:22kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.833363%
[libx264 @ 0x7f27f0] frame I:1     Avg QP:20.97  size: 22962
[libx264 @ 0x7f27f0] frame P:62    Avg QP:20.52  size:  3543
[libx264 @ 0x7f27f0] frame B:182   Avg QP:29.92  size:   103
[libx264 @ 0x7f27f0] consecutive B-frames:  0.4%  0.8%  2.4% 96.3%
[libx264 @ 0x7f27f0] mb I  I16..4: 25.7% 43.2% 31.1%
[libx264 @ 0x7f27f0] mb P  I16..4:  1.0%  1.7%  0.3%  P16..4: 18.0%  6.9%  5.0%  0.0%  0.0%    skip:67.1%
[libx264 @ 0x7f27f0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  9.0%  0.1%  0.0%  direct: 0.0%  skip:90.9%  L0:48.1% L1:51.0% BI: 0.9%
[libx264 @ 0x7f27f0] 8x8 transform intra:52.8% inter:51.6%
[libx264 @ 0x7f27f0] coded y,uvDC,uvAC intra: 46.5% 0.0% 0.0% inter: 4.0% 0.0% 0.0%
[libx264 @ 0x7f27f0] i16 v,h,dc,p: 17% 24%  6% 53%
[libx264 @ 0x7f27f0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 33% 23% 29%  3%  1%  2%  2%  4%  3%
[libx264 @ 0x7f27f0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 38% 20% 19%  3%  3%  4%  4%  4%  4%
[libx264 @ 0x7f27f0] i8c dc,h,v,p: 100%  0%  0%  0%
[libx264 @ 0x7f27f0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7f27f0] ref P L0: 64.1%  7.4% 14.0% 14.5%
[libx264 @ 0x7f27f0] ref B L0: 86.5% 11.0%  2.5%
[libx264 @ 0x7f27f0] ref B L1: 96.8%  3.2%
[libx264 @ 0x7f27f0] kb/s:213.31
[aac @ 0x8082b0] Qavg: 61570.793
Quand j'essaye la même commande avec un iMac, je n'ai pas ces messages d'erreurs. D'où ma conclusion qu'il est à genoux.
=> Comment as tu réussi à alléger sa tâche ?
Merci pour votre aide !

Re: video par mail

Publié : 20 juin 2019, 22:23
par kassor
Tryphon a écrit : 14 juin 2019, 08:40 Bonjour à tous,
Kassor, merci pour ton partage.
Perso je cherche à faire quelque chose de similaire, mais mon Rapsberry PI 3+ est à genoux.
J'utilise la commande suivante :

Code : Tout sélectionner

/usr/bin/ffmpeg -i "rtsp://login:mdp@ADR_IP/11" -t 10 -vcodec h264 -s 640x480 -y essai.mp4
Mais j'ai les messages suivants :

Code : Tout sélectionner

Input #0, rtsp, from 'rtsp://login:mdp@ADR_IP/11':
  Metadata:
    title           : 10
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080, 25 tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
[swscaler @ 0x8187e0] deprecated pixel format used, make sure you did set range correctly
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x7f27f0] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x7f27f0] profile High, level 3.0
[libx264 @ 0x7f27f0] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - 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=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[aac @ 0x8082b0] Too many bits 8832.000000 > 6144 per frame requested, clamping to max
Output #0, mp4, to 'essai.mp4':
  Metadata:
    title           : 10
    encoder         : Lavf57.56.101
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p(pc), 640x480, q=-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.64.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 8000 Hz, mono, fltp, 48 kb/s
    Metadata:
      encoder         : Lavc57.64.101 aac
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (pcm_alaw (native) -> aac (native))
Press [q] to stop, [?] for help
[rtsp @ 0x7925c0] max delay reached. need to consume packetbitrate=   0.0kbits/s dup=1 drop=0 speed=0.589x    
[rtsp @ 0x7925c0] RTP: missed 266 packets
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 9 packets
[h264 @ 0x91b640] error while decoding MB 18 58, bytestream -6
[h264 @ 0x91b640] concealing 1231 DC, 1231 AC, 1231 MV errors in I frame
[h264 @ 0x868850] Increasing reorder buffer to 1
[h264 @ 0x850330] error while decoding MB 12 58, bytestream -10
[h264 @ 0x850330] concealing 1237 DC, 1237 AC, 1237 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet bitrate= 487.2kbits/s dup=45 drop=0 speed=0.461x    
[rtsp @ 0x7925c0] RTP: missed 238 packets
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 39 packets
[h264 @ 0x91b640] error while decoding MB 18 58, bytestream -6
[h264 @ 0x91b640] concealing 1231 DC, 1231 AC, 1231 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 42 packets
[h264 @ 0x850330] error while decoding MB 48 59, bytestream -12
[h264 @ 0x850330] concealing 1081 DC, 1081 AC, 1081 MV errors in I frame
[h264 @ 0x969450] error while decoding MB 29 55, bytestream -7
[h264 @ 0x969450] concealing 1580 DC, 1580 AC, 1580 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet bitrate= 238.2kbits/s dup=90 drop=0 speed=0.66x     
[rtsp @ 0x7925c0] RTP: missed 217 packets
[h264 @ 0x969450] error while decoding MB 18 19, bytestream -14
[h264 @ 0x969450] concealing 5911 DC, 5911 AC, 5911 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet bitrate= 255.8kbits/s dup=90 drop=0 speed=0.658x    
[rtsp @ 0x7925c0] RTP: missed 17 packets
[h264 @ 0x969450] error while decoding MB 4 48, bytestream -6
[h264 @ 0x969450] concealing 2445 DC, 2445 AC, 2445 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 11 packets
[h264 @ 0x850330] error while decoding MB 65 56, bytestream -11rate= 190.0kbits/s dup=119 drop=0 speed=0.739x    
[h264 @ 0x850330] concealing 1424 DC, 1424 AC, 1424 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet bitrate= 175.0kbits/s dup=124 drop=0 speed=0.744x    
[rtsp @ 0x7925c0] RTP: missed 173 packets
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 75 packets
[h264 @ 0x969450] error while decoding MB 10 54, bytestream -22
[h264 @ 0x969450] concealing 1719 DC, 1719 AC, 1719 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet bitrate= 206.8kbits/s dup=124 drop=0 speed=0.732x    
[rtsp @ 0x7925c0] RTP: missed 6 packets
[h264 @ 0x91b640] error while decoding MB 4 58, bytestream -14
[h264 @ 0x91b640] concealing 1245 DC, 1245 AC, 1245 MV errors in I frame
[h264 @ 0x850330] error while decoding MB 10 58, bytestream -16
[h264 @ 0x850330] concealing 1239 DC, 1239 AC, 1239 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet bitrate= 171.2kbits/s dup=152 drop=0 speed=0.754x    
[rtsp @ 0x7925c0] RTP: missed 138 packets
[h264 @ 0x868850] error while decoding MB 108 54, bytestream -6
[h264 @ 0x868850] concealing 1621 DC, 1621 AC, 1621 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 11 packets
[h264 @ 0x91b640] error while decoding MB 9 54, bytestream -5
[h264 @ 0x91b640] concealing 1720 DC, 1720 AC, 1720 MV errors in I frame
[rtsp @ 0x7925c0] max delay reached. need to consume packet bitrate= 172.4kbits/s dup=152 drop=0 speed=0.716x    
[rtsp @ 0x7925c0] RTP: missed 53 packets
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 67 packets
[rtsp @ 0x7925c0] max delay reached. need to consume packet
[rtsp @ 0x7925c0] RTP: missed 73 packets
frame=  245 fps= 20 q=-1.0 Lsize=     283kB time=00:00:09.68 bitrate= 239.5kbits/s dup=152 drop=0 speed=0.788x    
video:256kB audio:22kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.833363%
[libx264 @ 0x7f27f0] frame I:1     Avg QP:20.97  size: 22962
[libx264 @ 0x7f27f0] frame P:62    Avg QP:20.52  size:  3543
[libx264 @ 0x7f27f0] frame B:182   Avg QP:29.92  size:   103
[libx264 @ 0x7f27f0] consecutive B-frames:  0.4%  0.8%  2.4% 96.3%
[libx264 @ 0x7f27f0] mb I  I16..4: 25.7% 43.2% 31.1%
[libx264 @ 0x7f27f0] mb P  I16..4:  1.0%  1.7%  0.3%  P16..4: 18.0%  6.9%  5.0%  0.0%  0.0%    skip:67.1%
[libx264 @ 0x7f27f0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  9.0%  0.1%  0.0%  direct: 0.0%  skip:90.9%  L0:48.1% L1:51.0% BI: 0.9%
[libx264 @ 0x7f27f0] 8x8 transform intra:52.8% inter:51.6%
[libx264 @ 0x7f27f0] coded y,uvDC,uvAC intra: 46.5% 0.0% 0.0% inter: 4.0% 0.0% 0.0%
[libx264 @ 0x7f27f0] i16 v,h,dc,p: 17% 24%  6% 53%
[libx264 @ 0x7f27f0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 33% 23% 29%  3%  1%  2%  2%  4%  3%
[libx264 @ 0x7f27f0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 38% 20% 19%  3%  3%  4%  4%  4%  4%
[libx264 @ 0x7f27f0] i8c dc,h,v,p: 100%  0%  0%  0%
[libx264 @ 0x7f27f0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7f27f0] ref P L0: 64.1%  7.4% 14.0% 14.5%
[libx264 @ 0x7f27f0] ref B L0: 86.5% 11.0%  2.5%
[libx264 @ 0x7f27f0] ref B L1: 96.8%  3.2%
[libx264 @ 0x7f27f0] kb/s:213.31
[aac @ 0x8082b0] Qavg: 61570.793
Quand j'essaye la même commande avec un iMac, je n'ai pas ces messages d'erreurs. D'où ma conclusion qu'il est à genoux.
=> Comment as tu réussi à alléger sa tâche ?
Merci pour votre aide !
Bonjour Tryphon,
Ce que je comprends de tes logs au vu de la commande passée sur ton rpi, c'est qu'il est fort probable que ta version de ffmpeg soit différente et n'a donc pas la même interprétation des paramètres.
Donc à mon avis elle se lance avec pleins de paramètres par défaut. Le résultat étant que tu n'obtiens pas la vidéo attendue.
Ta machine n'est donc pas forcément à genoux selon moi.

Ce qui m'a mis la puce à l'oreille, c'est par exemple le paramètre "-t 10" qui dans ma version gère la durée de la vidéo, alors que dans ton log le "-t" semble correspondre au "title". Idem pour le paramètre résolution "-s 640x480" qui ne semble pas supporté par ta version. Aussi, ta commande souhaite que tu lui précise le bitrate j'ai l'impression.

Bref, je t'invite à lancer la commande "man ffmpeg" sur ton rpi pour contrôler tous les paramètres (durée, résolution, codec, etc.) et à adapter la ligne de commande.
Petit à petit et à force d'essais, tu ne devrais plus avoir d'erreurs sur ton log et obtenir ton fameux "essai.mp4". :D

Bon courage.