/usr/share/doc/ffmpeg/manual/ffserver.html is in ffmpeg-doc 7:2.8.6-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.1, http://www.gnu.org/software/texinfo/ -->
<head>
<meta charset="utf-8">
<title>
ffserver Documentation
</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="style.min.css">
</head>
<body>
<div style="width: 95%; margin: auto">
<h1>
ffserver Documentation
</h1>
<div align="center">
</div>
<a name="SEC_Top"></a>
<a name="SEC_Contents"></a>
<h2 class="contents-heading">Table of Contents</h2>
<div class="contents">
<ul class="no-bullet">
<li><a name="toc-Synopsis" href="#Synopsis">1 Synopsis</a></li>
<li><a name="toc-Description" href="#Description">2 Description</a></li>
<li><a name="toc-Detailed-description" href="#Detailed-description">3 Detailed description</a>
<ul class="no-bullet">
<li><a name="toc-FFM_002c-FFM2-formats" href="#FFM_002c-FFM2-formats">3.1 FFM, FFM2 formats</a></li>
<li><a name="toc-Status-stream" href="#Status-stream">3.2 Status stream</a></li>
<li><a name="toc-How-do-I-make-it-work_003f" href="#How-do-I-make-it-work_003f">3.3 How do I make it work?</a></li>
<li><a name="toc-What-else-can-it-do_003f" href="#What-else-can-it-do_003f">3.4 What else can it do?</a></li>
<li><a name="toc-Tips" href="#Tips">3.5 Tips</a></li>
<li><a name="toc-Why-does-the-_003fbuffer-_002f-Preroll-stop-working-after-a-time_003f" href="#Why-does-the-_003fbuffer-_002f-Preroll-stop-working-after-a-time_003f">3.6 Why does the ?buffer / Preroll stop working after a time?</a></li>
<li><a name="toc-Does-the-_003fdate_003d-stuff-work_002e" href="#Does-the-_003fdate_003d-stuff-work_002e">3.7 Does the <code>?date=</code> stuff work.</a></li>
</ul></li>
<li><a name="toc-Options" href="#Options">4 Options</a>
<ul class="no-bullet">
<li><a name="toc-Stream-specifiers-1" href="#Stream-specifiers-1">4.1 Stream specifiers</a></li>
<li><a name="toc-Generic-options" href="#Generic-options">4.2 Generic options</a></li>
<li><a name="toc-AVOptions" href="#AVOptions">4.3 AVOptions</a></li>
<li><a name="toc-Main-options" href="#Main-options">4.4 Main options</a></li>
</ul></li>
<li><a name="toc-Configuration-file-syntax" href="#Configuration-file-syntax">5 Configuration file syntax</a>
<ul class="no-bullet">
<li><a name="toc-ACL-syntax" href="#ACL-syntax">5.1 ACL syntax</a></li>
<li><a name="toc-Global-options" href="#Global-options">5.2 Global options</a></li>
<li><a name="toc-Feed-section" href="#Feed-section">5.3 Feed section</a></li>
<li><a name="toc-Stream-section" href="#Stream-section">5.4 Stream section</a>
<ul class="no-bullet">
<li><a name="toc-Server-status-stream" href="#Server-status-stream">5.4.1 Server status stream</a></li>
</ul></li>
<li><a name="toc-Redirect-section" href="#Redirect-section">5.5 Redirect section</a></li>
</ul></li>
<li><a name="toc-Stream-examples" href="#Stream-examples">6 Stream examples</a></li>
<li><a name="toc-See-Also" href="#See-Also">7 See Also</a></li>
<li><a name="toc-Authors" href="#Authors">8 Authors</a></li>
</ul>
</div>
<a name="Synopsis"></a>
<h2 class="chapter">1 Synopsis<span class="pull-right"><a class="anchor hidden-xs" href="#Synopsis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Synopsis" aria-hidden="true">TOC</a></span></h2>
<p>ffserver [<var>options</var>]
</p>
<a name="Description"></a>
<h2 class="chapter">2 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
<p><code>ffserver</code> is a streaming server for both audio and video.
It supports several live feeds, streaming from files and time shifting
on live feeds. You can seek to positions in the past on each live
feed, provided you specify a big enough feed storage.
</p>
<p><code>ffserver</code> is configured through a configuration file, which
is read at startup. If not explicitly specified, it will read from
<samp>/etc/ffserver.conf</samp>.
</p>
<p><code>ffserver</code> receives prerecorded files or FFM streams from some
<code>ffmpeg</code> instance as input, then streams them over
RTP/RTSP/HTTP.
</p>
<p>An <code>ffserver</code> instance will listen on some port as specified
in the configuration file. You can launch one or more instances of
<code>ffmpeg</code> and send one or more FFM streams to the port where
ffserver is expecting to receive them. Alternately, you can make
<code>ffserver</code> launch such <code>ffmpeg</code> instances at startup.
</p>
<p>Input streams are called feeds, and each one is specified by a
<code><Feed></code> section in the configuration file.
</p>
<p>For each feed you can have different output streams in various
formats, each one specified by a <code><Stream></code> section in the
configuration file.
</p>
<a name="Detailed-description"></a>
<h2 class="chapter">3 Detailed description<span class="pull-right"><a class="anchor hidden-xs" href="#Detailed-description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Detailed-description" aria-hidden="true">TOC</a></span></h2>
<p><code>ffserver</code> works by forwarding streams encoded by
<code>ffmpeg</code>, or pre-recorded streams which are read from disk.
</p>
<p>Precisely, <code>ffserver</code> acts as an HTTP server, accepting POST
requests from <code>ffmpeg</code> to acquire the stream to publish, and
serving RTSP clients or HTTP clients GET requests with the stream
media content.
</p>
<p>A feed is an <a href="#FFM">FFM</a> stream created by <code>ffmpeg</code>, and sent to
a port where <code>ffserver</code> is listening.
</p>
<p>Each feed is identified by a unique name, corresponding to the name
of the resource published on <code>ffserver</code>, and is configured by
a dedicated <code>Feed</code> section in the configuration file.
</p>
<p>The feed publish URL is given by:
</p><div class="example">
<pre class="example">http://<var>ffserver_ip_address</var>:<var>http_port</var>/<var>feed_name</var>
</pre></div>
<p>where <var>ffserver_ip_address</var> is the IP address of the machine where
<code>ffserver</code> is installed, <var>http_port</var> is the port number of
the HTTP server (configured through the <samp>HTTPPort</samp> option), and
<var>feed_name</var> is the name of the corresponding feed defined in the
configuration file.
</p>
<p>Each feed is associated to a file which is stored on disk. This stored
file is used to send pre-recorded data to a player as fast as
possible when new content is added in real-time to the stream.
</p>
<p>A "live-stream" or "stream" is a resource published by
<code>ffserver</code>, and made accessible through the HTTP protocol to
clients.
</p>
<p>A stream can be connected to a feed, or to a file. In the first case,
the published stream is forwarded from the corresponding feed
generated by a running instance of <code>ffmpeg</code>, in the second
case the stream is read from a pre-recorded file.
</p>
<p>Each stream is identified by a unique name, corresponding to the name
of the resource served by <code>ffserver</code>, and is configured by
a dedicated <code>Stream</code> section in the configuration file.
</p>
<p>The stream access HTTP URL is given by:
</p><div class="example">
<pre class="example">http://<var>ffserver_ip_address</var>:<var>http_port</var>/<var>stream_name</var>[<var>options</var>]
</pre></div>
<p>The stream access RTSP URL is given by:
</p><div class="example">
<pre class="example">http://<var>ffserver_ip_address</var>:<var>rtsp_port</var>/<var>stream_name</var>[<var>options</var>]
</pre></div>
<p><var>stream_name</var> is the name of the corresponding stream defined in
the configuration file. <var>options</var> is a list of options specified
after the URL which affects how the stream is served by
<code>ffserver</code>. <var>http_port</var> and <var>rtsp_port</var> are the HTTP
and RTSP ports configured with the options <var>HTTPPort</var> and
<var>RTSPPort</var> respectively.
</p>
<p>In case the stream is associated to a feed, the encoding parameters
must be configured in the stream configuration. They are sent to
<code>ffmpeg</code> when setting up the encoding. This allows
<code>ffserver</code> to define the encoding parameters used by
the <code>ffmpeg</code> encoders.
</p>
<p>The <code>ffmpeg</code> <samp>override_ffserver</samp> commandline option
allows one to override the encoding parameters set by the server.
</p>
<p>Multiple streams can be connected to the same feed.
</p>
<p>For example, you can have a situation described by the following
graph:
</p>
<pre class="verbatim"> _________ __________
| | | |
ffmpeg 1 -----| feed 1 |-----| stream 1 |
\ |_________|\ |__________|
\ \
\ \ __________
\ \ | |
\ \| stream 2 |
\ |__________|
\
\ _________ __________
\ | | | |
\| feed 2 |-----| stream 3 |
|_________| |__________|
_________ __________
| | | |
ffmpeg 2 -----| feed 3 |-----| stream 4 |
|_________| |__________|
_________ __________
| | | |
| file 1 |-----| stream 5 |
|_________| |__________|
</pre>
<a name="FFM"></a><a name="FFM_002c-FFM2-formats"></a>
<h3 class="section">3.1 FFM, FFM2 formats<span class="pull-right"><a class="anchor hidden-xs" href="#FFM_002c-FFM2-formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-FFM_002c-FFM2-formats" aria-hidden="true">TOC</a></span></h3>
<p>FFM and FFM2 are formats used by ffserver. They allow storing a wide variety of
video and audio streams and encoding options, and can store a moving time segment
of an infinite movie or a whole movie.
</p>
<p>FFM is version specific, and there is limited compatibility of FFM files
generated by one version of ffmpeg/ffserver and another version of
ffmpeg/ffserver. It may work but it is not guaranteed to work.
</p>
<p>FFM2 is extensible while maintaining compatibility and should work between
differing versions of tools. FFM2 is the default.
</p>
<a name="Status-stream"></a>
<h3 class="section">3.2 Status stream<span class="pull-right"><a class="anchor hidden-xs" href="#Status-stream" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Status-stream" aria-hidden="true">TOC</a></span></h3>
<p><code>ffserver</code> supports an HTTP interface which exposes the
current status of the server.
</p>
<p>Simply point your browser to the address of the special status stream
specified in the configuration file.
</p>
<p>For example if you have:
</p><div class="example">
<pre class="example"><Stream status.html>
Format status
# Only allow local people to get the status
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255
</Stream>
</pre></div>
<p>then the server will post a page with the status information when
the special stream <samp>status.html</samp> is requested.
</p>
<a name="How-do-I-make-it-work_003f"></a>
<h3 class="section">3.3 How do I make it work?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-make-it-work_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-make-it-work_003f" aria-hidden="true">TOC</a></span></h3>
<p>As a simple test, just run the following two command lines where INPUTFILE
is some file which you can decode with ffmpeg:
</p>
<div class="example">
<pre class="example">ffserver -f doc/ffserver.conf &
ffmpeg -i INPUTFILE http://localhost:8090/feed1.ffm
</pre></div>
<p>At this point you should be able to go to your Windows machine and fire up
Windows Media Player (WMP). Go to Open URL and enter
</p>
<div class="example">
<pre class="example"> http://<linuxbox>:8090/test.asf
</pre></div>
<p>You should (after a short delay) see video and hear audio.
</p>
<p>WARNING: trying to stream test1.mpg doesn’t work with WMP as it tries to
transfer the entire file before starting to play.
The same is true of AVI files.
</p>
<p>You should edit the <samp>ffserver.conf</samp> file to suit your needs (in
terms of frame rates etc). Then install <code>ffserver</code> and
<code>ffmpeg</code>, write a script to start them up, and off you go.
</p>
<a name="What-else-can-it-do_003f"></a>
<h3 class="section">3.4 What else can it do?<span class="pull-right"><a class="anchor hidden-xs" href="#What-else-can-it-do_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-What-else-can-it-do_003f" aria-hidden="true">TOC</a></span></h3>
<p>You can replay video from .ffm files that was recorded earlier.
However, there are a number of caveats, including the fact that the
ffserver parameters must match the original parameters used to record the
file. If they do not, then ffserver deletes the file before recording into it.
(Now that I write this, it seems broken).
</p>
<p>You can fiddle with many of the codec choices and encoding parameters, and
there are a bunch more parameters that you cannot control. Post a message
to the mailing list if there are some ’must have’ parameters. Look in
ffserver.conf for a list of the currently available controls.
</p>
<p>It will automatically generate the ASX or RAM files that are often used
in browsers. These files are actually redirections to the underlying ASF
or RM file. The reason for this is that the browser often fetches the
entire file before starting up the external viewer. The redirection files
are very small and can be transferred quickly. [The stream itself is
often ’infinite’ and thus the browser tries to download it and never
finishes.]
</p>
<a name="Tips"></a>
<h3 class="section">3.5 Tips<span class="pull-right"><a class="anchor hidden-xs" href="#Tips" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Tips" aria-hidden="true">TOC</a></span></h3>
<p>* When you connect to a live stream, most players (WMP, RA, etc) want to
buffer a certain number of seconds of material so that they can display the
signal continuously. However, ffserver (by default) starts sending data
in realtime. This means that there is a pause of a few seconds while the
buffering is being done by the player. The good news is that this can be
cured by adding a ’?buffer=5’ to the end of the URL. This means that the
stream should start 5 seconds in the past – and so the first 5 seconds
of the stream are sent as fast as the network will allow. It will then
slow down to real time. This noticeably improves the startup experience.
</p>
<p>You can also add a ’Preroll 15’ statement into the ffserver.conf that will
add the 15 second prebuffering on all requests that do not otherwise
specify a time. In addition, ffserver will skip frames until a key_frame
is found. This further reduces the startup delay by not transferring data
that will be discarded.
</p>
<a name="Why-does-the-_003fbuffer-_002f-Preroll-stop-working-after-a-time_003f"></a>
<h3 class="section">3.6 Why does the ?buffer / Preroll stop working after a time?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-does-the-_003fbuffer-_002f-Preroll-stop-working-after-a-time_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-does-the-_003fbuffer-_002f-Preroll-stop-working-after-a-time_003f" aria-hidden="true">TOC</a></span></h3>
<p>It turns out that (on my machine at least) the number of frames successfully
grabbed is marginally less than the number that ought to be grabbed. This
means that the timestamp in the encoded data stream gets behind realtime.
This means that if you say ’Preroll 10’, then when the stream gets 10
or more seconds behind, there is no Preroll left.
</p>
<p>Fixing this requires a change in the internals of how timestamps are
handled.
</p>
<a name="Does-the-_003fdate_003d-stuff-work_002e"></a>
<h3 class="section">3.7 Does the <code>?date=</code> stuff work.<span class="pull-right"><a class="anchor hidden-xs" href="#Does-the-_003fdate_003d-stuff-work_002e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Does-the-_003fdate_003d-stuff-work_002e" aria-hidden="true">TOC</a></span></h3>
<p>Yes (subject to the limitation outlined above). Also note that whenever you
start ffserver, it deletes the ffm file (if any parameters have changed),
thus wiping out what you had recorded before.
</p>
<p>The format of the <code>?date=xxxxxx</code> is fairly flexible. You should use one
of the following formats (the ’T’ is literal):
</p>
<div class="example">
<pre class="example">* YYYY-MM-DDTHH:MM:SS (localtime)
* YYYY-MM-DDTHH:MM:SSZ (UTC)
</pre></div>
<p>You can omit the YYYY-MM-DD, and then it refers to the current day. However
note that ‘<samp>?date=16:00:00</samp>’ refers to 16:00 on the current day – this
may be in the future and so is unlikely to be useful.
</p>
<p>You use this by adding the ?date= to the end of the URL for the stream.
For example: ‘<samp>http://localhost:8080/test.asf?date=2002-07-26T23:05:00</samp>’.
</p>
<a name="Options"></a>
<h2 class="chapter">4 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options" aria-hidden="true">TOC</a></span></h2>
<p>All the numerical options, if not specified otherwise, accept a string
representing a number as input, which may be followed by one of the SI
unit prefixes, for example: ’K’, ’M’, or ’G’.
</p>
<p>If ’i’ is appended to the SI unit prefix, the complete prefix will be
interpreted as a unit prefix for binary multiples, which are based on
powers of 1024 instead of powers of 1000. Appending ’B’ to the SI unit
prefix multiplies the value by 8. This allows using, for example:
’KB’, ’MiB’, ’G’ and ’B’ as number suffixes.
</p>
<p>Options which do not take arguments are boolean options, and set the
corresponding value to true. They can be set to false by prefixing
the option name with "no". For example using "-nofoo"
will set the boolean option with name "foo" to false.
</p>
<a name="Stream-specifiers"></a><a name="Stream-specifiers-1"></a>
<h3 class="section">4.1 Stream specifiers<span class="pull-right"><a class="anchor hidden-xs" href="#Stream-specifiers-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Stream-specifiers-1" aria-hidden="true">TOC</a></span></h3>
<p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
are used to precisely specify which stream(s) a given option belongs to.
</p>
<p>A stream specifier is a string generally appended to the option name and
separated from it by a colon. E.g. <code>-codec:a:1 ac3</code> contains the
<code>a:1</code> stream specifier, which matches the second audio stream. Therefore, it
would select the ac3 codec for the second audio stream.
</p>
<p>A stream specifier can match several streams, so that the option is applied to all
of them. E.g. the stream specifier in <code>-b:a 128k</code> matches all audio
streams.
</p>
<p>An empty stream specifier matches all streams. For example, <code>-codec copy</code>
or <code>-codec: copy</code> would copy all the streams without reencoding.
</p>
<p>Possible forms of stream specifiers are:
</p><dl compact="compact">
<dt><samp><var>stream_index</var></samp></dt>
<dd><p>Matches the stream with this index. E.g. <code>-threads:1 4</code> would set the
thread count for the second stream to 4.
</p></dd>
<dt><samp><var>stream_type</var>[:<var>stream_index</var>]</samp></dt>
<dd><p><var>stream_type</var> is one of following: ’v’ or ’V’ for video, ’a’ for audio, ’s’
for subtitle, ’d’ for data, and ’t’ for attachments. ’v’ matches all video
streams, ’V’ only matches video streams which are not attached pictures, video
thumbnails or cover arts. If <var>stream_index</var> is given, then it matches
stream number <var>stream_index</var> of this type. Otherwise, it matches all
streams of this type.
</p></dd>
<dt><samp>p:<var>program_id</var>[:<var>stream_index</var>]</samp></dt>
<dd><p>If <var>stream_index</var> is given, then it matches the stream with number <var>stream_index</var>
in the program with the id <var>program_id</var>. Otherwise, it matches all streams in the
program.
</p></dd>
<dt><samp>#<var>stream_id</var> or i:<var>stream_id</var></samp></dt>
<dd><p>Match the stream by stream id (e.g. PID in MPEG-TS container).
</p></dd>
<dt><samp>m:<var>key</var>[:<var>value</var>]</samp></dt>
<dd><p>Matches streams with the metadata tag <var>key</var> having the specified value. If
<var>value</var> is not given, matches streams that contain the given tag with any
value.
</p></dd>
<dt><samp>u</samp></dt>
<dd><p>Matches streams with usable configuration, the codec must be defined and the
essential information such as video dimension or audio sample rate must be present.
</p>
<p>Note that in <code>ffmpeg</code>, matching by metadata will only work properly for
input files.
</p></dd>
</dl>
<a name="Generic-options"></a>
<h3 class="section">4.2 Generic options<span class="pull-right"><a class="anchor hidden-xs" href="#Generic-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Generic-options" aria-hidden="true">TOC</a></span></h3>
<p>These options are shared amongst the ff* tools.
</p>
<dl compact="compact">
<dt><samp>-L</samp></dt>
<dd><p>Show license.
</p>
</dd>
<dt><samp>-h, -?, -help, --help [<var>arg</var>]</samp></dt>
<dd><p>Show help. An optional parameter may be specified to print help about a specific
item. If no argument is specified, only basic (non advanced) tool
options are shown.
</p>
<p>Possible values of <var>arg</var> are:
</p><dl compact="compact">
<dt><samp>long</samp></dt>
<dd><p>Print advanced tool options in addition to the basic tool options.
</p>
</dd>
<dt><samp>full</samp></dt>
<dd><p>Print complete list of options, including shared and private options
for encoders, decoders, demuxers, muxers, filters, etc.
</p>
</dd>
<dt><samp>decoder=<var>decoder_name</var></samp></dt>
<dd><p>Print detailed information about the decoder named <var>decoder_name</var>. Use the
<samp>-decoders</samp> option to get a list of all decoders.
</p>
</dd>
<dt><samp>encoder=<var>encoder_name</var></samp></dt>
<dd><p>Print detailed information about the encoder named <var>encoder_name</var>. Use the
<samp>-encoders</samp> option to get a list of all encoders.
</p>
</dd>
<dt><samp>demuxer=<var>demuxer_name</var></samp></dt>
<dd><p>Print detailed information about the demuxer named <var>demuxer_name</var>. Use the
<samp>-formats</samp> option to get a list of all demuxers and muxers.
</p>
</dd>
<dt><samp>muxer=<var>muxer_name</var></samp></dt>
<dd><p>Print detailed information about the muxer named <var>muxer_name</var>. Use the
<samp>-formats</samp> option to get a list of all muxers and demuxers.
</p>
</dd>
<dt><samp>filter=<var>filter_name</var></samp></dt>
<dd><p>Print detailed information about the filter name <var>filter_name</var>. Use the
<samp>-filters</samp> option to get a list of all filters.
</p></dd>
</dl>
</dd>
<dt><samp>-version</samp></dt>
<dd><p>Show version.
</p>
</dd>
<dt><samp>-formats</samp></dt>
<dd><p>Show available formats (including devices).
</p>
</dd>
<dt><samp>-devices</samp></dt>
<dd><p>Show available devices.
</p>
</dd>
<dt><samp>-codecs</samp></dt>
<dd><p>Show all codecs known to libavcodec.
</p>
<p>Note that the term ’codec’ is used throughout this documentation as a shortcut
for what is more correctly called a media bitstream format.
</p>
</dd>
<dt><samp>-decoders</samp></dt>
<dd><p>Show available decoders.
</p>
</dd>
<dt><samp>-encoders</samp></dt>
<dd><p>Show all available encoders.
</p>
</dd>
<dt><samp>-bsfs</samp></dt>
<dd><p>Show available bitstream filters.
</p>
</dd>
<dt><samp>-protocols</samp></dt>
<dd><p>Show available protocols.
</p>
</dd>
<dt><samp>-filters</samp></dt>
<dd><p>Show available libavfilter filters.
</p>
</dd>
<dt><samp>-pix_fmts</samp></dt>
<dd><p>Show available pixel formats.
</p>
</dd>
<dt><samp>-sample_fmts</samp></dt>
<dd><p>Show available sample formats.
</p>
</dd>
<dt><samp>-layouts</samp></dt>
<dd><p>Show channel names and standard channel layouts.
</p>
</dd>
<dt><samp>-colors</samp></dt>
<dd><p>Show recognized color names.
</p>
</dd>
<dt><samp>-sources <var>device</var>[,<var>opt1</var>=<var>val1</var>[,<var>opt2</var>=<var>val2</var>]...]</samp></dt>
<dd><p>Show autodetected sources of the intput device.
Some devices may provide system-dependent source names that cannot be autodetected.
The returned list cannot be assumed to be always complete.
</p><div class="example">
<pre class="example">ffmpeg -sources pulse,server=192.168.0.4
</pre></div>
</dd>
<dt><samp>-sinks <var>device</var>[,<var>opt1</var>=<var>val1</var>[,<var>opt2</var>=<var>val2</var>]...]</samp></dt>
<dd><p>Show autodetected sinks of the output device.
Some devices may provide system-dependent sink names that cannot be autodetected.
The returned list cannot be assumed to be always complete.
</p><div class="example">
<pre class="example">ffmpeg -sinks pulse,server=192.168.0.4
</pre></div>
</dd>
<dt><samp>-loglevel [repeat+]<var>loglevel</var> | -v [repeat+]<var>loglevel</var></samp></dt>
<dd><p>Set the logging level used by the library.
Adding "repeat+" indicates that repeated log output should not be compressed
to the first line and the "Last message repeated n times" line will be
omitted. "repeat" can also be used alone.
If "repeat" is used alone, and with no prior loglevel set, the default
loglevel will be used. If multiple loglevel parameters are given, using
’repeat’ will not change the loglevel.
<var>loglevel</var> is a string or a number containing one of the following values:
</p><dl compact="compact">
<dt>‘<samp>quiet, -8</samp>’</dt>
<dd><p>Show nothing at all; be silent.
</p></dd>
<dt>‘<samp>panic, 0</samp>’</dt>
<dd><p>Only show fatal errors which could lead the process to crash, such as
and assert failure. This is not currently used for anything.
</p></dd>
<dt>‘<samp>fatal, 8</samp>’</dt>
<dd><p>Only show fatal errors. These are errors after which the process absolutely
cannot continue after.
</p></dd>
<dt>‘<samp>error, 16</samp>’</dt>
<dd><p>Show all errors, including ones which can be recovered from.
</p></dd>
<dt>‘<samp>warning, 24</samp>’</dt>
<dd><p>Show all warnings and errors. Any message related to possibly
incorrect or unexpected events will be shown.
</p></dd>
<dt>‘<samp>info, 32</samp>’</dt>
<dd><p>Show informative messages during processing. This is in addition to
warnings and errors. This is the default value.
</p></dd>
<dt>‘<samp>verbose, 40</samp>’</dt>
<dd><p>Same as <code>info</code>, except more verbose.
</p></dd>
<dt>‘<samp>debug, 48</samp>’</dt>
<dd><p>Show everything, including debugging information.
</p></dd>
<dt>‘<samp>trace, 56</samp>’</dt>
</dl>
<p>By default the program logs to stderr, if coloring is supported by the
terminal, colors are used to mark errors and warnings. Log coloring
can be disabled setting the environment variable
<code>AV_LOG_FORCE_NOCOLOR</code> or <code>NO_COLOR</code>, or can be forced setting
the environment variable <code>AV_LOG_FORCE_COLOR</code>.
The use of the environment variable <code>NO_COLOR</code> is deprecated and
will be dropped in a following FFmpeg version.
</p>
</dd>
<dt><samp>-report</samp></dt>
<dd><p>Dump full command line and console output to a file named
<code><var>program</var>-<var>YYYYMMDD</var>-<var>HHMMSS</var>.log</code> in the current
directory.
This file can be useful for bug reports.
It also implies <code>-loglevel verbose</code>.
</p>
<p>Setting the environment variable <code>FFREPORT</code> to any value has the
same effect. If the value is a ’:’-separated key=value sequence, these
options will affect the report; option values must be escaped if they
contain special characters or the options delimiter ’:’ (see the
“Quoting and escaping” section in the ffmpeg-utils manual).
</p>
<p>The following options are recognized:
</p><dl compact="compact">
<dt><samp>file</samp></dt>
<dd><p>set the file name to use for the report; <code>%p</code> is expanded to the name
of the program, <code>%t</code> is expanded to a timestamp, <code>%%</code> is expanded
to a plain <code>%</code>
</p></dd>
<dt><samp>level</samp></dt>
<dd><p>set the log verbosity level using a numerical value (see <code>-loglevel</code>).
</p></dd>
</dl>
<p>For example, to output a report to a file named <samp>ffreport.log</samp>
using a log level of <code>32</code> (alias for log level <code>info</code>):
</p>
<div class="example">
<pre class="example">FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
</pre></div>
<p>Errors in parsing the environment variable are not fatal, and will not
appear in the report.
</p>
</dd>
<dt><samp>-hide_banner</samp></dt>
<dd><p>Suppress printing banner.
</p>
<p>All FFmpeg tools will normally show a copyright notice, build options
and library versions. This option can be used to suppress printing
this information.
</p>
</dd>
<dt><samp>-cpuflags flags (<em>global</em>)</samp></dt>
<dd><p>Allows setting and clearing cpu flags. This option is intended
for testing. Do not use it unless you know what you’re doing.
</p><div class="example">
<pre class="example">ffmpeg -cpuflags -sse+mmx ...
ffmpeg -cpuflags mmx ...
ffmpeg -cpuflags 0 ...
</pre></div>
<p>Possible flags for this option are:
</p><dl compact="compact">
<dt>‘<samp>x86</samp>’</dt>
<dd><dl compact="compact">
<dt>‘<samp>mmx</samp>’</dt>
<dt>‘<samp>mmxext</samp>’</dt>
<dt>‘<samp>sse</samp>’</dt>
<dt>‘<samp>sse2</samp>’</dt>
<dt>‘<samp>sse2slow</samp>’</dt>
<dt>‘<samp>sse3</samp>’</dt>
<dt>‘<samp>sse3slow</samp>’</dt>
<dt>‘<samp>ssse3</samp>’</dt>
<dt>‘<samp>atom</samp>’</dt>
<dt>‘<samp>sse4.1</samp>’</dt>
<dt>‘<samp>sse4.2</samp>’</dt>
<dt>‘<samp>avx</samp>’</dt>
<dt>‘<samp>avx2</samp>’</dt>
<dt>‘<samp>xop</samp>’</dt>
<dt>‘<samp>fma3</samp>’</dt>
<dt>‘<samp>fma4</samp>’</dt>
<dt>‘<samp>3dnow</samp>’</dt>
<dt>‘<samp>3dnowext</samp>’</dt>
<dt>‘<samp>bmi1</samp>’</dt>
<dt>‘<samp>bmi2</samp>’</dt>
<dt>‘<samp>cmov</samp>’</dt>
</dl>
</dd>
<dt>‘<samp>ARM</samp>’</dt>
<dd><dl compact="compact">
<dt>‘<samp>armv5te</samp>’</dt>
<dt>‘<samp>armv6</samp>’</dt>
<dt>‘<samp>armv6t2</samp>’</dt>
<dt>‘<samp>vfp</samp>’</dt>
<dt>‘<samp>vfpv3</samp>’</dt>
<dt>‘<samp>neon</samp>’</dt>
<dt>‘<samp>setend</samp>’</dt>
</dl>
</dd>
<dt>‘<samp>AArch64</samp>’</dt>
<dd><dl compact="compact">
<dt>‘<samp>armv8</samp>’</dt>
<dt>‘<samp>vfp</samp>’</dt>
<dt>‘<samp>neon</samp>’</dt>
</dl>
</dd>
<dt>‘<samp>PowerPC</samp>’</dt>
<dd><dl compact="compact">
<dt>‘<samp>altivec</samp>’</dt>
</dl>
</dd>
<dt>‘<samp>Specific Processors</samp>’</dt>
<dd><dl compact="compact">
<dt>‘<samp>pentium2</samp>’</dt>
<dt>‘<samp>pentium3</samp>’</dt>
<dt>‘<samp>pentium4</samp>’</dt>
<dt>‘<samp>k6</samp>’</dt>
<dt>‘<samp>k62</samp>’</dt>
<dt>‘<samp>athlon</samp>’</dt>
<dt>‘<samp>athlonxp</samp>’</dt>
<dt>‘<samp>k8</samp>’</dt>
</dl>
</dd>
</dl>
</dd>
<dt><samp>-opencl_bench</samp></dt>
<dd><p>This option is used to benchmark all available OpenCL devices and print the
results. This option is only available when FFmpeg has been compiled with
<code>--enable-opencl</code>.
</p>
<p>When FFmpeg is configured with <code>--enable-opencl</code>, the options for the
global OpenCL context are set via <samp>-opencl_options</samp>. See the
"OpenCL Options" section in the ffmpeg-utils manual for the complete list of
supported options. Amongst others, these options include the ability to select
a specific platform and device to run the OpenCL code on. By default, FFmpeg
will run on the first device of the first platform. While the options for the
global OpenCL context provide flexibility to the user in selecting the OpenCL
device of their choice, most users would probably want to select the fastest
OpenCL device for their system.
</p>
<p>This option assists the selection of the most efficient configuration by
identifying the appropriate device for the user’s system. The built-in
benchmark is run on all the OpenCL devices and the performance is measured for
each device. The devices in the results list are sorted based on their
performance with the fastest device listed first. The user can subsequently
invoke <code>ffmpeg</code> using the device deemed most appropriate via
<samp>-opencl_options</samp> to obtain the best performance for the OpenCL
accelerated code.
</p>
<p>Typical usage to use the fastest OpenCL device involve the following steps.
</p>
<p>Run the command:
</p><div class="example">
<pre class="example">ffmpeg -opencl_bench
</pre></div>
<p>Note down the platform ID (<var>pidx</var>) and device ID (<var>didx</var>) of the first
i.e. fastest device in the list.
Select the platform and device using the command:
</p><div class="example">
<pre class="example">ffmpeg -opencl_options platform_idx=<var>pidx</var>:device_idx=<var>didx</var> ...
</pre></div>
</dd>
<dt><samp>-opencl_options options (<em>global</em>)</samp></dt>
<dd><p>Set OpenCL environment options. This option is only available when
FFmpeg has been compiled with <code>--enable-opencl</code>.
</p>
<p><var>options</var> must be a list of <var>key</var>=<var>value</var> option pairs
separated by ’:’. See the “OpenCL Options” section in the
ffmpeg-utils manual for the list of supported options.
</p></dd>
</dl>
<a name="AVOptions"></a>
<h3 class="section">4.3 AVOptions<span class="pull-right"><a class="anchor hidden-xs" href="#AVOptions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AVOptions" aria-hidden="true">TOC</a></span></h3>
<p>These options are provided directly by the libavformat, libavdevice and
libavcodec libraries. To see the list of available AVOptions, use the
<samp>-help</samp> option. They are separated into two categories:
</p><dl compact="compact">
<dt><samp>generic</samp></dt>
<dd><p>These options can be set for any container, codec or device. Generic options
are listed under AVFormatContext options for containers/devices and under
AVCodecContext options for codecs.
</p></dd>
<dt><samp>private</samp></dt>
<dd><p>These options are specific to the given container, device or codec. Private
options are listed under their corresponding containers/devices/codecs.
</p></dd>
</dl>
<p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
an MP3 file, use the <samp>id3v2_version</samp> private option of the MP3
muxer:
</p><div class="example">
<pre class="example">ffmpeg -i input.flac -id3v2_version 3 out.mp3
</pre></div>
<p>All codec AVOptions are per-stream, and thus a stream specifier
should be attached to them.
</p>
<p>Note: the <samp>-nooption</samp> syntax cannot be used for boolean
AVOptions, use <samp>-option 0</samp>/<samp>-option 1</samp>.
</p>
<p>Note: the old undocumented way of specifying per-stream AVOptions by
prepending v/a/s to the options name is now obsolete and will be
removed soon.
</p>
<a name="Main-options"></a>
<h3 class="section">4.4 Main options<span class="pull-right"><a class="anchor hidden-xs" href="#Main-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Main-options" aria-hidden="true">TOC</a></span></h3>
<dl compact="compact">
<dt><samp>-f <var>configfile</var></samp></dt>
<dd><p>Read configuration file <samp>configfile</samp>. If not specified it will
read by default from <samp>/etc/ffserver.conf</samp>.
</p>
</dd>
<dt><samp>-n</samp></dt>
<dd><p>Enable no-launch mode. This option disables all the <code>Launch</code>
directives within the various <code><Feed></code> sections. Since
<code>ffserver</code> will not launch any <code>ffmpeg</code> instances, you
will have to launch them manually.
</p>
</dd>
<dt><samp>-d</samp></dt>
<dd><p>Enable debug mode. This option increases log verbosity, and directs
log messages to stdout. When specified, the <samp>CustomLog</samp> option
is ignored.
</p></dd>
</dl>
<a name="Configuration-file-syntax"></a>
<h2 class="chapter">5 Configuration file syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Configuration-file-syntax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Configuration-file-syntax" aria-hidden="true">TOC</a></span></h2>
<p><code>ffserver</code> reads a configuration file containing global
options and settings for each stream and feed.
</p>
<p>The configuration file consists of global options and dedicated
sections, which must be introduced by "<<var>SECTION_NAME</var>
<var>ARGS</var>>" on a separate line and must be terminated by a line in
the form "</<var>SECTION_NAME</var>>". <var>ARGS</var> is optional.
</p>
<p>Currently the following sections are recognized: ‘<samp>Feed</samp>’,
‘<samp>Stream</samp>’, ‘<samp>Redirect</samp>’.
</p>
<p>A line starting with <code>#</code> is ignored and treated as a comment.
</p>
<p>Name of options and sections are case-insensitive.
</p>
<a name="ACL-syntax"></a>
<h3 class="section">5.1 ACL syntax<span class="pull-right"><a class="anchor hidden-xs" href="#ACL-syntax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ACL-syntax" aria-hidden="true">TOC</a></span></h3>
<p>An ACL (Access Control List) specifies the address which are allowed
to access a given stream, or to write a given feed.
</p>
<p>It accepts the folling forms
</p><ul>
<li> Allow/deny access to <var>address</var>.
<div class="example">
<pre class="example">ACL ALLOW <address>
ACL DENY <address>
</pre></div>
</li><li> Allow/deny access to ranges of addresses from <var>first_address</var> to
<var>last_address</var>.
<div class="example">
<pre class="example">ACL ALLOW <first_address> <last_address>
ACL DENY <first_address> <last_address>
</pre></div>
</li></ul>
<p>You can repeat the ACL allow/deny as often as you like. It is on a per
stream basis. The first match defines the action. If there are no matches,
then the default is the inverse of the last ACL statement.
</p>
<p>Thus ’ACL allow localhost’ only allows access from localhost.
’ACL deny 1.0.0.0 1.255.255.255’ would deny the whole of network 1 and
allow everybody else.
</p>
<a name="Global-options"></a>
<h3 class="section">5.2 Global options<span class="pull-right"><a class="anchor hidden-xs" href="#Global-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Global-options" aria-hidden="true">TOC</a></span></h3>
<dl compact="compact">
<dt><samp>HTTPPort <var>port_number</var></samp></dt>
<dt><samp>Port <var>port_number</var></samp></dt>
<dt><samp>RTSPPort <var>port_number</var></samp></dt>
<dd>
<p><var>HTTPPort</var> sets the HTTP server listening TCP port number,
<var>RTSPPort</var> sets the RTSP server listening TCP port number.
</p>
<p><var>Port</var> is the equivalent of <var>HTTPPort</var> and is deprecated.
</p>
<p>You must select a different port from your standard HTTP web server if
it is running on the same computer.
</p>
<p>If not specified, no corresponding server will be created.
</p>
</dd>
<dt><samp>HTTPBindAddress <var>ip_address</var></samp></dt>
<dt><samp>BindAddress <var>ip_address</var></samp></dt>
<dt><samp>RTSPBindAddress <var>ip_address</var></samp></dt>
<dd><p>Set address on which the HTTP/RTSP server is bound. Only useful if you
have several network interfaces.
</p>
<p><var>BindAddress</var> is the equivalent of <var>HTTPBindAddress</var> and is
deprecated.
</p>
</dd>
<dt><samp>MaxHTTPConnections <var>n</var></samp></dt>
<dd><p>Set number of simultaneous HTTP connections that can be handled. It
has to be defined <em>before</em> the <samp>MaxClients</samp> parameter,
since it defines the <samp>MaxClients</samp> maximum limit.
</p>
<p>Default value is 2000.
</p>
</dd>
<dt><samp>MaxClients <var>n</var></samp></dt>
<dd><p>Set number of simultaneous requests that can be handled. Since
<code>ffserver</code> is very fast, it is more likely that you will want
to leave this high and use <samp>MaxBandwidth</samp>.
</p>
<p>Default value is 5.
</p>
</dd>
<dt><samp>MaxBandwidth <var>kbps</var></samp></dt>
<dd><p>Set the maximum amount of kbit/sec that you are prepared to consume
when streaming to clients.
</p>
<p>Default value is 1000.
</p>
</dd>
<dt><samp>CustomLog <var>filename</var></samp></dt>
<dd><p>Set access log file (uses standard Apache log file format). ’-’ is the
standard output.
</p>
<p>If not specified <code>ffserver</code> will produce no log.
</p>
<p>In case the commandline option <samp>-d</samp> is specified this option is
ignored, and the log is written to standard output.
</p>
</dd>
<dt><samp>NoDaemon</samp></dt>
<dd><p>Set no-daemon mode. This option is currently ignored since now
<code>ffserver</code> will always work in no-daemon mode, and is
deprecated.
</p>
</dd>
<dt><samp>UseDefaults</samp></dt>
<dt><samp>NoDefaults</samp></dt>
<dd><p>Control whether default codec options are used for the all streams or not.
Each stream may overwrite this setting for its own. Default is <var>UseDefaults</var>.
The lastest occurrence overrides previous if multiple definitions.
</p></dd>
</dl>
<a name="Feed-section"></a>
<h3 class="section">5.3 Feed section<span class="pull-right"><a class="anchor hidden-xs" href="#Feed-section" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Feed-section" aria-hidden="true">TOC</a></span></h3>
<p>A Feed section defines a feed provided to <code>ffserver</code>.
</p>
<p>Each live feed contains one video and/or audio sequence coming from an
<code>ffmpeg</code> encoder or another <code>ffserver</code>. This sequence
may be encoded simultaneously with several codecs at several
resolutions.
</p>
<p>A feed instance specification is introduced by a line in the form:
</p><div class="example">
<pre class="example"><Feed FEED_FILENAME>
</pre></div>
<p>where <var>FEED_FILENAME</var> specifies the unique name of the FFM stream.
</p>
<p>The following options are recognized within a Feed section.
</p>
<dl compact="compact">
<dt><samp>File <var>filename</var></samp></dt>
<dt><samp>ReadOnlyFile <var>filename</var></samp></dt>
<dd><p>Set the path where the feed file is stored on disk.
</p>
<p>If not specified, the <samp>/tmp/FEED.ffm</samp> is assumed, where
<var>FEED</var> is the feed name.
</p>
<p>If <samp>ReadOnlyFile</samp> is used the file is marked as read-only and
it will not be deleted or updated.
</p>
</dd>
<dt><samp>Truncate</samp></dt>
<dd><p>Truncate the feed file, rather than appending to it. By default
<code>ffserver</code> will append data to the file, until the maximum
file size value is reached (see <samp>FileMaxSize</samp> option).
</p>
</dd>
<dt><samp>FileMaxSize <var>size</var></samp></dt>
<dd><p>Set maximum size of the feed file in bytes. 0 means unlimited. The
postfixes <code>K</code> (2^10), <code>M</code> (2^20), and <code>G</code> (2^30) are
recognized.
</p>
<p>Default value is 5M.
</p>
</dd>
<dt><samp>Launch <var>args</var></samp></dt>
<dd><p>Launch an <code>ffmpeg</code> command when creating <code>ffserver</code>.
</p>
<p><var>args</var> must be a sequence of arguments to be provided to an
<code>ffmpeg</code> instance. The first provided argument is ignored, and
it is replaced by a path with the same dirname of the <code>ffserver</code>
instance, followed by the remaining argument and terminated with a
path corresponding to the feed.
</p>
<p>When the launched process exits, <code>ffserver</code> will launch
another program instance.
</p>
<p>In case you need a more complex <code>ffmpeg</code> configuration,
e.g. if you need to generate multiple FFM feeds with a single
<code>ffmpeg</code> instance, you should launch <code>ffmpeg</code> by hand.
</p>
<p>This option is ignored in case the commandline option <samp>-n</samp> is
specified.
</p>
</dd>
<dt><samp>ACL <var>spec</var></samp></dt>
<dd><p>Specify the list of IP address which are allowed or denied to write
the feed. Multiple ACL options can be specified.
</p></dd>
</dl>
<a name="Stream-section"></a>
<h3 class="section">5.4 Stream section<span class="pull-right"><a class="anchor hidden-xs" href="#Stream-section" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Stream-section" aria-hidden="true">TOC</a></span></h3>
<p>A Stream section defines a stream provided by <code>ffserver</code>, and
identified by a single name.
</p>
<p>The stream is sent when answering a request containing the stream
name.
</p>
<p>A stream section must be introduced by the line:
</p><div class="example">
<pre class="example"><Stream STREAM_NAME>
</pre></div>
<p>where <var>STREAM_NAME</var> specifies the unique name of the stream.
</p>
<p>The following options are recognized within a Stream section.
</p>
<p>Encoding options are marked with the <em>encoding</em> tag, and they are
used to set the encoding parameters, and are mapped to libavcodec
encoding options. Not all encoding options are supported, in
particular it is not possible to set encoder private options. In order
to override the encoding options specified by <code>ffserver</code>, you
can use the <code>ffmpeg</code> <samp>override_ffserver</samp> commandline
option.
</p>
<p>Only one of the <samp>Feed</samp> and <samp>File</samp> options should be set.
</p>
<dl compact="compact">
<dt><samp>Feed <var>feed_name</var></samp></dt>
<dd><p>Set the input feed. <var>feed_name</var> must correspond to an existing
feed defined in a <code>Feed</code> section.
</p>
<p>When this option is set, encoding options are used to setup the
encoding operated by the remote <code>ffmpeg</code> process.
</p>
</dd>
<dt><samp>File <var>filename</var></samp></dt>
<dd><p>Set the filename of the pre-recorded input file to stream.
</p>
<p>When this option is set, encoding options are ignored and the input
file content is re-streamed as is.
</p>
</dd>
<dt><samp>Format <var>format_name</var></samp></dt>
<dd><p>Set the format of the output stream.
</p>
<p>Must be the name of a format recognized by FFmpeg. If set to
‘<samp>status</samp>’, it is treated as a status stream.
</p>
</dd>
<dt><samp>InputFormat <var>format_name</var></samp></dt>
<dd><p>Set input format. If not specified, it is automatically guessed.
</p>
</dd>
<dt><samp>Preroll <var>n</var></samp></dt>
<dd><p>Set this to the number of seconds backwards in time to start. Note that
most players will buffer 5-10 seconds of video, and also you need to allow
for a keyframe to appear in the data stream.
</p>
<p>Default value is 0.
</p>
</dd>
<dt><samp>StartSendOnKey</samp></dt>
<dd><p>Do not send stream until it gets the first key frame. By default
<code>ffserver</code> will send data immediately.
</p>
</dd>
<dt><samp>MaxTime <var>n</var></samp></dt>
<dd><p>Set the number of seconds to run. This value set the maximum duration
of the stream a client will be able to receive.
</p>
<p>A value of 0 means that no limit is set on the stream duration.
</p>
</dd>
<dt><samp>ACL <var>spec</var></samp></dt>
<dd><p>Set ACL for the stream.
</p>
</dd>
<dt><samp>DynamicACL <var>spec</var></samp></dt>
<dt><samp>RTSPOption <var>option</var></samp></dt>
<dt><samp>MulticastAddress <var>address</var></samp></dt>
<dt><samp>MulticastPort <var>port</var></samp></dt>
<dt><samp>MulticastTTL <var>integer</var></samp></dt>
<dt><samp>NoLoop</samp></dt>
<dt><samp>FaviconURL <var>url</var></samp></dt>
<dd><p>Set favicon (favourite icon) for the server status page. It is ignored
for regular streams.
</p>
</dd>
<dt><samp>Author <var>value</var></samp></dt>
<dt><samp>Comment <var>value</var></samp></dt>
<dt><samp>Copyright <var>value</var></samp></dt>
<dt><samp>Title <var>value</var></samp></dt>
<dd><p>Set metadata corresponding to the option. All these options are
deprecated in favor of <samp>Metadata</samp>.
</p>
</dd>
<dt><samp>Metadata <var>key</var> <var>value</var></samp></dt>
<dd><p>Set metadata value on the output stream.
</p>
</dd>
<dt><samp>UseDefaults</samp></dt>
<dt><samp>NoDefaults</samp></dt>
<dd><p>Control whether default codec options are used for the stream or not.
Default is <var>UseDefaults</var> unless disabled globally.
</p>
</dd>
<dt><samp>NoAudio</samp></dt>
<dt><samp>NoVideo</samp></dt>
<dd><p>Suppress audio/video.
</p>
</dd>
<dt><samp>AudioCodec <var>codec_name</var> (<em>encoding,audio</em>)</samp></dt>
<dd><p>Set audio codec.
</p>
</dd>
<dt><samp>AudioBitRate <var>rate</var> (<em>encoding,audio</em>)</samp></dt>
<dd><p>Set bitrate for the audio stream in kbits per second.
</p>
</dd>
<dt><samp>AudioChannels <var>n</var> (<em>encoding,audio</em>)</samp></dt>
<dd><p>Set number of audio channels.
</p>
</dd>
<dt><samp>AudioSampleRate <var>n</var> (<em>encoding,audio</em>)</samp></dt>
<dd><p>Set sampling frequency for audio. When using low bitrates, you should
lower this frequency to 22050 or 11025. The supported frequencies
depend on the selected audio codec.
</p>
</dd>
<dt><samp>AVOptionAudio [<var>codec</var>:]<var>option</var> <var>value</var> (<em>encoding,audio</em>)</samp></dt>
<dd><p>Set generic or private option for audio stream.
Private option must be prefixed with codec name or codec must be defined before.
</p>
</dd>
<dt><samp>AVPresetAudio <var>preset</var> (<em>encoding,audio</em>)</samp></dt>
<dd><p>Set preset for audio stream.
</p>
</dd>
<dt><samp>VideoCodec <var>codec_name</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Set video codec.
</p>
</dd>
<dt><samp>VideoBitRate <var>n</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Set bitrate for the video stream in kbits per second.
</p>
</dd>
<dt><samp>VideoBitRateRange <var>range</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Set video bitrate range.
</p>
<p>A range must be specified in the form <var>minrate</var>-<var>maxrate</var>, and
specifies the <samp>minrate</samp> and <samp>maxrate</samp> encoding options
expressed in kbits per second.
</p>
</dd>
<dt><samp>VideoBitRateRangeTolerance <var>n</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Set video bitrate tolerance in kbits per second.
</p>
</dd>
<dt><samp>PixelFormat <var>pixel_format</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Set video pixel format.
</p>
</dd>
<dt><samp>Debug <var>integer</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Set video <samp>debug</samp> encoding option.
</p>
</dd>
<dt><samp>Strict <var>integer</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Set video <samp>strict</samp> encoding option.
</p>
</dd>
<dt><samp>VideoBufferSize <var>n</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Set ratecontrol buffer size, expressed in KB.
</p>
</dd>
<dt><samp>VideoFrameRate <var>n</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Set number of video frames per second.
</p>
</dd>
<dt><samp>VideoSize (<em>encoding,video</em>)</samp></dt>
<dd><p>Set size of the video frame, must be an abbreviation or in the form
<var>W</var>x<var>H</var>. See <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)the Video size section
in the ffmpeg-utils(1) manual</a>.
</p>
<p>Default value is <code>160x128</code>.
</p>
</dd>
<dt><samp>VideoIntraOnly (<em>encoding,video</em>)</samp></dt>
<dd><p>Transmit only intra frames (useful for low bitrates, but kills frame rate).
</p>
</dd>
<dt><samp>VideoGopSize <var>n</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>If non-intra only, an intra frame is transmitted every VideoGopSize
frames. Video synchronization can only begin at an intra frame.
</p>
</dd>
<dt><samp>VideoTag <var>tag</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Set video tag.
</p>
</dd>
<dt><samp>VideoHighQuality (<em>encoding,video</em>)</samp></dt>
<dt><samp>Video4MotionVector (<em>encoding,video</em>)</samp></dt>
<dt><samp>BitExact (<em>encoding,video</em>)</samp></dt>
<dd><p>Set bitexact encoding flag.
</p>
</dd>
<dt><samp>IdctSimple (<em>encoding,video</em>)</samp></dt>
<dd><p>Set simple IDCT algorithm.
</p>
</dd>
<dt><samp>Qscale <var>n</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Enable constant quality encoding, and set video qscale (quantization
scale) value, expressed in <var>n</var> QP units.
</p>
</dd>
<dt><samp>VideoQMin <var>n</var> (<em>encoding,video</em>)</samp></dt>
<dt><samp>VideoQMax <var>n</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Set video qmin/qmax.
</p>
</dd>
<dt><samp>VideoQDiff <var>integer</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Set video <samp>qdiff</samp> encoding option.
</p>
</dd>
<dt><samp>LumiMask <var>float</var> (<em>encoding,video</em>)</samp></dt>
<dt><samp>DarkMask <var>float</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Set <samp>lumi_mask</samp>/<samp>dark_mask</samp> encoding options.
</p>
</dd>
<dt><samp>AVOptionVideo [<var>codec</var>:]<var>option</var> <var>value</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Set generic or private option for video stream.
Private option must be prefixed with codec name or codec must be defined before.
</p>
</dd>
<dt><samp>AVPresetVideo <var>preset</var> (<em>encoding,video</em>)</samp></dt>
<dd><p>Set preset for video stream.
</p>
<p><var>preset</var> must be the path of a preset file.
</p></dd>
</dl>
<a name="Server-status-stream"></a>
<h4 class="subsection">5.4.1 Server status stream<span class="pull-right"><a class="anchor hidden-xs" href="#Server-status-stream" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Server-status-stream" aria-hidden="true">TOC</a></span></h4>
<p>A server status stream is a special stream which is used to show
statistics about the <code>ffserver</code> operations.
</p>
<p>It must be specified setting the option <samp>Format</samp> to
‘<samp>status</samp>’.
</p>
<a name="Redirect-section"></a>
<h3 class="section">5.5 Redirect section<span class="pull-right"><a class="anchor hidden-xs" href="#Redirect-section" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Redirect-section" aria-hidden="true">TOC</a></span></h3>
<p>A redirect section specifies where to redirect the requested URL to
another page.
</p>
<p>A redirect section must be introduced by the line:
</p><div class="example">
<pre class="example"><Redirect NAME>
</pre></div>
<p>where <var>NAME</var> is the name of the page which should be redirected.
</p>
<p>It only accepts the option <samp>URL</samp>, which specify the redirection
URL.
</p>
<a name="Stream-examples"></a>
<h2 class="chapter">6 Stream examples<span class="pull-right"><a class="anchor hidden-xs" href="#Stream-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Stream-examples" aria-hidden="true">TOC</a></span></h2>
<ul>
<li> Multipart JPEG
<div class="example">
<pre class="example"><Stream test.mjpg>
Feed feed1.ffm
Format mpjpeg
VideoFrameRate 2
VideoIntraOnly
NoAudio
Strict -1
</Stream>
</pre></div>
</li><li> Single JPEG
<div class="example">
<pre class="example"><Stream test.jpg>
Feed feed1.ffm
Format jpeg
VideoFrameRate 2
VideoIntraOnly
VideoSize 352x240
NoAudio
Strict -1
</Stream>
</pre></div>
</li><li> Flash
<div class="example">
<pre class="example"><Stream test.swf>
Feed feed1.ffm
Format swf
VideoFrameRate 2
VideoIntraOnly
NoAudio
</Stream>
</pre></div>
</li><li> ASF compatible
<div class="example">
<pre class="example"><Stream test.asf>
Feed feed1.ffm
Format asf
VideoFrameRate 15
VideoSize 352x240
VideoBitRate 256
VideoBufferSize 40
VideoGopSize 30
AudioBitRate 64
StartSendOnKey
</Stream>
</pre></div>
</li><li> MP3 audio
<div class="example">
<pre class="example"><Stream test.mp3>
Feed feed1.ffm
Format mp2
AudioCodec mp3
AudioBitRate 64
AudioChannels 1
AudioSampleRate 44100
NoVideo
</Stream>
</pre></div>
</li><li> Ogg Vorbis audio
<div class="example">
<pre class="example"><Stream test.ogg>
Feed feed1.ffm
Metadata title "Stream title"
AudioBitRate 64
AudioChannels 2
AudioSampleRate 44100
NoVideo
</Stream>
</pre></div>
</li><li> Real with audio only at 32 kbits
<div class="example">
<pre class="example"><Stream test.ra>
Feed feed1.ffm
Format rm
AudioBitRate 32
NoVideo
</Stream>
</pre></div>
</li><li> Real with audio and video at 64 kbits
<div class="example">
<pre class="example"><Stream test.rm>
Feed feed1.ffm
Format rm
AudioBitRate 32
VideoBitRate 128
VideoFrameRate 25
VideoGopSize 25
</Stream>
</pre></div>
</li><li> For stream coming from a file: you only need to set the input filename
and optionally a new format.
<div class="example">
<pre class="example"><Stream file.rm>
File "/usr/local/httpd/htdocs/tlive.rm"
NoAudio
</Stream>
</pre></div>
<div class="example">
<pre class="example"><Stream file.asf>
File "/usr/local/httpd/htdocs/test.asf"
NoAudio
Metadata author "Me"
Metadata copyright "Super MegaCorp"
Metadata title "Test stream from disk"
Metadata comment "Test comment"
</Stream>
</pre></div>
</li></ul>
<a name="See-Also"></a>
<h2 class="chapter">7 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
<p><a href="ffserver-all.html">ffserver-all</a>,
the <samp>doc/ffserver.conf</samp> example,
<a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
<a href="ffmpeg-utils.html">ffmpeg-utils</a>,
<a href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
<a href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
<a href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
<a href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
<a href="ffmpeg-formats.html">ffmpeg-formats</a>,
<a href="ffmpeg-devices.html">ffmpeg-devices</a>,
<a href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
<a href="ffmpeg-filters.html">ffmpeg-filters</a>
</p>
<a name="Authors"></a>
<h2 class="chapter">8 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
<p>The FFmpeg developers.
</p>
<p>For details about the authorship, see the Git history of the project
(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
<code>git log</code> in the FFmpeg source directory, or browsing the
online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
</p>
<p>Maintainers for the specific components are listed in the file
<samp>MAINTAINERS</samp> in the source code tree.
</p>
<p style="font-size: small;">
This document was generated using <a href="http://www.gnu.org/software/texinfo/"><em>makeinfo</em></a>.
</p>
</div>
</body>
</html>
|