Advertisement
gachowy

Untitled

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