
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (66)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (7274)
-
FFMPEG : RTSP re-stream dies randomly
14 mai 2018, par stevendesuI have a security camera streaming RTSP, and I wish to re-stream this to an RTMP ingest server. For now I’m using my laptop as an ffmpeg proxy, but eventually I’ll use a raspberry pi or something similar (cheap/small)
Here’s the command I’m using (pretty simple) :
ffmpeg -i rtsp://@10.0.0.16:554/1/h264major -c:v libx264 -c:a none -f flv rtmp://output/camera_stream
This works but after a minute or two the stream dies. Here’s the output :
ffmpeg version N-90057-g7c82e0f Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.6) 20160609
configuration: --prefix=/home/sbarnett/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/sbarnett/ffmpeg_build/include --extra-ldflags=-L/home/sbarnett/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/sbarnett/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libspeex --enable-nonfree
libavutil 56. 7.101 / 56. 7.101
libavcodec 58. 11.101 / 58. 11.101
libavformat 58. 9.100 / 58. 9.100
libavdevice 58. 1.100 / 58. 1.100
libavfilter 7. 12.100 / 7. 12.100
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
Input #0, rtsp, from 'rtsp://@10.0.0.16:554/1/h264major':
Metadata:
title : h264major
comment : h264major
Duration: N/A, start: 0.360000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 720x480, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x38843c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x38843c0] profile High, level 3.0
[libx264 @ 0x38843c0] 264 - core 155 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - 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
Output #0, flv, to 'rtmp://output/camera_stream':
Metadata:
title : h264major
comment : h264major
encoder : Lavf58.9.100
Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuvj420p(pc), 720x480, q=-1--1, 25 fps, 1k tbn, 25 tbc
Metadata:
encoder : Lavc58.11.101 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Past duration 0.999992 too large
Last message repeated 29 times
[rtsp @ 0x3847600] max delay reached. need to consume packet
[rtsp @ 0x3847600] RTP: missed 48 packets
Past duration 0.999992 too large
Last message repeated 4 times
frame= 44 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A dup=0 drop=5 speed= 0x
frame= 57 fps= 54 q=28.0 size= 43kB time=00:00:00.16 bitrate=2186.4kbits/s dup=0 drop=5 speed=0.153x
... (lots of similar messages) ...
frame= 1163 fps= 26 q=28.0 size= 1341kB time=00:00:44.84 bitrate= 245.0kbits/s dup=0 drop=5 speed=0.99x
frame= 1177 fps= 26 q=28.0 size= 1353kB time=00:00:45.40 bitrate= 244.2kbits/s dup=0 drop=5 speed=0.99x
[rtsp @ 0x3847600] max delay reached. need to consume packet
[rtsp @ 0x3847600] RTP: missed 2 packets
frame= 1190 fps= 26 q=28.0 size= 1370kB time=00:00:45.92 bitrate= 244.4kbits/s dup=0 drop=5 speed=0.99x
[h264 @ 0x38c08c0] Increasing reorder buffer to 1
frame= 1201 fps= 26 q=28.0 size= 1381kB time=00:00:46.36 bitrate= 244.0kbits/s dup=0 drop=5 speed=0.989x
frame= 1214 fps= 26 q=28.0 size= 1393kB time=00:00:46.88 bitrate= 243.4kbits/s dup=0 drop=5 speed=0.989x
... (lots of similar messages) ...
frame= 1761 fps= 25 q=28.0 size= 2030kB time=00:01:08.80 bitrate= 241.7kbits/s dup=0 drop=5 speed=0.993x
frame= 1774 fps= 25 q=28.0 size= 2041kB time=00:01:09.32 bitrate= 241.2kbits/s dup=0 drop=5 speed=0.993x
[flv @ 0x3884900] Failed to update header with correct duration.
[flv @ 0x3884900] Failed to update header with correct filesize.
frame= 1782 fps= 25 q=-1.0 Lsize= 2127kB time=00:01:11.64 bitrate= 243.2kbits/s dup=0 drop=5 speed=1.02x
video:2092kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.679417%
[libx264 @ 0x38843c0] frame I:8 Avg QP:16.89 size: 42446
[libx264 @ 0x38843c0] frame P:1672 Avg QP:19.54 size: 1065
[libx264 @ 0x38843c0] frame B:102 Avg QP:23.00 size: 205
[libx264 @ 0x38843c0] consecutive B-frames: 92.4% 0.0% 0.0% 7.6%
[libx264 @ 0x38843c0] mb I I16..4: 12.9% 36.2% 50.9%
[libx264 @ 0x38843c0] mb P I16..4: 0.2% 0.2% 0.0% P16..4: 16.7% 0.7% 1.0% 0.0% 0.0% skip:81.1%
[libx264 @ 0x38843c0] mb B I16..4: 0.1% 0.1% 0.0% B16..8: 11.7% 0.1% 0.0% direct: 1.5% skip:86.5% L0:62.2% L1:35.3% BI: 2.5%
[libx264 @ 0x38843c0] 8x8 transform intra:40.8% inter:47.4%
[libx264 @ 0x38843c0] coded y,uvDC,uvAC intra: 46.5% 53.0% 17.2% inter: 3.9% 8.7% 0.0%
[libx264 @ 0x38843c0] i16 v,h,dc,p: 21% 56% 8% 15%
[libx264 @ 0x38843c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 33% 31% 1% 2% 3% 2% 2% 3%
[libx264 @ 0x38843c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 39% 9% 3% 3% 4% 5% 3% 8%
[libx264 @ 0x38843c0] i8c dc,h,v,p: 43% 33% 21% 3%
[libx264 @ 0x38843c0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x38843c0] ref P L0: 88.0% 1.4% 6.6% 4.0%
[libx264 @ 0x38843c0] ref B L0: 99.4% 0.5% 0.1%
[libx264 @ 0x38843c0] ref B L1: 99.4% 0.6%
[libx264 @ 0x38843c0] kb/s:238.73The camera is pretty cheap (from China) so it’s likely I’m getting bad data from it or it’s cutting out for a few seconds at a time. Ideally I would need ffmpeg to handle this well (ignore bad data, wait as long as necessary for good data to resume encoding)
Using
ffplay
to check out the RTSP stream, I get output like the following :$> ffplay -i rtsp://@10.0.0.16:554/1/h264major
ffplay version N-90057-g7c82e0f Copyright (c) 2003-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.6) 20160609
configuration: --prefix=/home/sbarnett/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/sbarnett/ffmpeg_build/include --extra-ldflags=-L/home/sbarnett/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/sbarnett/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libspeex --enable-nonfree
libavutil 56. 7.101 / 56. 7.101
libavcodec 58. 11.101 / 58. 11.101
libavformat 58. 9.100 / 58. 9.100
libavdevice 58. 1.100 / 58. 1.100
libavfilter 7. 12.100 / 7. 12.100
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
Input #0, rtsp, from 'rtsp://@10.0.0.16:554/1/h264major':0B f=0/0
Metadata:
title : h264major
comment : h264major
Duration: N/A, start: 0.320000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 720x480, 25 fps, 25 tbr, 90k tbn, 50 tbc
[swscaler @ 0x7f6bbc093180] deprecated pixel format used, make sure you did set range correctly
[rtsp @ 0x7f6bc0000940] max delay reached. need to consume packet
[rtsp @ 0x7f6bc0000940] RTP: missed 2 packets
[h264 @ 0x7f6bc0041080] error while decoding MB 44 28, bytestream -37
[h264 @ 0x7f6bc0041080] concealing 95 DC, 95 AC, 95 MV errors in I frame
[rtsp @ 0x7f6bc0000940] max delay reached. need to consume packet
[rtsp @ 0x7f6bc0000940] RTP: missed 1 packets
[h264 @ 0x7f6bc0041080] error while decoding MB 43 29, bytestream -49
[h264 @ 0x7f6bc0041080] concealing 51 DC, 51 AC, 51 MV errors in I frame
[rtsp @ 0x7f6bc0000940] max delay reached. need to consume packet
[rtsp @ 0x7f6bc0000940] RTP: missed 2 packets
[h264 @ 0x7f6bc0041080] Increasing reorder buffer to 1
[rtsp @ 0x7f6bc0000940] max delay reached. need to consume packet
[rtsp @ 0x7f6bc0000940] RTP: missed 3 packets
[h264 @ 0x7f6bc02c3600] error while decoding MB 27 29, bytestream -24
[h264 @ 0x7f6bc02c3600] concealing 67 DC, 67 AC, 67 MV errors in I frame
[rtsp @ 0x7f6bc0000940] max delay reached. need to consume packet
[rtsp @ 0x7f6bc0000940] RTP: missed 2 packets
[rtsp @ 0x7f6bc0000940] max delay reached. need to consume packet
[rtsp @ 0x7f6bc0000940] RTP: missed 42 packets
[rtsp @ 0x7f6bc0000940] max delay reached. need to consume packet
[rtsp @ 0x7f6bc0000940] RTP: missed 2 packetsThen eventually the video just freezes. The first time it froze after around 5 minutes, but I wasn’t able to say definitively if it froze the instant 44 packets were dropped or if it froze randomly later. So the second time I stared intently.... for 21 minutes. Then I got bored of it not freezing, turned to pet my cat, and when I looked back 15 seconds later it was frozen. I think it only breaks when no one is watching it.
What I can say definitively is :
- While running normally,
M-V
hovers around 0 (anywhere between-0.01
and+0.01
) - Once frozen,
M-V
begins to count down into negative numbers without stopping - although at a rate slower than-1
per second - While running normally,
aq
is0KB
andvq
is a positive number (I think it was30KB
or so ?) - Once frozen,
vq
is also0KB
It’s a really cheap camera with a crummy power supply that goes out if you breathe on it, so it’s likely the camera is going temporarily offline during this time — but I’d like ffmpeg to wait out a timeout and resume streaming when it sees the camera again.
- While running normally,
-
av_interleaved_write_frame() : Connection reset by peer mjpeg : What is wrong with mjpeg stream, ffserver and ffplay ?
31 décembre 2016, par Ilya YevlampievI’m creating mjpeg stream from image files using ffmpeg and write it to ffserver’s feed :
sudo ffmpeg -loop 1 -i fon.jpeg -vcodec mjpeg -f mjpeg http://localhost:8090/feed1.ffm
ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers
built on Aug 19 2013 23:10:58 with gcc 4.7 (Debian 4.7.2-5)
configuration:
libavutil 52. 38.100 / 52. 38.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.100 / 55. 12.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 79.101 / 3. 79.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
Input #0, image2, from 'fon.jpeg':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p, 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Output #0, mjpeg, to 'http://localhost:8090/feed1.ffm':
Metadata:
encoder : Lavf55.12.100
Stream #0:0: Video: mjpeg, yuvj420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg -> mjpeg)
Press [q] to stop, [?] for helpffserver is configured as
Port 8090
RTSPPort 8594
BindAddress 0.0.0.0
MaxClients 100
MaxBandwidth 20000
NoDaemon
<feed>
File /tmp/feed.ffm
FileMaxSize 3M
</feed>
<stream>
Feed feed.ffm
Format rtsp
VideoCodec mjpeg
VideoFrameRate 30
VideoBufferSize 80000
VideoBitRate 200
VideoQMin 1
VideoQMax 5
VideoSize 1280x720
PreRoll 1
Noaudio
</stream>
<stream>
Feed feed.ffm
Format swf
VideoCodec flv
VideoFrameRate 30
VideoBufferSize 50000
VideoBitRate 100
VideoQMin 1
VideoQMax 5
VideoSize 1280x720
PreRoll 0
Noaudio
</stream>Then I’m trying to retrieve the rtsp stream from the ffserver :
ffplay http://localhost:8090/test.rtsp -loglevel debug
avplay version 0.8.5-6:0.8.5-1, Copyright (c) 2003-2012 the Libav developers
built on Jan 13 2013 12:05:48 with gcc 4.7.2
configuration: --arch=amd64 --enable-pthreads --enable-runtime-cpudetect --extra- version='6:0.8.5-1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-staticavutil configuration : —arch=amd64 —enable-pthreads —enable-runtime-cpudetect —extra-version=’6:0.8.4-1’ —libdir=/usr/lib/x86_64-linux-gnu —prefix=/usr —enable-bzlib —enable-libdc1394 —enable-libdirac —enable-libfreetype —enable-frei0r —enable-gnutls —enable-libgsm —enable-libmp3lame —enable-librtmp —enable-libopencv —enable-libopenjpeg —enable-libpulse —enable-libschroedinger —enable-libspeex —enable-libtheora —enable-vaapi —enable-vdpau —enable-libvorbis —enable-libvpx —enable-zlib —enable-gpl —enable-postproc —enable-swscale —enable-libcdio —enable-x11grab —enable-libx264 —enable-libxvid —shlibdir=/usr/lib/x86_64-linux-gnu —enable-shared —disable-static
avcodec configuration : —arch=amd64 —enable-pthreads —enable-runtime-cpudetect —extra-version=’6:0.8.4-1’ —libdir=/usr/lib/x86_64-linux-gnu —prefix=/usr —enable-bzlib —enable-libdc1394 —enable-libdirac —enable-libfreetype —enable-frei0r —enable-gnutls —enable-libgsm —enable-libmp3lame —enable-librtmp —enable-libopencv —enable-libopenjpeg —enable-libpulse —enable-libschroedinger —enable-libspeex —enable-libtheora —enable-vaapi —enable-vdpau —enable-libvorbis —enable-libvpx —enable-zlib —enable-gpl —enable-postproc —enable-swscale —enable-libcdio —enable-x11grab —enable-libx264 —enable-libxvid —shlibdir=/usr/lib/x86_64-linux-gnu —enable-shared —disable-static
avformat configuration : —arch=amd64 —enable-pthreads —enable-runtime-cpudetect —extra-version=’6:0.8.4-1’ —libdir=/usr/lib/x86_64-linux-gnu —prefix=/usr —enable-bzlib —enable-libdc1394 —enable-libdirac —enable-libfreetype —enable-frei0r —enable-gnutls —enable-libgsm —enable-libmp3lame —enable-librtmp —enable-libopencv —enable-libopenjpeg —enable-libpulse —enable-libschroedinger —enable-libspeex —enable-libtheora —enable-vaapi —enable-vdpau —enable-libvorbis —enable-libvpx —enable-zlib —enable-gpl —enable-postproc —enable-swscale —enable-libcdio —enable-x11grab —enable-libx264 —enable-libxvid —shlibdir=/usr/lib/x86_64-linux-gnu —enable-shared —disable-static
swscale configuration : —arch=amd64 —enable-pthreads —enable-runtime-cpudetect —extra-version=’6:0.8.4-1’ —libdir=/usr/lib/x86_64-linux-gnu —prefix=/usr —enable-bzlib —enable-libdc1394 —enable-libdirac —enable-libfreetype —enable-frei0r —enable-gnutls —enable-libgsm —enable-libmp3lame —enable-librtmp —enable-libopencv —enable-libopenjpeg —enable-libpulse —enable-libschroedinger —enable-libspeex —enable-libtheora —enable-vaapi —enable-vdpau —enable-libvorbis —enable-libvpx —enable-zlib —enable-gpl —enable-postproc —enable-swscale —enable-libcdio —enable-x11grab —enable-libx264 —enable-libxvid —shlibdir=/usr/lib/x86_64-linux-gnu —enable-shared —disable-static
postproc configuration : —arch=amd64 —enable-pthreads —enable-runtime-cpudetect —extra-version=’6:0.8.4-1’ —libdir=/usr/lib/x86_64-linux-gnu —prefix=/usr —enable-bzlib —enable-libdc1394 —enable-libdirac —enable-libfreetype —enable-frei0r —enable-gnutls —enable-libgsm —enable-libmp3lame —enable-librtmp —enable-libopencv —enable-libopenjpeg —enable-libpulse —enable-libschroedinger —enable-libspeex —enable-libtheora —enable-vaapi —enable-vdpau —enable-libvorbis —enable-libvpx —enable-zlib —enable-gpl —enable-postproc —enable-swscale —enable-libcdio —enable-x11grab —enable-libx264 —enable-libxvid —shlibdir=/usr/lib/x86_64-linux-gnu —enable-shared —disable-staticlibavutil 51. 22. 1 / 51. 22. 1
libavcodec 53. 35. 0 / 53. 35. 0
libavformat 53. 21. 1 / 53. 21. 0
libavdevice 53. 2. 0 / 53. 2. 0
libavfilter 2. 15. 0 / 2. 15. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 52. 0. 0 / 52. 0. 0
http://localhost:8090/test.rtsp: Invalid data found when processing inputSo, what is wrong in this streaming example, if I have no problem when I substitute streams to the files ?
I create a mjpeg file using the same parameters 9i.e. file is an output insteadof stream)
sudo ffmpeg -loop 1 -i fon.jpeg -vcodec mjpeg -f mjpeg test.mjpg
ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers
built on Aug 19 2013 23:10:58 with gcc 4.7 (Debian 4.7.2-5)
configuration:
libavutil 52. 38.100 / 52. 38.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.100 / 55. 12.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 79.101 / 3. 79.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
Input #0, image2, from 'fon.jpeg':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p, 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Output #0, mjpeg, to 'test.mjpg':
Metadata:
encoder : Lavf55.12.100
Stream #0:0: Video: mjpeg, yuvj420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg -> mjpeg)
Press [q] to stop, [?] for help
frame= 36 fps=0.0 q=0.0 size= 888kB time=00:00:01.36 bitrate=5349.2kbits/sframe= 78 fps= 76 q=0.0 size= 1711kB time=00:00:03.04 bitrate=4609.9kbits/sframe= 120 fps= 78 q=0.0 size= 2533kB time=00:00:04.72 bitrate=4396.9kbits/sframe= 161 fps= 79 q=0.0 size= 3336kB time=00:00:06.36 bitrate=4297.5kbits/sframe= 202 fps= 79 q=0.0 size= 4139kB
time=00:00:08.00 bitrate=4238.8kbits/sframe= 243 fps= 79 q=0.0 size= 4943kB
time=00:00:09.64 bitrate=4200.1kbits/sframe= 282 fps= 79 q=0.0 size= 5706kB
time=00:00:11.20 bitrate=4173.9kbits/sframe= 321 fps= 79 q=0.0 size= 6470kB
time=00:00:12.76 bitrate=4154.0kbits/sframe= 358 fps= 78 q=0.0 size= 7195kB
time=00:00:14.24 bitrate=4139.2kbits/sframe= 397 fps= 68 q=0.0 size= 7959kB
time=00:00:15.80 bitrate=4126.6kbits/s
[1]+ Stopped sudo ffmpeg -loop 1 -i fon.jpeg -vcodec mjpeg -f mjpeg test.mjpgAnd then I playback this mjpeg file with ffplay. The play back is correct, I see no errors or exceptions.
ffplay test.mjpg
avplay version 0.8.5-6:0.8.5-1, Copyright (c) 2003-2012 the Libav developers
built on Jan 13 2013 12:05:48 with gcc 4.7.2
[mjpeg @ 0x7fc3680008c0] max_analyze_duration reached
[mjpeg @ 0x7fc3680008c0] Estimating duration from bitrate, this may be inaccurate
Input #0, mjpeg, from 'test.mjpg':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: mjpeg, yuvj420p, 1280x720 [PAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1200k tbn, 1200k tbc
[avsink @ 0x7fc360001020] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x7fc360001700] w:1280 h:720 fmt:yuvj420p -> w:1280 h:720 fmt:yuv420p flags:0x4
27.99 A-V: 0.000 s:0.0 aq= 0KB vq= 0KB sq= 0B f=0/0 0/0So, what is the configuration issue for ffserver, or may be it is a bug of the ffserver ?
UPD. I have realized, that i fed file1.ffm instead of file.ffm ; that caused some ffserver problem :
Mon Sep 9 11:43:20 2013 [ffm @ 0x2110000]Format ffm probed with size=2048 and score=101
Mon Sep 9 11:43:20 2013 Deleting feed file 'feed1.ffm' as stream counts differ (1 != 2)
Mon Sep 9 11:43:20 2013 [AVIOContext @ 0x210d660]Statistics: 4096 bytes read, 0 seeks
Mon Sep 9 11:43:20 2013 [AVIOContext @ 0x210a9a0]Statistics: 0 seeks, 1 writeouts
Mon Sep 9 11:43:20 2013 FFserver started.
Mon Sep 9 11:44:18 2013 File '/feed1.ffm' not found
Mon Sep 9 11:44:18 2013 127.0.0.1 - - [POST] "/feed1.ffm HTTP/1.1" 404 149After i set a correct feed, i got another exception on ffmpeg side :
sudo ffmpeg -loop 1 -i fon.jpeg -vcodec mjpeg -f mjpeg http://localhost:8090/feed.ffm
ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers
built on Aug 19 2013 23:10:58 with gcc 4.7 (Debian 4.7.2-5)
configuration:
libavutil 52. 38.100 / 52. 38.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.100 / 55. 12.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 79.101 / 3. 79.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
Input #0, image2, from 'fon.jpeg':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p, 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Output #0, mjpeg, to 'http://localhost:8090/feed.ffm':
Metadata:
encoder : Lavf55.12.100
Stream #0:0: Video: mjpeg, yuvj420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg -> mjpeg)
Press [q] to stop, [?] for help
av_interleaved_write_frame(): Connection reset by peerWhile ffserver shows no error at all :
sudo ffserver -f /etc/ffserver3.conf
ffserver version 2.0 Copyright (c) 2000-2013 the FFmpeg developers
built on Aug 19 2013 23:10:58 with gcc 4.7 (Debian 4.7.2-5)
configuration:
libavutil 52. 38.100 / 52. 38.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.100 / 55. 12.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 79.101 / 3. 79.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
Mon Sep 9 12:08:19 2013 FFserver started.
Mon Sep 9 12:08:40 2013 127.0.0.1 - - [POST] "/feed.ffm HTTP/1.1" 200 4096
Mon Sep 9 12:12:28 2013 127.0.0.1 - - [GET] "/ HTTP/1.1" 200 1847So, what is the problem now ?
-
FFMPEG RGB Lossless conversion video
29 août 2017, par DCDCDCI have been experiencing difficulty in finding many answers with FFMPEG documentation, forums and here.
What I am trying to do is a compress a screen capture video but with just RGB data.
The steps I am currently taking are ;ffmpeg -f avfoundation -pix_fmt 0rgb -r "30" -i "1" -vcodec libx264rgb -pix_fmt rgb24 -crf 0 -t 25 -q 0 -y ~/Desktop/RGB.mkv
south-58-45:~ danielcarter$ ffmpeg -f avfoundation -pix_fmt 0rgb -r "30" -i "1" -vcodec libx264rgb -pix_fmt rgb24 -crf 0 -t 170 -q 0 -y -v info ~/Desktop/output.mkv
ffmpeg version 3.3 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 8.1.0 (clang-802.0.41)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
[avfoundation @ 0x7fc39d004c00] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, avfoundation, from '1':
Duration: N/A, start: 175270.249500, bitrate: N/A
Stream #0:0: Video: rawvideo ([0]RGB / 0x42475200), 0rgb, 1440x900, 1000k tbr, 1000k tbn, 1000k tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264rgb))
Press [q] to stop, [?] for help
[libx264rgb @ 0x7fc39d13ea00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264rgb @ 0x7fc39d13ea00] profile High 4:4:4 Predictive, level 4.0, 4:4:4 8-bit
[libx264rgb @ 0x7fc39d13ea00] 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=0x1:0x111 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
Output #0, matroska, to '/Users/danielcarter/Desktop/output.mkv':
Metadata:
encoder : Lavf57.71.100
Stream #0:0: Video: h264 (libx264rgb) (H264 / 0x34363248), rgb24, 1440x900, q=-1--1, 30 fps, 1k tbn, 30 tbc
Metadata:
encoder : Lavc57.89.100 libx264rgb
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 5100 fps= 30 q=-1.0 Lsize= 12167kB time=00:02:49.96 bitrate= 586.4kbits/s speed=0.999x
video:12134kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.267659%
[libx264rgb @ 0x7fc39d13ea00] frame I:21 Avg QP: 0.00 size:430796
[libx264rgb @ 0x7fc39d13ea00] frame P:5079 Avg QP: 0.00 size: 665
[libx264rgb @ 0x7fc39d13ea00] mb I I16..4: 61.3% 0.0% 38.7%
[libx264rgb @ 0x7fc39d13ea00] mb P I16..4: 0.1% 0.0% 0.0% P16..4: 0.0% 0.0% 0.0% 0.0% 0.0% skip:99.9%
[libx264rgb @ 0x7fc39d13ea00] 8x8 transform intra:0.0% inter:11.2%
[libx264rgb @ 0x7fc39d13ea00] coded y,u,v intra: 48.0% 31.6% 29.0% inter: 0.0% 0.0% 0.0%
[libx264rgb @ 0x7fc39d13ea00] i16 v,h,dc,p: 76% 22% 2% 0%
[libx264rgb @ 0x7fc39d13ea00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 46% 35% 7% 2% 2% 1% 1% 1% 3%
[libx264rgb @ 0x7fc39d13ea00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264rgb @ 0x7fc39d13ea00] ref P L0: 83.1% 6.4% 5.3% 5.2%
[libx264rgb @ 0x7fc39d13ea00] kb/s:584.71This captures the screen on my mac. To the best of my knowledge, this creates a lossless file and I have compared screen shots that confirm this.
The next step is where I think I have an issue.
Because I want to run the compression on raw RGB data I need to convert the MKV to an RGB file ;ffmpeg -i ~/Desktop/RGB.mkv -c:v rawvideo -pix_fmt rgb24 -crf 0 -ss 00:00:03 -to 00:02:01 -q 0 -y ~/Desktop/out.rgb
south-58-45:~ danielcarter$ ffmpeg -i ~/Desktop/output.mkv -c:v rawvideo -pix_fmt rgb24 -crf 0 -ss 00:00:03 -to 00:02:01 -q 0 -y ~/Desktop/out.rgb
ffmpeg version 3.3 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 8.1.0 (clang-802.0.41)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
Input #0, matroska,webm, from '/Users/danielcarter/Desktop/output.mkv':
Metadata:
ENCODER : Lavf57.71.100
Duration: 00:02:50.00, start: 0.000000, bitrate: 586 kb/s
Stream #0:0: Video: h264 (High 4:4:4 Predictive), gbrp(tv, gbr/unknown/unknown, progressive), 1440x900, 30 fps, 30 tbr, 1k tbn, 60 tbc (default)
Metadata:
ENCODER : Lavc57.89.100 libx264rgb
DURATION : 00:02:50.000000000
Codec AVOption crf (Select the quality for constant quality mode) specified for output file #0 (/Users/danielcarter/Desktop/out.rgb) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
Press [q] to stop, [?] for help
Output #0, rawvideo, to '/Users/danielcarter/Desktop/out.rgb':
Metadata:
encoder : Lavf57.71.100
Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1440x900, q=2-31, 933120 kb/s, 30 fps, 30 tbn, 30 tbc (default)
Metadata:
DURATION : 00:02:50.000000000
encoder : Lavc57.89.100 rawvideo
frame= 3540 fps=111 q=-0.0 Lsize=13440938kB time=00:01:58.00 bitrate=933120.0kbits/s speed=3.68x
video:13440938kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%Once I have this I can then compress and decompress successfully. I then get a working file to play back using ;
ffmpeg -f rawvideo -vcodec rawvideo -s 1440x900 -r 30 -pix_fmt rgb24 -i ~/Desktop/out.rgb -c:v libx264rgb -pix_fmt rgb24 -x264opts keyint=300:min-keyint=300:no-scenecut -y -crf 0 ~/Desktop/rgbplay.mkv
south-58-45:~ danielcarter$ ffmpeg -f rawvideo -vcodec rawvideo -s 1440x900 -r 30 -pix_fmt rgb24 -i ~/Desktop/out.rgb -c:v libx264rgb -pix_fmt rgb24 -x264opts keyint=300:min-keyint=300:no-scenecut -y -crf 0 ~/Desktop/rgbplay.mkv
ffmpeg version 3.3 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 8.1.0 (clang-802.0.41)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
[rawvideo @ 0x7fb1f9002600] Estimating duration from bitrate, this may be inaccurate
Input #0, rawvideo, from '/Users/danielcarter/Desktop/out.rgb':
Duration: 00:01:58.00, start: 0.000000, bitrate: 933120 kb/s
Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1440x900, 933120 kb/s, 30 tbr, 30 tbn, 30 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264rgb))
Press [q] to stop, [?] for help
[libx264rgb @ 0x7fb1f9010c00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264rgb @ 0x7fb1f9010c00] profile High 4:4:4 Predictive, level 4.0, 4:4:4 8-bit
[libx264rgb @ 0x7fb1f9010c00] 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=0x1:0x111 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=300 keyint_min=151 scenecut=0 intra_refresh=0 rc=cqp mbtree=0 qp=0
Output #0, matroska, to '/Users/danielcarter/Desktop/rgbplay.mkv':
Metadata:
encoder : Lavf57.71.100
Stream #0:0: Video: h264 (libx264rgb) (H264 / 0x34363248), rgb24, 1440x900, q=-1--1, 30 fps, 1k tbn, 30 tbc
Metadata:
encoder : Lavc57.89.100 libx264rgb
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 3540 fps= 64 q=-1.0 Lsize= 8319kB time=00:01:57.96 bitrate= 577.7kbits/s speed=2.13x
video:8297kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.273154%
[libx264rgb @ 0x7fb1f9010c00] frame I:12 Avg QP: 0.00 size:437670
[libx264rgb @ 0x7fb1f9010c00] frame P:3528 Avg QP: 0.00 size: 919
[libx264rgb @ 0x7fb1f9010c00] mb I I16..4: 61.9% 0.0% 38.1%
[libx264rgb @ 0x7fb1f9010c00] mb P I16..4: 0.1% 0.0% 0.0% P16..4: 0.0% 0.0% 0.0% 0.0% 0.0% skip:99.8%
[libx264rgb @ 0x7fb1f9010c00] 8x8 transform intra:0.0% inter:15.1%
[libx264rgb @ 0x7fb1f9010c00] coded y,u,v intra: 49.7% 36.5% 33.7% inter: 0.0% 0.0% 0.0%
[libx264rgb @ 0x7fb1f9010c00] i16 v,h,dc,p: 73% 25% 1% 0%
[libx264rgb @ 0x7fb1f9010c00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 45% 36% 7% 2% 2% 2% 2% 1% 3%
[libx264rgb @ 0x7fb1f9010c00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264rgb @ 0x7fb1f9010c00] ref P L0: 81.3% 7.7% 6.7% 4.3%
[libx264rgb @ 0x7fb1f9010c00] kb/s:575.96But here I have pixel variance. My guess is there is a RGB-YUV-RGB conversion happening somewhere but I am not smart enough to work out where.
If any of you can help I would forever grateful.Here is a picture of the two stills side by side that shows the differences ;
If you need anything more I can post it also.
Cheers,
DC