anchor.diff:  get_stages_number(_) -> 1.
   
   % @hidden
  -thumbnails_finalize({ok, In, _Out}, {Movie, OutName, Options, FunOrPid, CmdOptions}) ->
  +thumbnails_finalize({ok, In, _Out}, {Duration, OutName, Options, FunOrPid, CmdOptions}) ->
     Every = buclists:keyfind(every, 1, Options, 1),
     OutPath = buclists:keyfind(out_path, 1, Options, "."),
     AssetsPath = buclists:keyfind(assets_path, 1, Options, ""),
  
positive.code:           bucfile:remove_recursive(SpritesPath),
            {error, In, OutName, output_vtt_error}
        end;
      {{ok, _}, Error} ->
        error_logger:error_msg("Failed to retrieve video duration when generating thumbnails: ~p", [Error]),
        bucfile:remove_recursive(SpritesPath),
        {error, In, OutName, source_duration_unavailable};
      {Error, _} ->
        error_logger:error_msg("Failed to retrieve sprite infos when generating thumbnails: ~p", [Error]),
        bucfile:remove_recursive(SpritesPath),
        {error, In, OutName, sprite_creation_error}
  
negative.code:                      Other ->
                         Other
                     end,
    case vice:info(Movie, duration, [{type, video}|allowed_extensions(Movie)]) of
      {ok, Duration} when Duration > Every ->
        case bucfile:make_dir(SpritesPath) of
          ok ->
            SpritesFiles = filename:join(SpritesPath, "%016d.png"),
            CmdOptions = [{ref, erlang:make_ref()}, {on, get_stages_number(Sprite)}],
            case vice:convert(Movie, SpritesFiles, [{output_format, "image2"},
                                                    {video_filtergraph, <<"fps=1/", (bucs:to_binary(Every))/binary, ",scale=", (bucs:to_binary(Width))/binary, ":-1">>},
                                                    {type, video},
                                                    {cmd_options, [{stage, 1}|CmdOptions]}
                                                    |allowed_extensions(Movie)],
                              {fun ?MODULE:thumbnails_finalize/2, {Duration, OutName, Options, ResultFunOrPid, CmdOptions}}) of
              {async, Ref} ->
                case is_pid(ResultFunOrPid) of
                  true ->
                    receive
                      {ok, _In, Out} -> {ok, Out};
                      {error, _In, _Out, Code} -> {error, Code};
                      Unknow -> {error, {invalid_response, Unknow}}
                    end;
                  false ->
                    {async, Ref}
                end;
              Error ->
                Error
            end;
          Error ->
            Error
        end;
      {ok, Duration} ->
        error_logger:error_msg("Every parameter is bellow video duration => ~p", [Duration]),
        {error, Duration};
      Error ->
        error_logger:error_msg("Failed to retrieve video duration when generating thumbnails: ~p", [Error]),
        Error
    end.
  
  