Is there any way to install ads if other people use my r2 link?

It costs me money to store data and they are using mine for free, is there any way to insert ads into the files if they use my r2 link?

1 Like

Yes, there is a way but you have to program yourself by combining 2 pics, together (the ad and the origional pic) and sending it out in answer to GET

I was thinking the same thing if it’s picture files. If you have an Images subscription, you can add an overlay:

What about videos?

if you use python, then you can do something like this:

import moviepy.editor as mp

video = mp.VideoFileClip("video.mp4")

logo = (mp.ImageClip("baoqing.jpg")
        .set_duration(video.duration).resize(height=100)
        #.margin(right=8, top=8, opacity=1) 
        .set_pos(("left","top"))) 

final = mp.CompositeVideoClip([video, logo])
final.write_videofile("test.mp4", codec="libx264", bitrate="10000000")
2 Likes

This should help you but you need to change it into a worker but I don’t know how since I’m not familiar with npm packages sorry about that

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.