escaped / django-video-encoding

django-video-encoding helps to convert your videos into different formats and resolutions.
BSD 3-Clause "New" or "Revised" License
115 stars 45 forks source link

Hi , I'm trying to use django-video-encoding, but it doesn't seem to work #40

Open phaniophrero opened 1 year ago

phaniophrero commented 1 year ago

I working on a project with Django GraphQL and Nextjs and trying to build a video course platform, and I want to use this library to change resolution of videos from 4k to 480p for example.

I've been following the example code, but now I don't have any fields in the Django Admin Dashboard to upload a video or something like that, is there any documentation about how to use this library in Django and send the data through API calls to the frontend. As I've mentioned I'm using Django GraphQL ( strawberry-graphql-django ) and Nextjs with Apollo Client.

I don't really understand how can I use the documentation in my case.

If you could give me some ideas or a place where I can find some documentation for this I'd highly appreciate it.

Thank you in advance!

derek-adair commented 1 year ago

Hello!

You need more detail if anyone is going to help you here. "It doesn't work" and "How do i send data to the front-end" is not enough information for anyone to help you. You need to give code examples of what you have tried and what you expect to work. You will find these two things very helpful when soliciting for help from strangers.

MY BEST GUESS is that you need to register your Video Models with the admin UI.

from django.contrib import admin
from video_encoding.admin import FormatInline

from .models import Video

@admin.register(Video)
class VideoAdmin(admin.ModelAdmin):
   inlines = (FormatInline,)

   list_dispaly = ('get_filename', 'width', 'height', 'duration')
   fields = ('file', 'width', 'height', 'duration')
   readonly_fields = fields

But you also may be asking for help on how to... write... a graphQL api? I dunno... good luck. Probably try stack overflow for these types of questions.

derek-adair commented 1 year ago

If you'd like to see how I've implemented this project you can check out Medialogue. I've leveraged this project and put it into a docker container and should be up and running for you to poke around in one command (assuming you have docker set up). The demo instructions are here