Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to 7.0.0: After upgrading to version v7 the download URLs of the videos have changed. #6833

Closed
parreitu opened this issue Jan 14, 2025 · 14 comments
Labels
Status: Waiting for answer Waiting issue author answer

Comments

@parreitu
Copy link

Describe the problem

We use Moodle as our LMS. When embedding videos in Moodle, we need a URL that refers to a video with an extension, for example https://media.mydomain.com/w/1SgcqhqYJMqoUm7yrZRnZN.mp4 , but when sharing the video on peertube, the URL it generates does not have the extension at the end, it generates something like https://media.mydomain.com/w/1SgcqhqYJMqoUm7yrZRnZN , and Moodle does not recognise it as a video.

As a solution, what we have always done is to use the URL that Peertube offers when you go to download the video. In those cases it gives you a URL similar to this: https://media.mydomain.com/download/web-videos/07048dcc-cbe8-4ff6-a052-47165eebd2e4-1080.mp4

We have always done it this way and it has worked for us, although it is true that this type of views are not counted in the views of each video, but it is a minor problem.

After the update to version 7.0, we have noticed a problem that had never happened before with the updates, and that is that they have changed the download URLs of the videos, and now in the Moodle content where the video was referenced, you only see a black screen where the video should be, with a message that says that the referenced video does not exist.

I remember that during the update process, at one point I saw that the videos were being re-encoded, so I suspect that this process has been responsible for modifying the download URLs of all the videos I have on my Peertube instance.

If this is the case ?

Thanks !!

Additional information

  • PeerTube instance URL:
  • PeerTube version: 7.0.0
  • NodeJS version: 22.12.0-1
  • Ffmpeg version: 6.1.1-3ubuntu5
  • Redis version: 7.0.15
  • PostgreSQL version: 16.6
  • Classic installation
@Chocobozzz
Copy link
Owner

Is there any way to revert the change of URLs automatically ?

No sorry. The video file name changes when the file changes, to correctly invalidate caches.

You can't use an iframe in Moodle to integrate the PeerTube player?

@Chocobozzz Chocobozzz added the Status: Waiting for answer Waiting issue author answer label Jan 14, 2025
@parreitu
Copy link
Author

Hi @Chocobozzz

In Moodle you have lots of resources, for example books or pages. In this kind of resources, you can use an iframe.

But there are other resources, better for education, for example H5P interactive video, and they need the URL of the video, and in this case you can not use an iframe ...

Thanks !

@stevespaw
Copy link

Wow I have never seen this H5P.. This looks really interesting. It seems to me the best fix is to get the H5P people to support a Peertube destination as they do with YouTube on their home page example. https://h5p.org/
My 2 cents... I guess you have tried a peertube link like: https://tv.dyne.org/w/xo6cx5rEXfgm7a7aVP9Cs4

@parreitu
Copy link
Author

parreitu commented Jan 14, 2025

Hi

I've tried it, but the message is clear: "video format not supported"

The only way to embed a peertube video in a h5p content, is to use the download url of the video, but in this last update (in the previous ones I have had no problem and we have been using peertube for four years), all the download links in all the videos we have uploaded have been changed

@stevespaw
Copy link

Have you tried a feature request for them to support Peertube instances?

@stevespaw
Copy link

@parreitu
Copy link
Author

No, in principle, and given that peertube videos can be downloaded in mp4 format, which is valid for embedding in h5p, I thought maybe there would be a way to get a sharing url with that format in peertube.

@parreitu
Copy link
Author

Do they support HLS (M3U8) video Url's like https://tv.dyne.org/static/streaming-playlists/hls/fe20dd86-5bfc-41ed-86d5-995fd297d487/9f9d673c-ff76-4aae-8c13-1ba85e1d2e38-master.m3u8

no, this format is not valid either

@stevespaw
Copy link

No, in principle, and given that peertube videos can be downloaded in mp4 format, which is valid for embedding in h5p, I thought maybe there would be a way to get a sharing url with that format in peertube.

If you have the new "separate audio" turned on and no other formats - the new mp4's may also not work as expected.

It seems that you may need some middleware -

@Chocobozzz
Copy link
Owner

Merging this issue in #6701

FYI the issue for H5P PeerTube support is h5p/h5p-video#40

@parreitu
Copy link
Author

Hi @Chocobozzz
One last question. I understand that it is not advisable to use the download URL of a video as a permanent link, because in the future it is likely to change again, is that right?

@Chocobozzz
Copy link
Owner

One last question. I understand that it is not advisable to use the download URL of a video as a permanent link, because in the future it is likely to change again, is that right?

Yes it can change if the video is re-transcoded for example

@EricGuic
Copy link
Contributor

EricGuic commented Jan 17, 2025

I'm facing the same problem, also for Moodle and H5P final destinations.
I guess the better way to handle it is to get H5P team to support Peertube, but the issue created there doesn't show any evolution...

@Chocobozzz : just to be sure :
- upgrading to 7.x.x will change all the download url of all already existing videos ?
- under 6.3.2 : if I replace the media of an already existing video, does the "download url" change ?

If so, could this behavior be changed (regarding the cache invalidation) :
here is for example the download url accessible to the public :
https://mydomain.tld/download/streaming-playlists/hls/videos/XXXXX-XXXXX-XXXXX-1080-fragmented.mp4
Peertube "knows" that this url points to :
https://s3........myoriginalmedia
But as this "S3" path isn't serve to the public, why can't it be change in database in case of a video replace, it will become :
https://s3........mynewmedia
and the original download url could stay the same ? No ?

Sorry if there is an obvious reason (as I'm not a dev), if so just tell me and don't waste time explaning.
Thanks.

@EricGuic
Copy link
Contributor

Hi @parreitu,
In your original message, you wrote : "I remember that during the update process, at one point I saw that the videos were being re-encoded"

Why is that ? During the upgrade, do you switch your default config from "only web-video" to "only HLS" transcoding for example ? Or something else ?
If not, is this new transcode a mandatory step during the upgrading process to v7 ? (I must prevent the download url to change for the same reason).
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Waiting for answer Waiting issue author answer
Projects
None yet
Development

No branches or pull requests

4 participants