How I can conver the video duration in django to the hourse and minutes and seconds in django

Viewed 59

I get the video duration when the user upload the form by VideoFileClip but it's appear by seconds how I can divide this seconds on minutes and hourse whith seconds, Ther is filter to do this in the template or I create it in the view

 if 'submit_v_form' in request.POST:
    print(request.POST)
    V_form = Video_form(request.POST, request.FILES)
    if V_form.is_valid():
        instance = V_form.save(commit=False)

        video = request.FILES['video']
        clip = VideoFileClip(video.temporary_file_path())
        instance.video_duration = clip.duration

        instance.author = account
        instance.save()
        V_form.save_m2m()
        V_form = Video_form()
        video_added = True

        if instance.save:
            return redirect('home')
0 Answers
Related