]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-transcoder.ts
Merge branch 'release/v1.2.0'
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-transcoder.ts
index f9458f0ece5d8694d3cf8a8a6c949b7ec5191346..eefd32ef81a34e0785a1b2709962542b3bacd1a6 100644 (file)
@@ -3,13 +3,13 @@
 import * as chai from 'chai'
 import 'mocha'
 import { omit } from 'lodash'
-import * as ffmpeg from 'fluent-ffmpeg'
 import { getMaxBitrate, VideoDetails, VideoResolution, VideoState } from '../../../../shared/models/videos'
 import { audio, getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils'
 import {
   buildAbsoluteFixturePath,
   doubleFollow,
   flushAndRunMultipleServers,
+  generateHighBitrateVideo,
   getMyVideos,
   getVideo,
   getVideosList,
@@ -18,12 +18,10 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo,
-  webtorrentAdd,
-  generateHighBitrateVideo
+  webtorrentAdd
 } from '../../../../shared/utils'
-import { join } from 'path'
+import { extname, join } from 'path'
 import { waitJobs } from '../../../../shared/utils/server/jobs'
-import { pathExists } from 'fs-extra'
 import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants'
 
 const expect = chai.expect
@@ -323,6 +321,34 @@ describe('Test video transcoding', function () {
     }
   })
 
+  it('Should accept and transcode additional extensions', async function () {
+    this.timeout(300000)
+
+    for (const fixture of [ 'video_short.mkv', 'video_short.avi' ]) {
+      const videoAttributes = {
+        name: fixture,
+        fixture
+      }
+
+      await uploadVideo(servers[ 1 ].url, servers[ 1 ].accessToken, videoAttributes)
+
+      await waitJobs(servers)
+
+      for (const server of servers) {
+        const res = await getVideosList(server.url)
+
+        const video = res.body.data.find(v => v.name === videoAttributes.name)
+        const res2 = await getVideo(server.url, video.id)
+        const videoDetails = res2.body
+
+        expect(videoDetails.files).to.have.lengthOf(4)
+
+        const magnetUri = videoDetails.files[ 0 ].magnetUri
+        expect(magnetUri).to.contain('.mp4')
+      }
+    }
+  })
+
   after(async function () {
     killallServers(servers)
   })