CLI create-transcoding-job.js gives sucessful jobs yet no new resolution in the player

I used create-transcoding-job.js to try either a manual a specific resolution or hls playlist. When I check as root the jobs are completed :

  "type": "hls",
  "videoUUID": "40d4a041-7107-4bf5-88df-1cfb2dff7476",
  "resolution": 1080,
  "isPortraitMode": false,
  "copyCodecs": false


« type »: « new-resolution »,
« videoUUID »: « 40d4a041-7107-4bf5-88df-1cfb2dff7476 »,
« isNewVideo »: false,
« resolution »: « 720 »

yet when I access the video I only see the original 1080p60fps.

New file seems to be there

root@ns3031697:/transition/peertube/peetube# ls docker-volume/data/videos/40d* -lrth
-rw-r–r-- 1 systemd-coredump systemd-coredump 238M Apr 21 15:28 docker-volume/data/videos/40d4a041-7107-4bf5-88df-1cfb2dff7476-1080.mp4
-rw-r–r-- 1 systemd-coredump systemd-coredump 120M Apr 21 16:14 docker-volume/data/videos/40d4a041-7107-4bf5-88df-1cfb2dff7476-720.mp4

PS: After my server upgrade I switched transcoding to 4 threads and using top I noticed they were indeed used. My goal now is to transcode in batches some older high resolution videos over night. Unfortunately I want them to also become viewable.

Well… I must have made mistake and maybe overwrite some files with rsync because … after trying another transcoding job it’s all there.

PS : if you need to batch transcode after an update and can handle more formats here is an example

for V in $(ls docker-volume/data/videos/ | sed "s/-[0-9]\+.mp4//" | sort | uniq | head -3); do docker-compose exec -u peertube peertube npm run create-transcoding-job -- --generate-hls -v $V ; done

If you are confident that it works well remove | head -3 and instead of doing only 3 videos it should go through all videos on your server. Make sure you have enough threads to both transcode and serve existing content before starting this!

PS : be cautious, as far as I can tell the transcoding job makes no attempt at verifying if videos have already been transcoded. Consequently if you run the same transcoding job twice, it will done twice even though it is not needed. You have to keep track yourself of what still have to be done.

1 Like

PPS : it seems I misunderstood the CLI tools. I haven’t tried yet but from what I understand I have to use create-transcoding-job then create-import-video-file-job otherwise the transcoded video file is on the filesystem but not accessible. Due to a server backup issue I’ll try this method relying on

In fact as I’m trying to merge 2 partial backups I assume whenever I find a video that is transcoded but unavailable via the interface I’ll try create-import-video-file-job to make it available again.

From what I can tell it adds to the queue the video-file-import task which in turns call processVideoFileImport handler and finally updateVideoFile setting metadata and copying the file.