]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
add and document new additional video extensions supported at upload
authorRigel Kent <sendmemail@rigelk.eu>
Tue, 4 Aug 2020 13:48:09 +0000 (15:48 +0200)
committerChocobozzz <chocobozzz@cpy.re>
Mon, 10 Aug 2020 07:46:59 +0000 (09:46 +0200)
client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
config/default.yaml
config/production.yaml.example
server/initializers/constants.ts
server/tests/api/server/config.ts

index a297b0c7923bb9cd5bf598a8eaba021bca2ec0d9..8fdced1c7c710d46777d29f6394d6ceabfabb4a5 100644 (file)
                         i18n-labelText labelText="Allow additional extensions"
                       >
                         <ng-container ngProjectAs="description">
-                          <span i18n>Allows users to upload .mkv, .mov, .avi and .flv videos.</span>
+                          <span i18n>Allows users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos.</span>
                         </ng-container>
                       </my-peertube-checkbox>
                     </div>
index d6f7f7afe9d7779b40ded2f2c8a1e74552c80916..a3af1b15f16ec5d0d7401eae32e88966d950329c 100644 (file)
@@ -213,7 +213,7 @@ user:
 # Please, do not disable transcoding since many uploaded videos will not work
 transcoding:
   enabled: true
-  # Allow your users to upload .mkv, .mov, .avi, .flv videos
+  # Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos
   allow_additional_extensions: true
   # If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file
   allow_audio_files: true
index f57861eca619bf9a1fc290f4b30d092d02f72c29..c1e7c6c03e944108b3d181d2491d5ae48241d0c5 100644 (file)
@@ -227,7 +227,7 @@ user:
 # Please, do not disable transcoding since many uploaded videos will not work
 transcoding:
   enabled: true
-  # Allow your users to upload .mkv, .mov, .avi, .flv videos
+  # Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos
   allow_additional_extensions: true
   # If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file
   allow_audio_files: true
index ca6c2a7ffbb2ea6dc68d0d172ab7e760c47f3b74..573d86b607d8f55cfd2581711f379f578f43170b 100644 (file)
@@ -823,6 +823,7 @@ export {
 
 function buildVideoMimetypeExt () {
   const data = {
+    // streamable formats that warrant cross-browser compatibility
     'video/webm': '.webm',
     'video/ogg': '.ogv',
     'video/mp4': '.mp4'
@@ -831,15 +832,44 @@ function buildVideoMimetypeExt () {
   if (CONFIG.TRANSCODING.ENABLED) {
     if (CONFIG.TRANSCODING.ALLOW_ADDITIONAL_EXTENSIONS) {
       Object.assign(data, {
-        'video/quicktime': '.mov',
-        'video/x-msvideo': '.avi',
-        'video/x-flv': '.flv',
         'video/x-matroska': '.mkv',
-        'video/avi': '.avi',
+        'video/ogg': '.ogg',
+
+        // Developed by Apple
+        'video/quicktime': '.mov', // often used as output format by editing software
         'video/x-m4v': '.m4v',
+        'video/m4v': '.m4v',
+
+        // Developed by the Adobe Flash Platform
+        'video/x-flv': '.flv',
+        'video/x-f4v': '.f4v', // replacement for flv
+
+        // Developed by Microsoft
+        'video/x-ms-wmv': '.wmv',
+        'video/x-msvideo': '.avi',
+        'video/avi': '.avi',
+
+        // Developed by 3GPP
+        // common video formats for cell phones
+        'video/3gpp': '.3gp',
+        'video/3gpp2': '.3g2',
+
+        // Developed by FFmpeg/Mplayer
+        'application/x-nut': '.nut',
+
+        // The standard video format used by many Sony and Panasonic HD camcorders.
+        // It is also used for storing high definition video on Blu-ray discs.
+        'video/mp2t': '.mts',
+        'video/m2ts': '.m2ts',
+
+        // Old formats reliant on MPEG-1/MPEG-2
+        'video/mpv': '.mpv',
+        'video/mpeg2': '.m2v',
+        'video/mpeg': '.mpeg',
+
         // Could be anything
         'application/octet-stream': null,
-        'video/m4v': '.m4v'
+        'application/mxf': '.mxf' // often used as exchange format by editing software
       })
     }
 
@@ -869,7 +899,7 @@ function updateWebserverConfig () {
 }
 
 function buildVideosExtname () {
-  return Object.keys(MIMETYPES.VIDEO.EXT_MIMETYPE)
+  return Object.keys(MIMETYPES.VIDEO.EXT_MIMETYPE).filter(e => e !== 'null')
 }
 
 function loadLanguages () {
index 59723358865182a10ea3cbc528ee3289f50d26ce..f5183042c15ca2446c27097561bd3a3f56f607d6 100644 (file)
@@ -371,6 +371,7 @@ describe('Test config', function () {
     expect(data.video.file.extensions).to.contain('.webm')
     expect(data.video.file.extensions).to.contain('.ogv')
     expect(data.video.file.extensions).to.contain('.flv')
+    expect(data.video.file.extensions).to.contain('.wmv')
     expect(data.video.file.extensions).to.contain('.mkv')
     expect(data.video.file.extensions).to.contain('.mp3')
     expect(data.video.file.extensions).to.contain('.ogg')