Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using clipFrom and clipTo in mapped response when VOD is set to 'none' #1552

Open
jroigt opened this issue Dec 5, 2024 · 1 comment

Comments

@jroigt
Copy link

jroigt commented Dec 5, 2024

Hello! We are using the NGINX VOD Module v1.33 and are encountering issues when using 'vod none' and 'vod_mode mapped' together.

Problem

Our NGINX configuration is similar to this summary:

server {
    vod_mode mapped;
    vod_upstream_location /api;
    
       location /api/ {
            internal;
            rewrite ^/api/vod/mp4/(.*) /foo/$1/mapped_mp4 break;            
        }	

    location /vod/mp4/ {
          vod none;
          add_header Access-Control-Allow-Headers '*';
          add_header Access-Control-Allow-Origin '*';
          add_header Access-Control-Allow-Methods 'GET, HEAD, OPTIONS';
          add_header 'Access-Control-Expose-Headers' 'Content-Length';
    
              if ($request_method = 'OPTIONS') {
                  add_header 'Access-Control-Allow-Origin' '*';
                  add_header 'Access-Control-Max-Age' 1728000;
                  add_header 'Content-Type' 'text/plain charset=UTF-8';
                  add_header 'Content-Length' 0;
                  return 204;
              }
        }
}

And the mapped_mp4 endpoint of our API is returning something similar to this:

{
  "sequences": [
    {
      "clips": [
        {
          "type": "source",
          "path": "https://somewhere....",
          "clipFrom": 100000,
          "clipTo": 200000
        }
      ]
    }
  ]
}

We are sure that the URL, clipFrom and clipTo are correct.

However, when we attempt to access the URL of the video and NGINX receives this response from the API, we encounter the following 400 error: ngx_http_vod_map_media_set_apply: unsupported - non-trivial mapping in progressive download

Alternative

Interestingly, this issue does NOT occur when we make the following change:

We modify the mapped response by removing clipFrom and clipTo from mapped response of our API:

{
  "sequences": [
    {
      "clips": [
        {
          "type": "source",
          "path": "https://somewhere...."
        }
      ]
    }
  ]
}

And when accessing the URL of the video with the following parameters appended: /clipfrom/100000/clipto/200000, we encounter no issues, and the MP4 is returned correctly trimmed without any errors.

Any idea about this case? 😃

@gstrat88
Copy link

gstrat88 commented Jan 8, 2025

you can embed this options (/clipfrom/100000/clipto/200000)
in the root level of the playlist, i have also found some minor issues when using clipFrom in the clip item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants