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 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727
|
'\" t
.\" Title: ffmpegfs
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\" Date: November 2024
.\" Manual: User Commands
.\" Source: ffmpegfs 2.17
.\" Language: English
.\"
.TH "FFMPEGFS" "1" "November 2024" "ffmpegfs 2\&.17" "User Commands"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ffmpegfs \- mounts and transcodes a multitude of formats to one of the target formats on the fly\&.
.SH "SYNOPSIS"
.sp
\fBffmpegfs\fR [\fIOPTION\fR]\&... \fIIN_DIR\fR \fIOUT_DIR\fR
.SH "DESCRIPTION"
.sp
The ffmpegfs(1) command will mount the directory \fIIN_DIR\fR on \fIOUT_DIR\fR\&. Thereafter, accessing \fIOUT_DIR\fR will show the contents of \fIIN_DIR\fR, with all supported media files transparently renamed and transcoded to one of the supported target formats upon access\&.
.sp
Supported output formats:
.TS
allbox tab(:);
lt lt lt lt
lt lt lt lt
lt lt lt lt
lt lt lt lt
lt lt lt lt
lt lt lt lt
lt lt lt lt
lt lt lt lt
lt lt lt lt
lt lt lt lt
lt lt lt lt
lt lt lt lt
lt lt lt lt
lt lt lt lt
lt lt lt lt
lt lt lt lt
lt lt lt lt
lt lt lt lt.
T{
.sp
\fBFormat\fR
T}:T{
.sp
\fBDescription\fR
T}:T{
.sp
\fBAudio\fR
T}:T{
.sp
\fBVideo\fR
T}
T{
.sp
AIFF
T}:T{
.sp
Audio Interchange File Format
T}:T{
.sp
T}:T{
.sp
PCM 16 bit BE
T}
T{
.sp
ALAC
T}:T{
.sp
Apple Lossless Audio Codec
T}:T{
.sp
T}:T{
.sp
ALAC
T}
T{
.sp
FLAC
T}:T{
.sp
Free Lossless Audio
T}:T{
.sp
T}:T{
.sp
FLAC
T}
T{
.sp
HLS
T}:T{
.sp
HTTP Live Streaming
T}:T{
.sp
H264
T}:T{
.sp
AAC
T}
T{
.sp
MOV
T}:T{
.sp
QuickTime File Format
T}:T{
.sp
H264
T}:T{
.sp
AAC
T}
T{
.sp
MP3
T}:T{
.sp
MPEG\-2 Audio Layer III
T}:T{
.sp
T}:T{
.sp
MP3
T}
T{
.sp
MP4
T}:T{
.sp
MPEG\-4
T}:T{
.sp
H264
T}:T{
.sp
AAC
T}
T{
.sp
OGG
T}:T{
.sp
T}:T{
.sp
Theora
T}:T{
.sp
Vorbis
T}
T{
.sp
MKV
T}:T{
.sp
Matroska
T}:T{
.sp
H264
T}:T{
.sp
AAC
T}
T{
.sp
Opus
T}:T{
.sp
T}:T{
.sp
Opus
T}:T{
.sp
T}
T{
.sp
ProRes
T}:T{
.sp
Apple ProRes
T}:T{
.sp
ProRes
T}:T{
.sp
PCM 16 bit LE
T}
T{
.sp
TS
T}:T{
.sp
MPEG Transport Stream
T}:T{
.sp
H264
T}:T{
.sp
AAC
T}
T{
.sp
WAV
T}:T{
.sp
Waveform Audio File Format
T}:T{
.sp
T}:T{
.sp
PCM 16 bit LE
T}
T{
.sp
WebM
T}:T{
.sp
T}:T{
.sp
VP9
T}:T{
.sp
Opus
T}
T{
.sp
BMP
T}:T{
.sp
Video to frameset
T}:T{
.sp
T}:T{
.sp
BMP
T}
T{
.sp
JPG
T}:T{
.sp
Video to frameset
T}:T{
.sp
T}:T{
.sp
JPEG
T}
T{
.sp
PNG
T}:T{
.sp
Video to frameset
T}:T{
.sp
T}:T{
.sp
PNG
T}
.TE
.sp 1
.SH "OPTIONS"
.sp
Usage: ffmpegfs [OPTION]\&... IN_DIR OUT_DIR
.sp
Mount IN_DIR on OUT_DIR, converting audio and video files upon access\&.
.SS "Encoding options"
.PP
\fB\-\-desttype\fR=TYPE, \fB\-odesttype\fR=TYPE
.RS 4
Select the destination format\&.
\fITYPE\fR
can currently be:
.sp
\fBAIFF\fR,
\fBALAC\fR,
\fBBMP\fR,
\fBFLAC\fR,
\fBHLS\fR,
\fBJPG\fR,
\fBMOV\fR,
\fBMP3\fR,
\fBMP4\fR,
\fBMKV\fR,
\fBOGG\fR,
\fBOpus\fR,
\fBPNG\fR,
\fBProRes\fR,
\fBTS\fR,
\fBWAV\fR,
\fBWebM\fR\&.
.sp
To stream videos,
\fBMP4\fR,
\fBTS\fR,
\fBHLS\fR,
\fBOGG\fR,
\fBWEBM\fR,
\fBMKV\fR, or
\fBMOV\fR/\fBPRORES\fR
must be selected\&.
.sp
To use HTTP Live Streaming, set
\fBHLS\fR\&.
.sp
When a destination
\fBJPG\fR,
\fBPNG\fR, or
\fBBMP\fR
is chosen, all frames of a video source file will be presented in a virtual directory named after the source file\&. Audio will not be available\&.
.sp
To use the smart transcoding feature, specify a video and audio file type, separated by a "+" sign\&. For example, \-\-desttype=mov+aiff will convert video files to Apple Quicktime MOV and audio\-only files to AIFF\&.
.sp
Defaults to:
\fBmp4\fR
.RE
.PP
\fB\-\-audiocodec\fR=TYPE, \fB\-oaudiocodec\fR=TYPE
.RS 4
Select an audio codec\&.
\fITYPE\fR
depends on the destination format and can currently be:
.TS
allbox tab(:);
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt.
T{
\fBFormats\fR
T}:T{
\fBAudio Codecs\fR
T}
T{
MP4
T}:T{
\fBAAC\fR, MP3
T}
T{
WebM
T}:T{
\fBOPUS\fR, VORBIS
T}
T{
MOV
T}:T{
\fBAAC\fR, AC3, MP3
T}
T{
MKV
T}:T{
\fBAAC\fR, AC3, MP3
T}
T{
TS, HLS
T}:T{
\fBAAC\fR, AC3, MP3
T}
.TE
.sp 1
Other destination formats do not support other codecs than the default\&.
.sp
Defaults to: The destination format\(cqs default setting, as indicated by the first codec name in the list\&.
.RE
.PP
\fB\-\-videocodec\fR=TYPE, \fB\-ovideocodec\fR=TYPE
.RS 4
Select a video codec\&.
\fITYPE\fR
depends on the destination format and can currently be:
.TS
allbox tab(:);
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt.
T{
\fBFormats\fR
T}:T{
\fBVideo Codecs\fR
T}
T{
MP4
T}:T{
\fBH264\fR, H265, MPEG1, MPEG2
T}
T{
WebM
T}:T{
\fBVP9\fR, VP8, AV1
T}
T{
MOV
T}:T{
\fBH264\fR, H265, MPEG1, MPEG2
T}
T{
MKV
T}:T{
\fBH264\fR, H265, MPEG1, MPEG2
T}
T{
TS, HLS
T}:T{
\fBH264\fR, H265, MPEG1, MPEG2
T}
.TE
.sp 1
Other destination formats do not support other codecs than the default\&.
.sp
Defaults to: The destination format\(cqs default setting, as indicated by the first codec name in the list\&.
.RE
.PP
\fB\-\-autocopy\fR=OPTION, \fB\-oautocopy\fR=OPTION
.RS 4
Select the auto copy option\&.
\fIOPTION\fR
can be:
.TS
allbox tab(:);
lt lt
lt lt
lt lt
lt lt
lt lt.
T{
\fBOFF\fR
T}:T{
Never copy streams, transcode always\&.
T}
T{
\fBMATCH\fR
T}:T{
Copy stream if target supports codec\&.
T}
T{
\fBMATCHLIMIT\fR
T}:T{
Same as MATCH, only copy if target not larger, transcode otherwise\&.
T}
T{
\fBSTRICT\fR
T}:T{
Copy stream if codec matches desired target, transcode otherwise\&.
T}
T{
\fBSTRICTLIMIT\fR
T}:T{
Same as STRICT, only copy if target not larger, transcode otherwise\&.
T}
.TE
.sp 1
This can speed up transcoding significantly as copying streams uses much less computing power as compared to transcoding\&.
.sp
\fBMATCH\fR
copies a stream if the target supports it, e\&.g\&., an AAC audio stream will be copied to MPEG, although FFmpeg\(cqs target format is MP3 for this container\&. H264 would be copied to ProRes, although the result would be a regular MOV or MP4, not a ProRes file\&.
.sp
\fBSTRICT\fR
would convert AAC to MP3 for MPEG or H264 to ProRes for Prores files to strictly adhere to the output format setting\&. This will create homogenous results which might prevent problems with picky playback software\&.
.sp
Note: When the
\fB\-\-audiocodec\fR
or
\fB\-\-videocodec\fR
option is specified, the STRICT option should be used to ensure that the chosen output codec is used in any scenario\&. MATCH would enable copy if the output format supports the input codec\&.
.RE
.sp
Defaults to: \fBOFF\fR
.PP
\fB\-\-recodesame\fR=OPTION, \fB\-orecodesame\fR=OPTION
.RS 4
Select recode to the same format option,
\fIOPTION\fR
can be:
.TS
allbox tab(:);
lt lt
lt lt.
T{
\fBNO\fR
T}:T{
Never recode to the same format\&.
T}
T{
\fBYES\fR
T}:T{
Always recode to the same format\&.
T}
.TE
.sp 1
Defaults to:
\fBNO\fR
.RE
.PP
\fB\-\-profile\fR=NAME, \fB\-oprofile\fR=NAME
.RS 4
Set profile for target audience,
\fINAME\fR
can be:
.TS
allbox tab(:);
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt
lt lt.
T{
\fBNONE\fR
T}:T{
no profile
T}
T{
\fBFF\fR
T}:T{
optimise for Firefox
T}
T{
\fBEDGE\fR
T}:T{
optimise for MS Edge and Internet Explorer > 11
T}
T{
\fBIE\fR
T}:T{
optimise for MS Edge and Internet Explorer ⇐ 11
T}
T{
\fBCHROME\fR
T}:T{
Google Chrome
T}
T{
\fBSAFARI\fR
T}:T{
Apple Safari
T}
T{
\fBOPERA\fR
T}:T{
Opera
T}
T{
\fBMAXTHON\fR
T}:T{
Maxthon
T}
.TE
.sp 1
\fBNote:\fR
applies to the MP4 output format only, and is ignored for all other formats\&.
.sp
Defaults to:
\fBNONE\fR
.RE
.PP
\-\-\fBlevel\fR=NAME, \-o \fBlevel\fR=NAME
.RS 4
Set level for output if available\&.
\fINAME\fR
can be:
.TS
allbox tab(:);
lt lt
lt lt
lt lt
lt lt.
T{
\fBPROXY\fR
T}:T{
Proxy \(en apco
T}
T{
\fBLT\fR
T}:T{
LT \(en apcs
T}
T{
\fBSTANDARD\fR
T}:T{
standard \(en apcn
T}
T{
\fBHQ\fR
T}:T{
HQ \- apch
T}
.TE
.sp 1
\fBNote:\fR
applies to the MP4 output format only, and is ignored for all other formats\&.
.sp
Defaults to:
\fBHQ\fR
.RE
.PP
\fB\-\-include_extensions\fR=LIST, \fB\-oinclude_extensions\fR=LIST
.RS 4
Set the list of file extensions to be encoded\&.
\fILIST\fR
can have one or more entries that are separated by commas\&. These are the only file extensions that will be transcoded\&. Can be specified numerous times and will be merged, which is required when specifying them in the fstab because commas cannot be used to separate the extensions\&. The entries support shell wildcard patterns\&.
.sp
Example: \-\-include_extensions=mp4,wmv to encode MPEG\-4 and Windows Media files only\&.
.sp
Defaults to: Encode all supported files\&.
.RE
.PP
\fB\-\-hide_extensions\fR=LIST, \fB\-ohide_extensions\fR=LIST
.RS 4
Set a list of file extensions to exclude from the output\&.
\fILIST\fR
can have one or more entries that are separated by commas\&. Can be specified numerous times and will be merged, which is required when specifying them in the fstab because commas cannot be used to separate the extensions\&. The entries support shell wildcard patterns\&.
.sp
Example: \-\-hide_extensions=jpg,png,cue to stop covers and cue sheets from showing up\&.
.sp
Defaults to: Show all files\&.
.RE
.SS "Audio Options"
.PP
\fB\-\-audiobitrate\fR=BITRATE, \fB\-o audiobitrate\fR=BITRATE
.RS 4
Select the audio encoding bitrate\&.
.sp
Defaults to:
\fB128 kbit\fR
.sp
\fBAcceptable values for \fR\fB\fIBITRATE\fR\fR\fB:\fR
.sp
\fBmp4:\fR
8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 288, 320, 352, 384, 416, and 448 kbps\&.
.sp
\fBmp3:\fR
For sampling frequencies of 32, 44\&.1, and 48 kHz,
\fIBITRATE\fR
can be among 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, and 320 kbps\&.
.sp
For sampling frequencies of 16, 22\&.05, and 24 kHz,
\fIBITRATE\fR
can be among 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, and 160 kbps\&.
.sp
When in doubt, it is recommended to choose a bitrate among 96, 112, 128, 160, 192, 224, 256, and 320 kbps\&.
.PP
\fBBITRATE\fR
.RS 4
can be defined as\&...
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
n bit/s: # or #bps
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
n kbit/s: #K or #Kbps
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
n Mbit/s: #M or #Mbps
.RE
.RE
.RE
.PP
\fB\-\-audiosamplerate\fR=SAMPLERATE, \fB\-o audiosamplerate\fR=SAMPLERATE
.RS 4
This limits the output sample rate to
\fISAMPLERATE\fR\&. If the source file sample rate is higher, it will be downsampled automatically\&.
.sp
Typical values are 8000, 11025, 22050, 44100, 48000, 96000, and 192000\&.
.sp
If the target codec does not support the selected sample rate, the next matching rate will be chosen (e\&.g\&. if 24K is selected but only 22\&.05 or 44\&.1 KHz is supported, 22\&.05 KHz will be set)\&.
.sp
Set to 0 to keep the source rate\&.
.sp
Defaults to:
\fB44\&.1 kHz\fR
.PP
\fBSAMPLERATE\fR
.RS 4
can be defined as\&...
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
In Hz: # or #Hz
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
In kHz: #K or #KHz
.RE
.RE
.RE
.PP
\fB\-\-audiochannels\fR=CHANNELS, \fB\-o audiochannels\fR=CHANNELS
.RS 4
This limits the number of output channels to
\fICHANNELS\fR\&. If the source has more channels, the number will be reduced to this limit\&.
.sp
Typical values are 1, 2 or 6 (e\&.g\&., 5\&.1) channels\&.
.sp
If the target codec does not support the selected number of channels, transcoding may fail\&.
.sp
Set to 0 to keep the number of channels\&.
.sp
Defaults to:
\fB2 channels (stereo)\fR
.RE
.PP
\fB\-\-audiosamplefmt\fR=SAMPLEFMT, \fB\-o audiosamplefmt\fR=SAMPLEFMT
.RS 4
This sets a sample format\&.
\fISAMPLEFMT\fR
can be:
.sp
0 to use the predefined setting; 8, 16, 32, 64 for integer format, F16, F32, F64 for floating point\&.
.sp
Not all formats are supported by all destination types\&. Selecting an invalid format will be reported as a command line error and a list of values printed\&.
.TS
allbox tab(:);
lt lt
lt lt
lt lt
lt lt
lt lt.
T{
\fBContainer Format\fR
T}:T{
\fBSample Format\fR
T}
T{
\fBAIFF\fR
T}:T{
0, 16, 32
T}
T{
\fBALAC\fR
T}:T{
0, 16, 24
T}
T{
\fBWAV\fR
T}:T{
0, 8, 16, 32, 64, F16, F32, F64
T}
T{
\fBFLAC\fR
T}:T{
0, 16, 24
T}
.TE
.sp 1
Defaults to: 0 (Use the same as the source or the predefined format of the destination if the source format is not possible\&.)
.RE
.SS "Video Options"
.PP
\fB\-\-videobitrate\fR=BITRATE, \fB\-o videobitrate\fR=BITRATE
.RS 4
This sets the video encoding bit rate\&. Setting this too high or too low may cause transcoding to fail\&.
.sp
Defaults to:
\fB2 Mbit\fR
.sp
\fBmp4:\fR
May be specified as 500 to 25,000 kbps\&.
.PP
\fBBITRATE\fR
.RS 4
can be defined as\&...
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
n bit/s: # or #bps
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
n kbit/s: #K or #Kbps
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
n Mbit/s: #M or #Mbps
.RE
.RE
.RE
.PP
\fB\-\-videoheight\fR=HEIGHT, \-o \fBvideoheight\fR=HEIGHT
.RS 4
This sets the height of the transcoded video\&.
.sp
When the video is rescaled, the aspect ratio is preserved if \-\-width is not set at the same time\&.
.sp
Defaults to:
\fBkeep source video height\fR
.RE
.PP
\fB\-\-videowidth\fR=WIDTH, \-o \fBvideowidth\fR=WIDTH
.RS 4
This sets the width of the transcoded video\&.
.sp
When the video is rescaled, the aspect ratio is preserved if \-\-height is not set at the same time\&.
.sp
Defaults to:
\fBkeep source video width\fR
.RE
.PP
\fB\-\-deinterlace\fR, \-o \fBdeinterlace\fR
.RS 4
Deinterlace video if necessary while transcoding\&.
.sp
This may need a higher bit rate, but this will increase picture quality when streaming via HTML5\&.
.sp
Defaults to: "no deinterlace"
.RE
.SS "HLS Options"
.PP
\fB\-\-segment_duration\fR, \-o \fBsegment_duration\fR
.RS 4
Set the duration of one video segment of the HLS stream\&. This argument is a floating point value, e\&.g\&., it can be set to 2\&.5 for 2500 milliseconds\&.
.sp
Should normally be left as the default\&.
.sp
\fBNote:\fR
This applies to the HLS output format only, and is ignored for all other formats\&.
.sp
Defaults to:
\fB10 seconds\fR
.RE
.PP
\fB\-\-min_seek_time_diff\fR, \-o \fBmin_seek_time_diff\fR
.RS 4
If the requested HLS segment is less than min_seek_time seconds away, discard the seek request\&. The segment will be available very soon anyway, and that makes a re\-transcode necessary\&. Set to 0 to disable\&.
.sp
Should normally be left as the default\&.
.sp
\fBNote:\fR
This applies to the HLS output format only, and is ignored for all other formats\&.
.sp
Defaults to:
\fB30 seconds\fR
.RE
.SS "Hardware Acceleration Options"
.PP
\fB\-\-hwaccel_enc\fR=API, \fB\-o hwaccel_enc\fR=API
.RS 4
Select the hardware acceleration API for encoding\&.
.sp
Defaults to:
\fBNONE\fR
(no acceleration)\&.
.PP
\fBAPI\fR
.RS 4
can be defined as\&...
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBNONE\fR: use software encoder
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBVAAPI\fR: Video Acceleration API (VA\-API)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBOMX\fR: OpenMAX (Open Media Acceleration)
.RE
.RE
.RE
.PP
\fB\-\-hwaccel_dec_blocked\fR=CODEC[:PROFILE[:PROFILE]], \fB\-o hwaccel_dec_blocked\fR=CODEC:[:PROFILE[:PROFILE]]
.RS 4
Block a codec and, optionally, a profile for hardware decoding\&. The option can be repeated to block several codecs\&.
.sp
Defaults to: no codecs blocked\&.
.PP
\fBCODEC\fR
.RS 4
can be defined as\&...
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBH263\fR: H\&.263
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBH264\fR: H\&.264
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBHEVC\fR: H\&.265 / HEVC
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBMPEG2\fR: MPEG\-2 video
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBMPEG4\fR: MPEG\-4 video
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBVC1\fR: SMPTE VC\-1
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBVP8\fR: Google VP9
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBVP9\fR: Google VP9
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBWMV3\fR: Windows Media Video 9
.RE
.RE
.RE
.PP
\fBPROFILE\fR
.RS 4
can optionally be added to block a certain profile from the codec only\&.
.sp
Example: VP9:0 blocks Google VP profile 0\&.
.sp
Example: H264:1:33 blocks H\&.264 profile 1 and 33\&.
.RE
.PP
\fB\-\-hwaccel_enc_device\fR=DEVICE, \-o \fBhwaccel_enc_device\fR=DEVICE
.RS 4
Select the hardware acceleration device\&. May be required for VAAPI, especially if more than one device is available\&.
.sp
\fBNote:\fR
This only applies to VAAPI hardware acceleration; all other types are ignored\&.
.sp
Defaults to:
\fBempty\fR
(use default device)\&.
.sp
Example:
\fB/dev/dri/renderD128\fR
.RE
.PP
\fB\-\-hwaccel_dec\fR=API, \fB\-o hwaccel_dec\fR=API
.RS 4
Select the hardware acceleration API for decoding\&.
.sp
Defaults to:
\fBNONE\fR
(no acceleration)
.PP
\fBAPI\fR
.RS 4
can be defined as\&...
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBNONE\fR: use software decoder
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBVAAPI\fR: Video Acceleration API (VA\-API)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBMMAL\fR: Multimedia Abstraction Layer by Broadcom
.RE
.RE
.RE
.PP
\fB\-\-hwaccel_dec_device\fR=DEVICE, \-o \fBhwaccel_dec_device\fR=DEVICE
.RS 4
Select the hardware acceleration device\&. May be required for VAAPI, especially if more than one device is available\&.
.sp
\fBNote:\fR
This only applies to VAAPI hardware acceleration; all other types are ignored\&.
.sp
Defaults to:
\fBempty\fR
(use default device)
.sp
Example:
\fB/dev/dri/renderD128\fR
.RE
.SS "Album Arts"
.PP
\-\-\fBnoalbumarts\fR, \-o \fBnoalbumarts\fR
.RS 4
Do not copy album art into the output file\&.
.sp
This will reduce the file size and may be useful when streaming via HTML5 when album art is not used anyway\&.
.sp
Defaults to:
\fBadd album arts\fR
.RE
.SS "Virtual Script"
.PP
\-\-\fBenablescript\fR, \-o \fBenablescript\fR
.RS 4
Add a virtual index\&.php to every directory\&. It reads scripts/videotag\&.php from the FFmpegfs binary directory\&.
.sp
This can be very handy for testing video playback\&. Of course, feel free to replace videotag\&.php with your own script\&.
.sp
Defaults to:
\fBDo not generate script file\fR
.RE
.PP
\-\-\fBscriptfile\fR, \-o \fBscriptfile\fR
.RS 4
Set the name of the virtual script created in each directory\&.
.sp
Defaults to:
\fBindex\&.php\fR
.RE
.PP
\-\-\fBscriptsource\fR, \-o \fBscriptsource\fR
.RS 4
Use a different source file\&.
.sp
Defaults to:
\fBscripts/videotag\&.php\fR
.RE
.SS "Cache Options"
.PP
\fB\-\-expiry_time\fR=TIME, \fB\-o expiry_time\fR=TIME
.RS 4
Cache entries expire after
\fITIME\fR
and will be deleted to save disc space\&.
.sp
Defaults to:
\fB1 week\fR
.RE
.PP
\fB\-\-max_inactive_suspend\fR=TIME, \fB\-o max_inactive_suspend\fR=TIME
.RS 4
While being accessed, the file is transcoded to the target format in the background\&. When the client quits, transcoding will continue until this time out\&. Transcoding is suspended until it is accessed again, then transcoding will continue\&.
.sp
Defaults to:
\fB15 seconds\fR
.RE
.PP
\fB\-\-max_inactive_abort\fR=TIME, \fB\-o max_inactive_abort\fR=TIME
.RS 4
While being accessed, the file is transcoded in the background to the target format\&. When the client quits, transcoding will continue until this time out, then the transcoder thread quits\&.
.sp
Defaults to:
\fB30 seconds\fR
.RE
.PP
\fB\-\-prebuffer_time\fR=TIME, \fB\-o prebuffer_time\fR=TIME
.RS 4
Files will be decoded until the buffer contains the specified playing time, allowing playback to start smoothly without lags\&. Both options must be met if prebuffer time and prebuffer size are specified\&.
.sp
Set to 0 to disable pre\-buffering\&.
.sp
Defaults to:
\fBno prebuffer time\fR
.RE
.PP
\fB\-\-prebuffer_size\fR=SIZE, \fB\-o prebuffer_size\fR=SIZE
.RS 4
Files will be decoded until the specified number of bytes is present in the buffer, allowing playback to start smoothly without lags\&. Both options must be met if prebuffer size and prebuffer time are specified\&.
.sp
Set to 0 to disable pre\-buffering\&.
.sp
Defaults to:
\fB100 KB\fR
.RE
.PP
\fB\-\-max_cache_size\fR=SIZE, \fB\-o max_cache_size\fR=SIZE
.RS 4
Set the maximum diskspace used by the cache\&. If the cache grows beyond this limit when a file is transcoded, old entries will be deleted to keep the cache within the size limit\&.
.sp
Defaults to:
\fBunlimited\fR
.RE
.PP
\fB\-\-min_diskspace\fR=SIZE, \fB\-o min_diskspace\fR=SIZE
.RS 4
Set the required diskspace on the cachepath mount\&. If the remaining space falls below
\fISIZE\fR
when a file is transcoded, old entries will be deleted to keep the diskspace within the limit\&.
.sp
Defaults to:
\fB0 (no minimum space)\fR
.RE
.PP
\fB\-\-cachepath\fR=DIR, \fB\-o cachepath\fR=DIR
.RS 4
Sets the disc cache directory to
\fIDIR\fR\&. If it does not already exist, it will be created\&. The user running FFmpegfs must have write access to the location\&.
.sp
Defaults to:
\fB${XDG_CACHE_HOME:\-~/\&.cache}/ffmpegfs\fR
(as specified in the XDG Base Directory Specification)\&. Falls back to ${HOME:\-~/\&.cache}/ffmpegfs if not defined\&. If executed with root privileges, "/var/cache/ffmpegfs" will be used\&.
.RE
.PP
\fB\-\-disable_cache\fR, \-o \fBdisable_cache\fR
.RS 4
Disable the cache functionality completely\&.
.sp
Defaults to:
\fBenabled\fR
.RE
.PP
\fB\-\-cache_maintenance\fR=TIME, \fB\-o cache_maintenance\fR=TIME
.RS 4
Starts cache maintenance in
\fITIME\fR
intervals\&. This will enforce the expery_time, max_cache_size and min_diskspace settings\&. Do not set it too low as this can slow down transcoding\&.
.sp
Only one FFmpegfs process will do the maintenance by becoming the master\&. If that process exits, another will take over, so that one will always do the maintenance\&.
.sp
Defaults to:
\fB1 hour\fR
.RE
.PP
\fB\-\-prune_cache\fR
.RS 4
Prune the cache immediately according to the above settings at application start up\&.
.sp
Defaults to:
\fBDo not prune cache\fR
.RE
.PP
\fB\-\-clear_cache\fR, \fB\-o clear_cache\fR
.RS 4
On startup, clear the cache\&. All previously transcoded files will be deleted\&.
.PP
\fBTIME\fR
.RS 4
can be defined as\&...
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Seconds: #
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Minutes: #m
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Hours: #h
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Days: #d
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Weeks: #w
.RE
.RE
.PP
\fBSIZE\fR
.RS 4
can be defined as\&...
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
In bytes: # or #B
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
In KBytes: #K or #KB
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
In MBytes: #M or #MB
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
In GBytes: #G or #GB
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
In TBytes: #T or #TB
.RE
.RE
.RE
.SS "Other"
.PP
\fB\-\-max_threads\fR=COUNT, \fB\-o max_threads\fR=COUNT
.RS 4
Limit concurrent transcoder threads\&. Set to 0 for unlimited threads\&. Recommended values are up to 16 times the number of CPU cores\&. Should be left as the default\&.
.sp
Defaults to:
\fB16 times number of detected cpu cores\fR
.RE
.PP
\fB\-\-decoding_errors\fR, \fB\-o decoding_errors\fR
.RS 4
Decoding errors are normally ignored, leaving bloopers and hiccups in encoded audio or video but still creating a valid file\&. When this option is set, transcoding will stop with an error\&.
.sp
Defaults to:
\fBIgnore errors\fR
.RE
.PP
\fB\-\-min_dvd_chapter_duration\fR=SECONDS, \fB\-o min_dvd_chapter_duration\fR=SECONDS
.RS 4
This ignores DVD chapters shorter than SECONDS\&. To disable, set to 0\&. This avoids transcoding errors for DVD chapters too short to detect its streams\&.
.sp
Defaults to:
\fB1 second\fR
.RE
.PP
\fB\-\-win_smb_fix\fR, \fB\-o win_smb_fix\fR
.RS 4
Windows seems to access the files on Samba drives starting at the last 64K segment when the file is opened\&. Setting \-\-win_smb_fix=1 will ignore these attempts (not decode the file up to this point)\&.
.sp
Defaults to:
\fBon\fR
.RE
.SS "Logging"
.PP
\fB\-\-log_maxlevel\fR=LEVEL, \fB\-o log_maxlevel\fR=LEVEL
.RS 4
Maximum level of messages to log, either ERROR, WARNING, INFO, DEBUG or TRACE\&. Defaults to INFO and is always set to DEBUG in debug mode\&.
.sp
Note that the other log flags must also be set to enable logging\&.
.RE
.PP
\fB\-\-log_stderr\fR, \fB\-o log_stderr\fR
.RS 4
Enable outputting logging messages to stderr\&. Automatically enabled in debug mode\&.
.RE
.PP
\fB\-\-log_syslog\fR, \fB\-o log_syslog\fR
.RS 4
Enable outputting logging messages to syslog\&.
.RE
.PP
\fB\-\-logfile\fR=FILE, \fB\-o logfile\fR=FILE
.RS 4
File to output log messages to\&. By default, no file will be written\&.
.RE
.SS "General/FUSE options"
.PP
\fB\-d\fR, \fB\-o debug\fR
.RS 4
Enable debug output\&. This will result in a large quantity of diagnostic information being printed to stderr as the programme runs\&. It implies
\fB\-f\fR\&.
.RE
.PP
\fB\-f\fR
.RS 4
Run in the foreground instead of detaching from the terminal\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Print usage information\&.
.RE
.PP
\fB\-V\fR, \fB\-\-version\fR
.RS 4
Output version information\&.
.RE
.PP
\fB\-c\fR, \fB\-\-capabilities\fR
.RS 4
Output FFmpeg capabilities: a list of the system\(cqs available codecs\&.
.RE
.PP
\fB\-s\fR
.RS 4
Force single\-threaded operation\&.
.RE
.SH "USAGE"
.sp
Mount your file system as follows:
.sp
.if n \{\
.RS 4
.\}
.nf
ffmpegfs [\-\-audiobitrate bitrate] [\-\-videobitrate bitrate] musicdir mountpoint [\-o fuse_options]
.fi
.if n \{\
.RE
.\}
.sp
To use FFmpegfs as a daemon and encode to MPEG\-4, for instance:
.sp
.if n \{\
.RS 4
.\}
.nf
ffmpegfs \-\-audiobitrate=256K \-\-videobitrate=1\&.5M /mnt/music /mnt/ffmpegfs \-o allow_other,ro,desttype=mp4
.fi
.if n \{\
.RE
.\}
.sp
This will run FFmpegfs in the foreground and print the log output to the screen:
.sp
.if n \{\
.RS 4
.\}
.nf
ffmpegfs \-f \-\-log_stderr \-\-audiobitrate=256K \-\-videobitrate=1\&.5M \-\-audiobitrate=256K \-\-videobitrate=1\&.5M /mnt/music /mnt/ffmpegfs \-o allow_other,ro,desttype=mp4
.fi
.if n \{\
.RE
.\}
.sp
With the following entry in "/etc/fstab," the same result can be obtained with more recent versions of FUSE:
.sp
.if n \{\
.RS 4
.\}
.nf
ffmpegfs#/mnt/music /mnt/ffmpegfs fuse allow_other,ro,audiobitrate=256K,videobitrate=2000000,desttype=mp4 0 0
.fi
.if n \{\
.RE
.\}
.sp
Another (more current) way to express this command:
.sp
.if n \{\
.RS 4
.\}
.nf
/mnt/music /mnt/ffmpegfs fuse\&.ffmpegfs allow_other,ro,audiobitrate=256K,videobitrate=2000000,desttype=mp4 0 0
.fi
.if n \{\
.RE
.\}
.sp
At this point, files like /mnt/music/**\&.flac and /mnt/music/**\&.ogg will show up as /mnt/ffmpegfs/**\&.mp4\&.
.sp
Audio bitrates will be reduced to 256 KBit, video to 1\&.5 MBit\&. The source bitrate will not be scaled up if it is lower; it will remain at the lower value\&.
.sp
Keep in mind that only root can, by default, utilise the "allow other" option\&. Either use the "user allow other" key in /etc/fuse\&.conf or run FFmpegfs as root\&.
.sp
Any user must have "allow other" enabled in order to access the mount\&. By default, only the user who initiated FFmpegfs has access to this\&.
.sp
Examples:
.sp
.if n \{\
.RS 4
.\}
.nf
ffmpegfs \-f $HOME/test/in $HOME/test/out \-\-log_stderr \-\-log_maxlevel=DEBUG \-o allow_other,ro,desttype=mp4,cachepath=$HOME/test/cache
.fi
.if n \{\
.RE
.\}
.sp
Transcode files using FFmpegfs from test/in to test/out while logging to stderr at a noisy TRACE level\&. The cache resides in test/cache\&. All directories are under the current user\(cqs home directory\&.
.sp
.if n \{\
.RS 4
.\}
.nf
ffmpegfs \-f $HOME/test/in $HOME/test/out \-\-log_stderr \-\-log_maxlevel=DEBUG \-o allow_other,ro,desttype=mp4,cachepath=$HOME/test/cache,videowidth=640
.fi
.if n \{\
.RE
.\}
.sp
Similar to the previous, but with a 640\-pixel maximum video width\&. The aspect ratio will be maintained when scaling down larger videos\&. Videos that are smaller won\(cqt be scaled up\&.
.sp
.if n \{\
.RS 4
.\}
.nf
ffmpegfs \-f $HOME/test/in $HOME/test/out \-\-log_stderr \-\-log_maxlevel=DEBUG \-o allow_other,ro,desttype=mp4,cachepath=$HOME/test/cache,deinterlace
.fi
.if n \{\
.RE
.\}
.sp
Deinterlacing can be enabled for better image quality\&.
.SH "HOW IT WORKS"
.sp
The decoder and encoder are initialised when a file is opened, and the file\(cqs metadata is also read\&. At this point, a rough estimate of the total file size can be made\&. Because the actual size greatly depends on the material encoded, this technique works fair\-to\-good for MP4 or WebM output files but works well for MP3, AIFF, or WAV output files\&.
.sp
The file is transcoded as it is being read and stored in a private per\-file buffer\&. This buffer keeps expanding as the file is read until the entire file has been transcoded\&. After being decoded, the file is stored in a disc buffer and is readily accessible\&.
.sp
Other processes will share the same transcoded data if they access the same file because transcoding is done in a single additional thread, which saves CPU time\&. Transcoding will continue for a while if all processes close the file before it is finished\&. Transcoding will resume if the file is viewed once more before the timer expires\&. If not, it will halt and delete the current chunk to free up storage space\&.
.sp
A file will be transcoded up to the seek point when you seek within it (if not already done)\&. Since the majority of programmes will read a file from beginning to end, this is typically not a problem\&. Future upgrades might offer actual random seeking (but if this is feasible, it is not yet clear due to restrictions to positioning inside compressed streams)\&. When HLS streaming is chosen, this already functions\&. The requested segment is immediately skipped to by FFmpegfs\&.
.sp
\fBMP3:\fR The source file\(cqs comments are used to generate ID3 version 2\&.4 and 1\&.1 tags\&. They are correspondingly at the beginning and the end of the file\&.
.sp
\fBMP4:\fR The same is true for meta atoms contained in MP4 containers\&.
.sp
\fBWAV\fR: The estimated size of the WAV file will be included in a pro forma WAV header\&. When the file is complete, this header will be changed\&. Though most current gamers apparently disregard this information and continue to play the file, it does not seem required\&.
.sp
Only for MP3 targets: A particular optimization has been done so that programmes that look for id3v1 tags don\(cqt have to wait for the entire file to be transcoded before reading the tag\&. This accelerates these apps \fBdramatically\fR\&.
.SH "ABOUT OUTPUT FORMATS"
.sp
A few remarks regarding the output formats that are supported:
.sp
Since these are plain vanilla constant bitrate (CBR) MP3 files, there isn\(cqt much to say about the MP3 output\&. Any modern player should be able to play them well\&.
.sp
However, MP4 files are unique because standard MP4s aren\(cqt really ideal for live broadcasting\&. The start block of an MP4 has a field with the size of the compressed data section, which is the cause\&. It suffices to say that until the size is known, compression must be finished, a file seek must be performed to the beginning, and the size atom updated\&.
.sp
That size is unknown for a live stream that is ongoing\&. To obtain that value for our transcoded files, one would need to wait for the entire file to be recoded\&. As if that weren\(cqt enough, the file\(cqs final section contains some crucial details, such as meta tags for the artist, album, etc\&. Additionally, the fact that there is just one enormous data block makes it difficult to do random searches among the contents without access to the entire data section\&.
.sp
Many programmes will then read the crucial information from the end of an MP4 before returning to the file\(cqs head and beginning playback\&. This will destroy FFmpegfs\*(Aq entire transcode\-on\-demand concept\&.
.sp
Several extensions have been created to work around the restriction, including "faststart," which moves the aforementioned meta data from the end to the beginning of the MP4 file\&. Additionally, it is possible to omit the size field (0)\&. An further plugin is isml (smooth live streaming)\&.
.sp
Older versions of FFmpeg do not support several new MP4 features that are required for direct\-to\-stream transcoding, like ISMV, faststart, separate moof/empty moov, to mention a few (or if available, not working properly)\&.
.sp
Faststart files are produced by default with an empty size field so that the file can be started to be written out at once rather than having to be encoded as a complete first\&. It would take some time before playback could begin if it were fully encoded\&. The data part is divided into chunks of about 1 second each, all with their own header, so it is possible to fill in the size fields early enough\&.
.sp
One disadvantage is that not all players agree with the format, or they play it with odd side effects\&. VLC only refreshes the time display every several seconds while playing the file\&. There may not always be a complete duration displayed while streaming using HTML5 video tags, but that is fine as long as the content plays\&. Playback can only move backwards from the current playback position\&.
.sp
However, that is the cost of commencing playback quickly\&.
.SH "DEVELOPMENT"
.sp
Git is the revision control system used by FFmpegfs\&. The complete repository is available here:
.sp
git clone https://github\&.com/nschlia/ffmpegfs\&.git
.sp
or the mirror:
.sp
git clone https://salsa\&.debian\&.org/nschlia/ffmpegfs\&.git
.sp
FFmpegfs is composed primarily of C++17 with a small amount of C\&. The following libraries are utilised:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
FUSE
.RE
.sp
FFmpeg home pages:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
FFmpeg
.RE
.SH "FILES"
.sp
\fB/usr/local/bin/ffmpegfs\fR, \fB/etc/fstab\fR
.SH "AUTHORS"
.sp
This fork with FFmpeg support has been maintained by Norbert Schlia since 2017 to date\&.
.sp
Based on work by K\&. Henriksson (from 2008 to 2017) and the original author, David Collett (from 2006 to 2008)\&.
.sp
Much thanks to them for the original work and giving me a good head start!
.SH "LICENSE"
.sp
This program can be distributed under the terms of the GNU GPL version 3 or later\&. It can be found online or in the COPYING file\&.
.sp
This file and other documentation files can be distributed under the terms of the GNU Free Documentation License 1\&.3 or later\&. It can be found online or in the COPYING\&.DOC file\&.
.SH "FFMPEG LICENSE"
.sp
FFmpeg is licensed under the GNU Lesser General Public License (LGPL) version 2\&.1 or later\&. However, FFmpeg incorporates several optional parts and optimizations that are covered by the GNU General Public License (GPL) version 2 or later\&. If those parts get used the GPL applies to all of FFmpeg\&.
.sp
See https://www\&.ffmpeg\&.org/legal\&.html for details\&.
.SH "COPYRIGHT"
.sp
This fork with FFmpeg support copyright (C) 2017\-2024 Norbert Schlia\&.
.sp
Based on work copyright (C) 2006\-2008 David Collett, 2008\-2013 K\&. Henriksson\&.
.sp
Much thanks to them for the original work!
.sp
This is free software: you are free to change and redistribute it under the terms of the GNU General Public License (GPL) version 3 or later\&.
.sp
This manual is copyright (C) 2010\-2011 K\&. Henriksson and (C) 2017\-2024 by N\&. Schlia and may be distributed under the GNU Free Documentation License (GFDL) 1\&.3 or later with no invariant sections, or alternatively under the GNU General Public License (GPL) version 3 or later\&.
|