def create_sample_video(scene): print("Trying to create a sample video for scene: {}".format(scene.name)) success = ffmpeg_process.ffmpeg_create_sammple_video(scene) if success: print("Sample video for scene: {} created successfully.".format(scene.name)) else: print( "Something went wrong while trying to create video sample for scene: {}".format(scene.name))
def ffmpeg(request): if request.method == 'GET': if 'generateSampleVideo' in request.query_params: if request.query_params['generateSampleVideo']: scene_id = request.query_params['sceneId'] scene = Scene.objects.get(pk=scene_id) if scene.duration is None: success_probe = ffmpeg_process.ffprobe_get_data_without_save(scene) if success_probe: success = ffmpeg_process.ffmpeg_create_sammple_video(scene) if success: return Response(status=200) else: return Response(status=500) success = ffmpeg_process.ffmpeg_create_sammple_video(scene) if success: return Response(status=200) else: return Response(status=500)