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

REST API - VOD Post Create #2364

Closed
ghost opened this issue Jul 22, 2020 · 3 comments · Fixed by #2365
Closed

REST API - VOD Post Create #2364

ghost opened this issue Jul 22, 2020 · 3 comments · Fixed by #2365

Comments

@ghost
Copy link

ghost commented Jul 22, 2020

Short description

testing the VOD of the application. I downloaded a mp4 to the server. When I run the following command I get a response telling me that it "notMp4File". I have tried this from a remote computer as well just now and same issue.

Environment

  • Operating system and version: Ubuntu 18.04
  • Java version:
    openjdk version "11.0.7" 2020-04-14
    OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-2ubuntu218.04)
    OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-2ubuntu218.04, mixed mode, sharing)
  • Ant Media Server version: Community Edition 2.1.0 20200720_1340
  • Browser name and version: NA

Steps to reproduce

  1. curl -i -X POST -H "Content-Type: multipart/form-data" -F "Mp4=@BBB.Mp4" localhost:5080/LiveApp/rest/v2/vods/create/

Screenshot from 2020-07-22 15-04-43

Expected behavior

Upload file to host and index in VOD portion of the database.

Actual behavior

{"success":false,"message":"notMp4File","dataId":null,"errorId":0}

Logs

Place logs on pastebin or elsewhere and put links here

Join Google Group and be a part of Ant Media Server Community.

@ghost ghost mentioned this issue Jul 22, 2020
@muratugureminoglu
Copy link
Collaborator

muratugureminoglu commented Jul 23, 2020

Hi, you need to add a stream name to the API URL.

example usage:
curl -L -X POST 'http://localhost:5080/WebRTCAppEE/rest/v2/vods/create?name=example.mp4' -H 'Content-Type: multipart/form-data' -F 'file=@example.mp4'

Regards.

@mekya
Copy link
Contributor

mekya commented Jul 23, 2020

Yeah rest api is case sensitive about checking the extension of the upload.
It's is like this.

if ("mp4".equals(fileExtension))

and I've changed it to

if ("mp4".equalsIgnoreCase(fileExtension))

It will be available likely in next snapshot. Community snapshots are deployed here automatically
https://oss.sonatype.org/#nexus-search;gav~io.antmedia~ant-media-server~~~~kw,versionexpand

Enterprise snapshots are deployed in a private area.

@ghost
Copy link
Author

ghost commented Jul 24, 2020

I was missing the name variable to the end of the post

curl -L -X POST 'http://localhost:5080/WebRTCAppEE/rest/v2/vods/create?name=example.mp4' -H 'Content-Type: multipart/form-data' -F 'file=@example.mp4'

Thanks for the help

@ghost ghost closed this as completed Jul 24, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants