Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.62 KB | None | 0 0
  1. ffserver.comf
  2.  
  3. # Port on which the server is listening. You must select a different
  4. # port from your standard HTTP web server if it is running on the same
  5. # computer.
  6. HTTPPort 8090
  7.  
  8. # Address on which the server is bound. Only useful if you have
  9. # several network interfaces.
  10. HTTPBindAddress 0.0.0.0
  11.  
  12. # Number of simultaneous HTTP connections that can be handled. It has
  13. # to be defined *before* the MaxClients parameter, since it defines the
  14. # MaxClients maximum limit.
  15. MaxHTTPConnections 2000
  16.  
  17. # Number of simultaneous requests that can be handled. Since FFServer
  18. # is very fast, it is more likely that you will want to leave this high
  19. # and use MaxBandwidth, below.
  20. MaxClients 1000
  21.  
  22. # This the maximum amount of kbit/sec that you are prepared to
  23. # consume when streaming to clients.
  24. MaxBandwidth 1000
  25.  
  26. # Access log file (uses standard Apache log file format)
  27. # '-' is the standard output.
  28. CustomLog -
  29.  
  30. ##################################################################
  31. # Definition of the live feeds. Each live feed contains one video
  32. # and/or audio sequence coming from an ffmpeg encoder or another
  33. # ffserver. This sequence may be encoded simultaneously with several
  34. # codecs at several resolutions.
  35.  
  36. <Feed feed1.avi>
  37.  
  38. # You must use 'ffmpeg' to send a live feed to ffserver. In this
  39. # example, you can type:
  40. #
  41. # ffmpeg http://localhost:8090/feed1.ffm
  42.  
  43. # ffserver can also do time shifting. It means that it can stream any
  44. # previously recorded live stream. The request should contain:
  45. # "http://xxxx?date=[YYYY-MM-DDT][[HH:]MM:]SS[.m...]".You must specify
  46. # a path where the feed is stored on disk. You also specify the
  47. # maximum size of the feed, where zero means unlimited. Default:
  48. # File=/tmp/feed_name.ffm FileMaxSize=5M
  49. File /tmp/feed1.avi
  50. FileMaxSize 200K
  51.  
  52. # You could specify
  53. # ReadOnlyFile /saved/specialvideo.ffm
  54. # This marks the file as readonly and it will not be deleted or updated.
  55.  
  56. # Specify launch in order to start ffmpeg automatically.
  57. # First ffmpeg must be defined with an appropriate path if needed,
  58. # after that options can follow, but avoid adding the http:// field
  59. #Launch ffmpeg
  60.  
  61. # Only allow connections from localhost to the feed.
  62. ACL deny 127.0.0.0 127.255.255.255
  63.  
  64. </Feed>
  65.  
  66.  
  67. ##################################################################
  68. # Now you can define each stream which will be generated from the
  69. # original audio and video stream. Each format has a filename (here
  70. # 'test1.mpg'). FFServer will send this stream when answering a
  71. # request containing this filename.
  72.  
  73. <Stream test1.mpg>
  74.  
  75. # coming from live feed 'feed1'
  76. Feed feed1.avi
  77.  
  78. # Format of the stream : you can choose among:
  79. # mpeg : MPEG-1 multiplexed video and audio
  80. # mpegvideo : only MPEG-1 video
  81. # mp2 : MPEG-2 audio (use AudioCodec to select layer 2 and 3 codec)
  82. # ogg : Ogg format (Vorbis audio codec)
  83. # rm : RealNetworks-compatible stream. Multiplexed audio and video.
  84. # ra : RealNetworks-compatible stream. Audio only.
  85. # mpjpeg : Multipart JPEG (works with Netscape without any plugin)
  86. # jpeg : Generate a single JPEG image.
  87. # mjpeg : Generate a M-JPEG stream.
  88. # asf : ASF compatible streaming (Windows Media Player format).
  89. # swf : Macromedia Flash compatible stream
  90. # avi : AVI format (MPEG-4 video, MPEG audio sound)
  91. Format mpeg
  92.  
  93. # Bitrate for the audio stream. Codecs usually support only a few
  94. # different bitrates.
  95. AudioBitRate 32
  96.  
  97. # Number of audio channels: 1 = mono, 2 = stereo
  98. AudioChannels 1
  99.  
  100. # Sampling frequency for audio. When using low bitrates, you should
  101. # lower this frequency to 22050 or 11025. The supported frequencies
  102. # depend on the selected audio codec.
  103. AudioSampleRate 44100
  104.  
  105. # Bitrate for the video stream
  106. VideoBitRate 64
  107.  
  108. # Ratecontrol buffer size
  109. VideoBufferSize 40
  110.  
  111. # Number of frames per second
  112. VideoFrameRate 3
  113.  
  114. # Size of the video frame: WxH (default: 160x128)
  115. # The following abbreviations are defined: sqcif, qcif, cif, 4cif, qqvga,
  116. # qvga, vga, svga, xga, uxga, qxga, sxga, qsxga, hsxga, wvga, wxga, wsxga,
  117. # wuxga, woxga, wqsxga, wquxga, whsxga, whuxga, cga, ega, hd480, hd720,
  118. # hd1080
  119. VideoSize 160x128
  120.  
  121. # Transmit only intra frames (useful for low bitrates, but kills frame rate).
  122. #VideoIntraOnly
  123.  
  124. # If non-intra only, an intra frame is transmitted every VideoGopSize
  125. # frames. Video synchronization can only begin at an intra frame.
  126. VideoGopSize 12
  127.  
  128. # More MPEG-4 parameters
  129. # VideoHighQuality
  130. # Video4MotionVector
  131.  
  132. # Choose your codecs:
  133. #AudioCodec mp2
  134. #VideoCodec mpeg1video
  135.  
  136. # Suppress audio
  137. #NoAudio
  138.  
  139. # Suppress video
  140. #NoVideo
  141.  
  142. #VideoQMin 3
  143. #VideoQMax 31
  144.  
  145. # Set this to the number of seconds backwards in time to start. Note that
  146. # most players will buffer 5-10 seconds of video, and also you need to allow
  147. # for a keyframe to appear in the data stream.
  148. #Preroll 15
  149.  
  150. # ACL:
  151.  
  152. # You can allow ranges of addresses (or single addresses)
  153. #ACL ALLOW <first address> <last address>
  154.  
  155. # You can deny ranges of addresses (or single addresses)
  156. #ACL DENY <first address> <last address>
  157.  
  158. # You can repeat the ACL allow/deny as often as you like. It is on a per
  159. # stream basis. The first match defines the action. If there are no matches,
  160. # then the default is the inverse of the last ACL statement.
  161. #
  162. # Thus 'ACL allow localhost' only allows access from localhost.
  163. # 'ACL deny 1.0.0.0 1.255.255.255' would deny the whole of network 1 and
  164. # allow everybody else.
  165.  
  166. </Stream>
  167.  
  168.  
  169. ##################################################################
  170. # Example streams
  171.  
  172.  
  173. # Multipart JPEG
  174.  
  175. #<Stream test.mjpg>
  176. #Feed feed1.ffm
  177. #Format mpjpeg
  178. #VideoFrameRate 2
  179. #VideoIntraOnly
  180. #NoAudio
  181. #Strict -1
  182. #</Stream>
  183.  
  184.  
  185. # Single JPEG
  186.  
  187. #<Stream test.jpg>
  188. #Feed feed1.ffm
  189. #Format jpeg
  190. #VideoFrameRate 2
  191. #VideoIntraOnly
  192. ##VideoSize 352x240
  193. #NoAudio
  194. #Strict -1
  195. #</Stream>
  196.  
  197.  
  198. # Flash
  199.  
  200. #<Stream test.swf>
  201. #Feed feed1.ffm
  202. #Format swf
  203. #VideoFrameRate 2
  204. #VideoIntraOnly
  205. #NoAudio
  206. #</Stream>
  207.  
  208.  
  209. # ASF compatible
  210.  
  211. <Stream test.asf>
  212. Feed feed1.avi
  213. Format asf
  214. VideoFrameRate 15
  215. VideoSize 352x240
  216. VideoBitRate 256
  217. VideoBufferSize 40
  218. VideoGopSize 30
  219. AudioBitRate 64
  220. StartSendOnKey
  221. </Stream>
  222.  
  223.  
  224. # MP3 audio
  225.  
  226. #<Stream test.mp3>
  227. #Feed feed1.ffm
  228. #Format mp2
  229. #AudioCodec mp3
  230. #AudioBitRate 64
  231. #AudioChannels 1
  232. #AudioSampleRate 44100
  233. #NoVideo
  234. #</Stream>
  235.  
  236.  
  237. # Ogg Vorbis audio
  238.  
  239. #<Stream test.ogg>
  240. #Feed feed1.ffm
  241. #Metadata title "Stream title"
  242. #AudioBitRate 64
  243. #AudioChannels 2
  244. #AudioSampleRate 44100
  245. #NoVideo
  246. #</Stream>
  247.  
  248.  
  249. # Real with audio only at 32 kbits
  250.  
  251. #<Stream test.ra>
  252. #Feed feed1.ffm
  253. #Format rm
  254. #AudioBitRate 32
  255. #NoVideo
  256. #NoAudio
  257. #</Stream>
  258.  
  259.  
  260. # Real with audio and video at 64 kbits
  261.  
  262. #<Stream test.rm>
  263. #Feed feed1.ffm
  264. #Format rm
  265. #AudioBitRate 32
  266. #VideoBitRate 128
  267. #VideoFrameRate 25
  268. #VideoGopSize 25
  269. #NoAudio
  270. #</Stream>
  271.  
  272.  
  273. ##################################################################
  274. # A stream coming from a file: you only need to set the input
  275. # filename and optionally a new format. Supported conversions:
  276. # AVI -> ASF
  277.  
  278. #<Stream file.rm>
  279. #File "/usr/local/httpd/htdocs/tlive.rm"
  280. #NoAudio
  281. #</Stream>
  282.  
  283. #<Stream file.asf>
  284. #File "/usr/local/httpd/htdocs/test.asf"
  285. #NoAudio
  286. #Metadata author "Me"
  287. #Metadata copyright "Super MegaCorp"
  288. #Metadata title "Test stream from disk"
  289. #Metadata comment "Test comment"
  290. #</Stream>
  291.  
  292.  
  293. ##################################################################
  294. # RTSP examples
  295. #
  296. # You can access this stream with the RTSP URL:
  297. # rtsp://localhost:5454/test1-rtsp.mpg
  298. #
  299. # A non-standard RTSP redirector is also created. Its URL is:
  300. # http://localhost:8090/test1-rtsp.rtsp
  301.  
  302. #<Stream test1-rtsp.mpg>
  303. #Format rtp
  304. #File "/usr/local/httpd/htdocs/test1.mpg"
  305. #</Stream>
  306.  
  307.  
  308. # Transcode an incoming live feed to another live feed,
  309. # using libx264 and video presets
  310.  
  311. #<Stream live.h264>
  312. #Format rtp
  313. #Feed feed1.ffm
  314. #VideoCodec libx264
  315. #VideoFrameRate 24
  316. #VideoBitRate 100
  317. #VideoSize 480x272
  318. #AVPresetVideo default
  319. #AVPresetVideo baseline
  320. #AVOptionVideo flags +global_header
  321. #
  322. #AudioCodec libfaac
  323. #AudioBitRate 32
  324. #AudioChannels 2
  325. #AudioSampleRate 22050
  326. #AVOptionAudio flags +global_header
  327. #</Stream>
  328.  
  329. ##################################################################
  330. # SDP/multicast examples
  331. #
  332. # If you want to send your stream in multicast, you must set the
  333. # multicast address with MulticastAddress. The port and the TTL can
  334. # also be set.
  335. #
  336. # An SDP file is automatically generated by ffserver by adding the
  337. # 'sdp' extension to the stream name (here
  338. # http://localhost:8090/test1-sdp.sdp). You should usually give this
  339. # file to your player to play the stream.
  340. #
  341. # The 'NoLoop' option can be used to avoid looping when the stream is
  342. # terminated.
  343.  
  344. #<Stream test1-sdp.mpg>
  345. #Format rtp
  346. #File "/usr/local/httpd/htdocs/test1.mpg"
  347. #MulticastAddress 224.124.0.1
  348. #MulticastPort 5000
  349. #MulticastTTL 16
  350. #NoLoop
  351. #</Stream>
  352.  
  353.  
  354. ##################################################################
  355. # Special streams
  356.  
  357. # Server status
  358.  
  359. <Stream stat.html>
  360. Format status
  361.  
  362. # Only allow local people to get the status
  363. ACL allow localhost
  364. ACL allow 192.168.0.0 192.168.255.255
  365.  
  366. #FaviconURL http://pond1.gladstonefamily.net:8080/favicon.ico
  367. </Stream>
  368.  
  369.  
  370. # Redirect index.html to the appropriate site
  371.  
  372. <Redirect index.html>
  373. URL http://www.ffmpeg.org/
  374. </Redirect>
  375.  
  376. ffserver out:
  377.  
  378. stefan@ubuntu:/etc$ ffserver
  379. ffserver version 2.8.6-1ubuntu2 Copyright (c) 2000-2016 the FFmpeg developers
  380. built with gcc 5.3.1 (Ubuntu 5.3.1-11ubuntu1) 20160311
  381. configuration: --prefix=/usr --extra-version=1ubuntu2 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --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-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  382. libavutil 54. 31.100 / 54. 31.100
  383. libavcodec 56. 60.100 / 56. 60.100
  384. libavformat 56. 40.101 / 56. 40.101
  385. libavdevice 56. 4.100 / 56. 4.100
  386. libavfilter 5. 40.101 / 5. 40.101
  387. libavresample 2. 1. 0 / 2. 1. 0
  388. libswscale 3. 1.101 / 3. 1.101
  389. libswresample 1. 2.101 / 1. 2.101
  390. libpostproc 53. 3.100 / 53. 3.100
  391. /etc/ffserver.conf:164: Setting default value for video bit rate tolerance = 21333. Use NoDefaults to disable it.
  392. /etc/ffserver.conf:164: Setting default value for video rate control equation = tex^qComp. Use NoDefaults to disable it.
  393. /etc/ffserver.conf:164: Setting default value for video max rate = 128000. Use NoDefaults to disable it.
  394. /etc/ffserver.conf:219: Setting default value for audio sample rate = 22050. Use NoDefaults to disable it.
  395. /etc/ffserver.conf:219: Setting default value for audio channel count = 1. Use NoDefaults to disable it.
  396. /etc/ffserver.conf:219: Setting default value for video bit rate tolerance = 64000. Use NoDefaults to disable it.
  397. /etc/ffserver.conf:219: Setting default value for video rate control equation = tex^qComp. Use NoDefaults to disable it.
  398. /etc/ffserver.conf:219: Setting default value for video max rate = 512000. Use NoDefaults to disable it.
  399. Fri Apr 22 13:46:25 2016 FFserver started.
  400. Fri Apr 22 13:46:29 2016 File '/feed1.avi' not found
  401. Fri Apr 22 13:46:29 2016 127.0.0.1 - - [POST] "/feed1.avi HTTP/1.1" 404 149
  402.  
  403. ffmpeg out:
  404.  
  405. stefan@ubuntu:~$ ffmpeg -f v4l2 -i /dev/video0 -an http://localhost:8090/feed1.avi
  406. ffmpeg version 2.8.6-1ubuntu2 Copyright (c) 2000-2016 the FFmpeg developers
  407. built with gcc 5.3.1 (Ubuntu 5.3.1-11ubuntu1) 20160311
  408. configuration: --prefix=/usr --extra-version=1ubuntu2 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --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-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  409. libavutil 54. 31.100 / 54. 31.100
  410. libavcodec 56. 60.100 / 56. 60.100
  411. libavformat 56. 40.101 / 56. 40.101
  412. libavdevice 56. 4.100 / 56. 4.100
  413. libavfilter 5. 40.101 / 5. 40.101
  414. libavresample 2. 1. 0 / 2. 1. 0
  415. libswscale 3. 1.101 / 3. 1.101
  416. libswresample 1. 2.101 / 1. 2.101
  417. libpostproc 53. 3.100 / 53. 3.100
  418. Input #0, video4linux2,v4l2, from '/dev/video0':
  419. Duration: N/A, start: 1576.325827, bitrate: 147456 kb/s
  420. Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
  421. [tcp @ 0x72b9c0] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
  422. Output #0, avi, to 'http://localhost:8090/feed1.avi':
  423. Metadata:
  424. ISFT : Lavf56.40.101
  425. Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 640x480, q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc
  426. Metadata:
  427. encoder : Lavc56.60.100 mpeg4
  428. Stream mapping:
  429. Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg4 (native))
  430. Press [q] to stop, [?] for help
  431. av_interleaved_write_frame(): Broken pipe
  432. frame= 1 fps=0.0 q=5.2 Lsize= 18kB time=00:00:00.03 bitrate=4544.2kbits/s
  433. video:17kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 7.311267%
  434. Conversion failed!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement