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

[iOS] Error: Error Domain=AVFoundationErrorDomain Code=-11832 "Cannot Open" UserInfo={NSLocalizedFailureReason=This media cannot be used., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x600000ddeaf0 {Error Domain=NSOSStatusErrorDomain Code=-12431 "(null)"}} #117

Open
tacianoscur opened this issue Aug 15, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@tacianoscur
Copy link

Describe the bug
Getting this error when creating thumbnail for remote MP4 video on iOS, only happens for some videos:

[Error: Error Domain=AVFoundationErrorDomain Code=-11832 "Cannot Open" UserInfo={NSLocalizedFailureReason=This media cannot be used., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x600000ddeaf0 {Error Domain=NSOSStatusErrorDomain Code=-12431 "(null)"}}]

To Reproduce
Steps to reproduce the behavior:

  1. Call createThumbnail with a remote url for an mp4 video (I can send you the url if needed)

Version
react native 0.72.11
react-native-create-thumbnail ^2.0.0

Expected Results
Should create the thumbnail like with all the other videos.

Snack, code example, screenshot, or link to a repository

import { createThumbnail } from 'react-native-create-thumbnail';
const createdThumbnail = await createThumbnail({
      url: video.url,
});
@tacianoscur tacianoscur added the bug Something isn't working label Aug 15, 2024
@LianVyv
Copy link

LianVyv commented Aug 31, 2024

@tacianoscur I believe you missing a timestamp

const createdThumbnail = await createThumbnail({
      url: video.url,
      timeStamp: 0, // capture the thumbnail at the beginning of the video
});

@oneeb-asad
Copy link

I'm also facing this issue have you find any solution for this?

P.S: adding timestamp didn't resolved my problem

@tacianoscur
Copy link
Author

@LianVyv I have added many timestamps but same error every time.

@Satyajeetsinh-9
Copy link

Hello ,
i am facing same issue on IOS with mp4 file plus adding timestamp also did not resolve this.

So anyone with any solution?

@tacianoscur
Copy link
Author

@souvik-ghosh any idea when you pretend to tackle this?

@Satyajeetsinh-9
Copy link

FYI : in my case I'm not receiving Accept-Ranges in a header from the server, which is generally required for IOS. Because when tried with a different server in API It started working.

@ngunarola
Copy link

const createVideoThumbnail = () => {
createThumbnail({
url: '',
timeStamp:100,
format:'png'
})
.then(response => console.log({ response }))
.catch(err => console.log({ err }));
}

I have tried timeStamp:100. It worked for me !!

@usmansalimLM
Copy link

const createVideoThumbnail = () => { createThumbnail({ url: '', timeStamp:100, format:'png' }) .then(response => console.log({ response })) .catch(err => console.log({ err })); }

I have tried timeStamp:100. It worked for me !!

Worked for me, eariler this actually used to work when i had the timestamp set to 10000, idk what went wrong afterwards,
changing it to 100 fixed it.
Here are my versions for reference

    "react": "18.2.0",
    "react-native": "0.71.1",
    "react-native-create-thumbnail": "2.0.0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants