
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 (12)
-
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...)
Sur d’autres sites (6846)
-
FFMPEG : How to chose a stream from all stream
3 mars 2016, par combo_ciI try to convert a UDP stream (that genrated from DVB signal) to HLS m3u8 file with this code :
ffmpeg -i udp://239.1.2.1:60001 -acodec aac -strict -2 -vcodec libx264 -hls_wrap 100 -f hls /var/www/html/ts/1.m3u8
UDP stream contain 1 channel (in this case IRIB-TV1).
When i run this code ffmpeg detect all of service and channel that streamed from DVB card with this message :
Input #0, mpegts, from 'udp://239.1.2.1:60001':
Duration: N/A, start: 77906.812644, bitrate: N/A
Program 101
Metadata:
service_name : IRIB-TV1
service_provider: IRIB
Stream #0:0[0x3f2]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x3f3](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp
Program 102
Metadata:
service_name : IRIB-TV2
service_provider: IRIB
Program 103
Metadata:
service_name : IRIB-TV3
service_provider: IRIB
Program 104
Metadata:
service_name : IRIB-TV4
service_provider: IRIBAs you see ffmpeg finf 4 channel in UDP stream, But VLC play only channel 1(IRIB-TV1).
Now i have have 2 question :
1-Can I get all channel and service via this ffmpeg code ?
2-Can i choose a spesial stream from this ffmpeg code ?(i know that ffmpeg can choose a stream with -map otion but i want to choose other service_name that in output log)
output file is :
ffmpeg version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2000-2014 the FFmpeg developers
built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened --extra-cflags= --extra-cxxflags= --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libx264 --enable-libsoxr --enable-openal --enable-libopencv
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1.100
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-timeout' ... matched as AVOption 'timeout' with argument '6000000'.
Reading option '-i' ... matched as input file with argument 'udp://239.1.2.1:60001?fifo_size=50000'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'copy'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'copy'.
Reading option '-preset' ... matched as AVOption 'preset' with argument 'ultrafast'.
Reading option '-flags' ... matched as AVOption 'flags' with argument '-global_header'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'hls'.
Reading option '-hls_time' ... matched as AVOption 'hls_time' with argument '20'.
Reading option '-hls_wrap' ... matched as AVOption 'hls_wrap' with argument '5'.
Reading option '/var/www/html/ts/1.m3u8' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file udp://239.1.2.1:60001?fifo_size=50000.
Successfully parsed a group of options.
Opening an input file: udp://239.1.2.1:60001?fifo_size=50000.
[udp @ 0x1967040] end receive buffer size reported is 131072
[mpegts @ 0x1977380] Format mpegts probed with size=2048 and score=100
[mpegts @ 0x1977380] stream=0 stream_type=1b pid=3f2 prog_reg_desc=
[mpegts @ 0x1977380] stream=1 stream_type=11 pid=3f3 prog_reg_desc=
[mpegts @ 0x1977380] Before avformat_find_stream_info() pos: 0 bytes read:14476 seeks:0
[mpegts @ 0x1977380] parser not found for codec none, packets or times may be invalid.
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[mpegts @ 0x1977380] probing stream 1 pp:2500
[mpegts @ 0x1977380] Probe with size=853, packets=1 detected loas with score=51
[mpegts @ 0x1977380] probed stream 1
[aac_latm @ 0x199e4e0] initializing latmctx
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x199cc60] decode_slice_header error
[h264 @ 0x199cc60] no frame!
[h264 @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
[h264 @ 0x199cc60] Frame num gap 397 393
[h264 @ 0x199cc60] Frame num gap 397 394
[h264 @ 0x199cc60] Frame num gap 397 395
[h264 @ 0x199cc60] mmco: unref short failure
Last message repeated 1 times
[h264 @ 0x199cc60] number of reference frames (0+4) exceeds max (3; probably corrupt input), discarding one
[h264 @ 0x199cc60] no picture ooo
[h264 @ 0x199cc60] Increasing reorder buffer to 2
[h264 @ 0x199cc60] no picture ooo
Last message repeated 1 times
[h264 @ 0x199cc60] no picture
Last message repeated 1 times
[h264 @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
Last message repeated 3 times
[mpegts @ 0x1977380] max_analyze_duration 5000000 reached at 5034667 microseconds
[mpegts @ 0x1977380] After avformat_find_stream_info() pos: 1142476 bytes read:1143604 seeks:0 frames:397
Input #0, mpegts, from 'udp://239.1.2.1:60001?fifo_size=50000':
Duration: N/A, start: 43581.024200, bitrate: N/A
Program 101
Metadata:
service_name : IRIB-TV1
service_provider: IRIB
Stream #0:0[0x3f2], 274, 1/90000: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg), 720x576 [SAR 12:11 DAR 15:11], 1/50, 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x3f3](per), 123, 1/90000: Audio: aac_latm ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp
Program 102
Metadata:
service_name : IRIB-TV2
service_provider: IRIB
Program 103
Metadata:
service_name : IRIB-TV3
service_provider: IRIB
Program 104
Metadata:
service_name : IRIB-TV4
service_provider: IRIB
Program 105
Metadata:
service_name : IRIB-TV5
service_provider: IRIB
Program 106
Metadata:
service_name : IRINN
service_provider: IRIB
Program 107
Metadata:
service_name : AMOOZESH
service_provider: IRIB
Program 108
Metadata:
service_name : QURAN
service_provider: IRIB
Program 119
Metadata:
service_name : SALAMAT
service_provider: IRIB
Program 120
Metadata:
service_name : NASIM
service_provider: IRIB
Program 151
Metadata:
service_name : RADIO IRAN
service_provider: IRIB
Program 152
Metadata:
service_name : RADIO PAYAM
service_provider: IRIB
Program 153
Metadata:
service_name : RADIO JAVAN
service_provider: IRIB
Program 154
Metadata:
service_name : RADIO MAAREF
service_provider: IRIB
Program 155
Metadata:
service_name : RADIO QURAN
service_provider: IRIB
Program 156
Metadata:
service_name : RADIO FARHANG
service_provider: IRIB
Program 157
Metadata:
service_name : RADIO SALAMAT
service_provider: IRIB
Program 158
Metadata:
service_name : RADIO VARZESH
service_provider: IRIB
Program 159
Metadata:
service_name : RADIO EGHTESAD
service_provider: IRIB
Program 160
Metadata:
service_name : RADIO TEHRAN
service_provider: IRIB
Program 161
Metadata:
service_name : RADIO AVAA
service_provider: IRIB
Program 162
Metadata:
service_name : RADIO NAMAYESH
service_provider: IRIB
Program 163
Metadata:
service_name : RADIO SABA
service_provider: IRIB
Program 164
Metadata:
service_name : English Radio World Service
service_provider: IRIB
Program 166
Metadata:
service_name : Arabic Radio World Service
service_provider: IRIB
Program 167
Metadata:
service_name : RADIO BAHARAN
service_provider: IRIB
Program 169
Metadata:
service_name : RADIO TELAVAT
service_provider: IRIB
Program 170
Metadata:
service_name : RADIO GOFTEGO
service_provider: IRIB
Successfully opened the file.
Parsing a group of options: output file /var/www/html/ts/1.m3u8.
Applying option acodec (force audio codec ('copy' to copy stream)) with argument copy.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument copy.
Applying option f (force format) with argument hls.
Successfully parsed a group of options.
Opening an output file: /var/www/html/ts/1.m3u8.
Successfully opened the file.
[mpegts @ 0x1967180] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
Last message repeated 1 times
[mpegts @ 0x1967180] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt every 40 pkts
Output #0, hls, to '/var/www/html/ts/1.m3u8':
Metadata:
encoder : Lavf56.4.101
Stream #0:0, 0, 1/90000: Video: h264 ([27][0][0][0] / 0x001B), yuv420p, 720x576 [SAR 12:11 DAR 15:11], 1/25, q=2-31, 25 fps, 90k tbn, 25 tbc
Stream #0:1(per), 0, 1/90000: Audio: aac_latm ([17][0][0][0] / 0x0011), 48000 Hz, stereo
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
[NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
[NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
[NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
[NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
[NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
[NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
[NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
[NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
[NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
[NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
[AVIOContext @ 0x19a9860] Statistics: 0 seeks, 896 writeouts=N/A
[hls @ 0x1a65ca0] EXT-X-MEDIA-SEQUENCE:0
[AVIOContext @ 0x1d162e0] Statistics: 0 seeks, 1 writeouts
[AVIOContext @ 0x1966b40] Statistics: 0 seeks, 27 writeouts
[hls @ 0x1a65ca0] EXT-X-MEDIA-SEQUENCE:0
[AVIOContext @ 0x199b7a0] Statistics: 0 seeks, 1 writeouts
frame= 826 fps= 69 q=-1.0 Lsize=N/A time=00:00:20.63 bitrate=N/A
video:2611kB audio:68kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (udp://239.1.2.1:60001?fifo_size=50000):
Input stream #0:0 (video): 872 packets read (2779202 bytes);
Input stream #0:1 (audio): 405 packets read (69222 bytes);
Total: 1277 packets (2848424 bytes) demuxed
Output file #0 (/var/www/html/ts/1.m3u8):
Output stream #0:0 (video): 826 packets muxed (2673485 bytes);
Output stream #0:1 (audio): 405 packets muxed (69222 bytes);
Total: 1231 packets (2742707 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x1967ce0] Statistics: 3884832 bytes read, 0 seeks
Received signal 2: terminating. -
Chrome’s New Audio Notifier
30 janvier 2014, par Multimedia Mike — GeneralVersion 32 of Google’s Chrome web browser introduced this nifty feature :
When a browser tab has an element that is producing audio, the browser’s tab shows the above audio notification icon to inform the user. I have seen that people have a few questions about this, specifically :
- How does this feature work ?
- Why wasn’t this done sooner ?
- Are other browsers going to follow suit ?
Short answers : 1) Chrome offers a new plugin API that the Flash Player is now using, as are Chrome’s internal media playing facilities ; 2) this feature was contingent on the new plugin infrastructure mentioned in the previous answer ; 3) other browsers would require the same infrastructure support.
Longer answers follow…
Plugin History
Plugins were originally based on the Netscape Plugin API. This was developed in the early 1990s in order to support embedding PDFs into the Netscape web browser. The NPAPI does things like providing graphics contexts for drawing and input processing, and mediate network requests through the browser’s network facilities.What NPAPI doesn’t do is handle audio. In the early-mid 1990s, audio support was not a widespread consideration in the consumer PC arena. Due to the lack of audio API support, if a plugin wanted to play audio, it had to go outside of the plugin framework.
There are a few downsides to this approach :
- If a plugin wants to play audio, it needs to access unique audio APIs on each supported platform. One of the most famous things I’ve ever written deals concerns this nightmare on Linux. (The picture worth a thousand words.)
- Plugin necessarily needs free unrestricted access to system facilities, i.e., security measures like sandboxing become more difficult without restricting functionality.
- Since the browser doesn’t mediate access to the audio APIs, the browser can’t reasonably be expected to know when a plugin is accessing the audio resources.
So that last item hopefully answers the question of why it has been so difficult for NPAPI-supporting browsers to implement what seems like it would be simple functionality, like implementing a per-tab audio notifier.
Plugin Future
Since Google released Chrome in an effort to facilitate advancements on the client side of the internet, they have made numerous efforts to modernize various legacy aspects of web technology. These efforts include the SPDY protocol, Native Client, WebM/WebP, and something call the Pepper Plugin API (PPAPI). This is a more modern take on the classic plugin architecture to supplant the aging NPAPI :
Right away, we see that the job of the plugin writer is greatly simplified. Where was this API years ago when I was writing my API jungle piece ?
The Linux version of Chrome was apparently the first version that packaged the Pepper version of the Flash Player (doing so fixed an obnoxious bug in the Linux Flash Player interaction with GTK). Now, it looks like Windows and Mac have followed suit. Digging into the Chrome directory on a Windows 7 installation :
AppData\Local\Google\Chrome\Application[version]\PepperFlash\pepflashplayer.dll
This directory exists for version 31 as well, which is still hanging around my system.
So, to re-iterate : Chrome has a new plugin API that plugins use to access the audio API. Chrome knows when the API is accessed and that allows the browser to display the audio notifier on a tab.
Other Browsers
What about other browsers ? “Mozilla is not interested in or working on Pepper at this time. See the Chrome Pepper pages.” -
FFmpeg : avconv and ffserver - connection reset by peer
5 mars 2016, par einsAI’m trying to stream a video via ffserver. My dev environment is a Raspberry Pi 2.
I’m getting an
av_interleaved_write_frame(): Connection reset by peer
with the following approach :pi@raspberrypi:/opt/livefeed $ avconv -f mjpeg -i movie.mjpg -r 20 -b 2000k -vcodec libx264 -preset ultrafast -f flv -metadata streamName="mjpeg_to_flv" -metadata title="converting mjpeg to flv via avconv" http://localhost:8090/feed1.ffm
avconv version 11.4-6:11.4-1~deb8u1+rpi1, Copyright (c) 2000-2014 the Libav developers
built on Jun 16 2015 05:32:34 with gcc 4.9.2 (Raspbian 4.9.2-10)
[mjpeg @ 0x20461e0] Estimating duration from bitrate, this may be inaccurate
Input #0, mjpeg, from 'movie.mjpg':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: mjpeg, yuvj422p, 768x512, 25 fps, 25 tbn
[tcp @ 0x2050bc0] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
[libx264 @ 0x20501a0] using cpu capabilities: none!
[libx264 @ 0x20501a0] profile Constrained Baseline, level 3.0
[libx264 @ 0x20501a0] 264 - core 142 r2431 a5831aa - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 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=0 keyint=250 keyint_min=20 scenecut=0 intra_refresh=0 rc=abr mbtree=0 bitrate=2000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, flv, to 'http://localhost:8090/feed1.ffm':
Metadata:
streamName : mjpeg_to_flv
title : converting mjpeg to flv via avconv
encoder : Lavf56.1.0
Stream #0.0: Video: libx264, yuv420p, 768x512, q=-1--1, 2000 kb/s, 20 fps, 1k tbn, 20 tbc
Metadata:
encoder : Lavc56.1.0 libx264
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press ctrl-c to stop encoding
av_interleaved_write_frame(): Connection reset by peer0000.00 bitrate= 0.0kbits/s
I am able to stream the file doing it step by step with the following settings and commands :
ffserver
ffserver config :
pi@raspberrypi:/opt/livefeed $ cat ffserver_flv.conf
# FLV live feed
Port 8090
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
CustomLog -
<stream>
Format status
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255
</stream>
<feed>
File /tmp/feed_flv.ffm
FileMaxSize 1G
ACL allow 127.0.0.1
</feed>
<stream>
Format flv
Feed feed1.ffm
VideoCodec libx264
VideoFrameRate 30
VideoBitRate 800
VideoSize 720x576
AVOptionVideo crf 23
AVOptionVideo preset medium
AVOptionVideo me_range 16
AVOptionVideo qdiff 4
AVOptionVideo qmin 10
AVOptionVideo qmax 51
AVOptionVideo flags +global_header
NoAudio
</stream>starting the server with :
pi@raspberrypi:/opt/livefeed $ ffserver -v debug -f ffserver_flv.conf
ffserver version N-78909-gfb2f164 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree --enable-libass --enable-libfaac --enable-libmp3lame --enable-libfreetype
libavutil 55. 19.100 / 55. 19.100
libavcodec 57. 27.101 / 57. 27.101
libavformat 57. 28.100 / 57. 28.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 39.100 / 6. 39.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
ffserver_flv.conf:6: Port option is deprecated. Use HTTPPort instead.
ffserver_flv.conf:7: BindAddress option is deprecated. Use HTTPBindAddress instead.
ffserver_flv.conf:48: Setting default value for video bit rate tolerance = 200000. Use NoDefaults to disable it.
ffserver_flv.conf:48: Setting default value for video rate control equation = tex^qComp. Use NoDefaults to disable it.
ffserver_flv.conf:48: Setting default value for video max rate = 49537952. Use NoDefaults to disable it.
ffserver_flv.conf:48: Setting default value for video buffer size = 1600000. Use NoDefaults to disable it.
Sat Mar 5 13:29:46 2016 [file @ 0x2f3d0d0]Setting default whitelist 'file'
Sat Mar 5 13:29:46 2016 [ffm @ 0x2f40bc0]Format ffm probed with size=2048 and score=101
Sat Mar 5 13:29:46 2016 [NULL @ 0x2f43760]Setting entry with key 'time_base' to value '1/30'
Sat Mar 5 13:29:46 2016 [NULL @ 0x2f43760]Setting entry with key 'b' to value '800000'
Sat Mar 5 13:29:46 2016 [NULL @ 0x2f43760]Setting entry with key 'video_size' to value '720x576'
Sat Mar 5 13:29:46 2016 [NULL @ 0x2f43760]Setting entry with key 'me_range' to value '16'
Sat Mar 5 13:29:46 2016 [NULL @ 0x2f43760]Setting entry with key 'qdiff' to value '4'
Sat Mar 5 13:29:46 2016 [NULL @ 0x2f43760]Setting entry with key 'qmin' to value '10'
Sat Mar 5 13:29:46 2016 [NULL @ 0x2f43760]Setting entry with key 'qmax' to value '51'
Sat Mar 5 13:29:46 2016 [NULL @ 0x2f43760]Setting entry with key 'flags' to value '+global_header'
Sat Mar 5 13:29:46 2016 [NULL @ 0x2f43760]Setting entry with key 'bt' to value '200000'
Sat Mar 5 13:29:46 2016 [NULL @ 0x2f43760]Setting entry with key 'rc_eq' to value 'tex^qComp'
Sat Mar 5 13:29:46 2016 [NULL @ 0x2f43760]Setting entry with key 'maxrate' to value '1600000'
Sat Mar 5 13:29:46 2016 [NULL @ 0x2f43760]Setting entry with key 'bufsize' to value '1600000'
Sat Mar 5 13:29:46 2016 [AVIOContext @ 0x2f41450]Statistics: 32768 bytes read, 0 seeks
Sat Mar 5 13:29:46 2016 FFserver started.avconv
I’m converting a
mjpeg
movie (movie.mjpeg
) viaavconv
to flv (movie.flv
) :pi@raspberrypi:/opt/livefeed $ avconv -f mjpeg -i movie.mjpg -r 20 -b 2000k -vcodec libx264 -preset ultrafast -f flv -metadata streamName="mjpeg_to_flv" -metadata title="converting mjpeg to flv via avconv" movie.flv
avconv version 11.4-6:11.4-1~deb8u1+rpi1, Copyright (c) 2000-2014 the Libav developers
built on Jun 16 2015 05:32:34 with gcc 4.9.2 (Raspbian 4.9.2-10)
[mjpeg @ 0x34f1e0] Estimating duration from bitrate, this may be inaccurate
Input #0, mjpeg, from 'movie.mjpg':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: mjpeg, yuvj422p, 768x512, 25 fps, 25 tbn
[libx264 @ 0x3591a0] using cpu capabilities: none!
[libx264 @ 0x3591a0] profile Constrained Baseline, level 3.0
[libx264 @ 0x3591a0] 264 - core 142 r2431 a5831aa - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 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=0 keyint=250 keyint_min=20 scenecut=0 intra_refresh=0 rc=abr mbtree=0 bitrate=2000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, flv, to 'movie.flv':
Metadata:
streamName : mjpeg_to_flv
title : converting mjpeg to flv via avconv
encoder : Lavf56.1.0
Stream #0.0: Video: libx264, yuv420p, 768x512, q=-1--1, 2000 kb/s, 20 fps, 1k tbn, 20 tbc
Metadata:
encoder : Lavc56.1.0 libx264
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press ctrl-c to stop encoding
frame= 93 fps= 9 q=-1.0 Lsize= 1078kB time=4.60 bitrate=1919.3kbits/s ts/s
video:1076kB audio:0kB other streams:0kB global headers:0kB muxing overhead: 0.201471%
[libx264 @ 0x3591a0] frame I:1 Avg QP:19.00 size: 35978
[libx264 @ 0x3591a0] frame P:92 Avg QP:21.43 size: 11574
[libx264 @ 0x3591a0] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 @ 0x3591a0] mb P I16..4: 25.9% 0.0% 0.0% P16..4: 53.6% 0.0% 0.0% 0.0% 0.0% skip:20.5%
[libx264 @ 0x3591a0] final ratefactor: 20.82
[libx264 @ 0x3591a0] coded y,uvDC,uvAC intra: 28.9% 46.9% 18.2% inter: 33.7% 39.8% 2.8%
[libx264 @ 0x3591a0] i16 v,h,dc,p: 29% 30% 28% 14%
[libx264 @ 0x3591a0] i8c dc,h,v,p: 53% 26% 15% 7%
[libx264 @ 0x3591a0] kb/s:1893.82send flv to ffserver
pi@raspberrypi:/opt/livefeed $ ffmpeg -stream_loop -1 -i movie.flv http://localhost:8090/feed1.ffm
ffmpeg version N-78909-gfb2f164 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree --enable-libass --enable-libfaac --enable-libmp3lame --enable-libfreetype
libavutil 55. 19.100 / 55. 19.100
libavcodec 57. 27.101 / 57. 27.101
libavformat 57. 28.100 / 57. 28.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 39.100 / 6. 39.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, flv, from 'movie.flv':
Metadata:
streamName : mjpeg_to_flv
title : converting mjpeg to flv via avconv
encoder : Lavf56.1.0
Duration: 00:00:04.65, start: 0.000000, bitrate: 1898 kb/s
Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 768x512, 2000 kb/s, 20 fps, 20 tbr, 1k tbn, 40 tbc
[tcp @ 0x30d2920] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
[tcp @ 0x329a080] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
[libx264 @ 0x325fb30] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x325fb30] profile High, level 3.1
[libx264 @ 0x325fb30] 264 - core 148 r2665 a01e339 - 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=10 qpmax=51 qpstep=4 vbv_maxrate=1600 vbv_bufsize=1600 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, ffm, to 'http://localhost:8090/feed1.ffm':
Metadata:
streamName : mjpeg_to_flv
title : converting mjpeg to flv via avconv
creation_time : now
encoder : Lavf57.28.100
Stream #0:0: Video: h264 (libx264), yuv420p, 720x576, q=10-51, 800 kb/s, 20 fps, 1000k tbn, 30 tbc
Metadata:
encoder : Lavc57.27.101 libx264
Side data:
cpb: bitrate max/min/avg: 1600000/0/800000 buffer size: 1600000 vbv_delay: -1
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
Past duration 0.999992 too large
Last message repeated 2 times
Past duration 0.999992 too large 4kB time=00:00:00.00 bitrate=N/A dup=5 drop=0 speed= 0x
Last message repeated 3 times
Past duration 0.999992 too large 4kB time=00:00:00.00 bitrate=N/A dup=9 drop=0 speed=
[croped]
video:968kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.719636%
[libx264 @ 0x325fb30] frame I:11 Avg QP:22.49 size: 13888
[libx264 @ 0x325fb30] frame P:487 Avg QP:16.10 size: 1382
[libx264 @ 0x325fb30] frame B:980 Avg QP:21.31 size: 168
[libx264 @ 0x325fb30] consecutive B-frames: 11.0% 1.8% 0.4% 86.9%
[libx264 @ 0x325fb30] mb I I16..4: 11.5% 81.2% 7.3%
[libx264 @ 0x325fb30] mb P I16..4: 1.6% 5.0% 0.2% P16..4: 12.0% 1.6% 0.7% 0.0% 0.0% skip:79.0%
[libx264 @ 0x325fb30] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 5.8% 0.1% 0.0% direct: 0.0% skip:94.1% L0:55.3% L1:44.4% BI: 0.3%
[libx264 @ 0x325fb30] 8x8 transform intra:75.4% inter:88.7%
[libx264 @ 0x325fb30] coded y,uvDC,uvAC intra: 38.6% 48.2% 14.9% inter: 1.5% 2.3% 0.0%
[libx264 @ 0x325fb30] i16 v,h,dc,p: 28% 32% 11% 28%
[libx264 @ 0x325fb30] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 21% 31% 3% 4% 4% 4% 4% 4%
[libx264 @ 0x325fb30] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 25% 23% 4% 7% 5% 7% 4% 3%
[libx264 @ 0x325fb30] i8c dc,h,v,p: 63% 20% 14% 4%
[libx264 @ 0x325fb30] Weighted P-Frames: Y:1.6% UV:1.2%
[libx264 @ 0x325fb30] ref P L0: 67.5% 11.6% 13.8% 6.8% 0.3%
[libx264 @ 0x325fb30] ref B L0: 58.7% 40.4% 0.9%
[libx264 @ 0x325fb30] ref B L1: 96.2% 3.8%
[libx264 @ 0x325fb30] kb/s:160.83
Exiting normally, received signal 2.On another machine I can open the flv-stream via VLC by opening the address
http://ip.running.ffserver:8090/live.flv
.So why does it works step by step via the movie.flv file and not directly ?
What is the difference between
-
avconv -f mjpeg -i movie.mjpg -r 20 -b 2000k -vcodec libx264 -preset ultrafast -f flv -metadata streamName="mjpeg_to_flv" -metadata title="converting mjpeg to flv via avconv" movie.flv
followed by
ffmpeg -stream_loop -1 -i movie.flv http://localhost:8090/feed1.ffm
and -
avconv -f mjpeg -i movie.mjpg -r 20 -b 2000k -vcodec libx264 -preset ultrafast -f flv -metadata streamName="mjpeg_to_flv" -metadata title="converting mjpeg to flv via avconv" http://localhost:8090/feed1.ffm
? Why ends this command with aav_interleaved_write_frame(): Connection reset by peer
?
Informations and logs
-
ffserver log (both times) :
Sat Mar 5 13:54:08 2016 127.0.0.1 - - [POST] "/feed1.ffm HTTP/1.1" 200 4096
-
ffserver version
pi@raspberrypi:/opt/livefeed $ ffserver -version
ffserver version N-78909-gfb2f164 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree --enable-libass --enable-libfaac --enable-libmp3lame --enable-libfreetype
libavutil 55. 19.100 / 55. 19.100
libavcodec 57. 27.101 / 57. 27.101
libavformat 57. 28.100 / 57. 28.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 39.100 / 6. 39.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100 -
ffmpeg version
pi@raspberrypi:/opt/livefeed $ ffmpeg -version
ffmpeg version N-78909-gfb2f164 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree --enable-libass --enable-libfaac --enable-libmp3lame --enable-libfreetype
libavutil 55. 19.100 / 55. 19.100
libavcodec 57. 27.101 / 57. 27.101
libavformat 57. 28.100 / 57. 28.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 39.100 / 6. 39.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100 -
avconv version :
pi@raspberrypi:/opt/livefeed $ avconv -version
avconv version 11.4-6:11.4-1~deb8u1+rpi1, Copyright (c) 2000-2014 the Libav developers
built on Jun 16 2015 05:32:34 with gcc 4.9.2 (Raspbian 4.9.2-10)
avconv 11.4-6:11.4-1~deb8u1+rpi1
libavutil 54. 3. 0 / 54. 3. 0
libavcodec 56. 1. 0 / 56. 1. 0
libavformat 56. 1. 0 / 56. 1. 0
libavdevice 55. 0. 0 / 55. 0. 0
libavfilter 5. 0. 0 / 5. 0. 0
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 0. 0 / 3. 0. 0
Thanks and cheers
Clemens
-