Skip to content

Non-baseline AVC video profile is not supported by Android OS, actual profile_idc: 100 #1

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

Closed
peksi opened this issue Jul 31, 2019 · 12 comments

Comments

@peksi
Copy link

peksi commented Jul 31, 2019

Hello! I'm using your react-native-transcode library and on android 9 the same error happens as mentioned in the issues on original repository:

transcoding failed Error: Non-baseline AVC video profile is not supported by Android OS, actual profile_idc: 100 ypresto#72

I'm just wondering if using that same PR which is suggested on the original repo would be relevant for you as well?
ypresto#73

Thanks in advance!

@selsamman
Copy link
Owner

Thanks for the prompt on that. Sounds like that would be a good idea. I will take a look in the next couple of days.

@selsamman
Copy link
Owner

OK so I ran my tests on Android 9 and corrected a small glitch with zero length buffers so they now run. So any ideas on how to put together a test case that would yield a non-baseline profile? Am happy to make the referenced change but want to make sure I have a way of knowing it is working.

@peksi
Copy link
Author

peksi commented Aug 5, 2019

Good question. I only tested it on a device ( Oneplus 5T ) and I assume that the camera's videoformat itself has something to do with the issue. I can provide you an example video.

@selsamman
Copy link
Owner

That would be really nice. If it could be a very short (several seconds) I can add it to the tests in the repo. I don't have android 9 on any device except the emulators and I don't see how to shoot video with the emulator.

@peksi
Copy link
Author

peksi commented Aug 6, 2019

I can replicate the issue with this video

https://www.dropbox.com/s/exnhq0u0nzmo3kv/oneplus5t_recording.mp4?dl=1

@selsamman
Copy link
Owner

Thanks for sending the file. Am still having difficulty creating a test case that fails. It seems that transcoding this video is always resulting in an output base profile of 66 (baseline) even though the referenced video is showing as high on ffprobe. Mind you I am running on an Android 9 simulator. Could you send me the transcodeVideo call you are using so i can see if there is something obvious I am missing.

@peksi
Copy link
Author

peksi commented Aug 9, 2019

Hi! You can find the code below

RNFetchBlob.config({
    fileCache: true,
  })
    .fetch(
      'GET',
      'https://www.dropbox.com/s/exnhq0u0nzmo3kv/oneplus5t_recording.mp4?dl=1',
      {},
    )
    .then(res => {
      inputFile = res.path();

      Transcode.start()
        .asset({
          name: 'A',
          path: inputFile,
          type: 'AudioOnly',
        })
        .segment(2000)
        .track({ asset: 'A' })
        .process(
          'low',
          RNFetchBlob.fs.dirs.CacheDir + '/transcoded_audio.mp4',
          progress => {
            console.log(progress);
          },
        )
        .catch(e => console.log('transcoding failed', e));
    });

@selsamman
Copy link
Owner

The closest thing I can emulate is a Nexus One running API 28 Pie. It does not fail when running this from react-native using the snippet you provided. Also I believe I should be returning an error in the case where you have only an AudioOnly file since you have to have video at present. It seems to transcode the video file anyways for me with the audio. I will look into this.

@selsamman
Copy link
Owner

selsamman commented Aug 25, 2019

After giving this much thought I decided to remove the profile checking and republished react-native-transcode. The reasoning is that the profile for encoding is as far as I can ascertain chosen by MediaCodec based on the size you specify. I am assuming that the profile depends on the codecs installed on the phone and that perhaps in the case of the OnePlus 5T it ends up being a non-standard profile when you use 1920x1080. That would seem to be the case because the file that you provided I could see had the profile set to high rather than baseline and obviously you shot that on the OnePlus 5T

Let me know if this resolves your problem.

@peksi
Copy link
Author

peksi commented Dec 30, 2019

Sorry for the late response. This resolved the problem for all of my android devices.

Thank you!

@peksi peksi closed this as completed Dec 30, 2019
@hsingh200
Copy link

hi @peksi, what you have done to resolve that issue.

@peksi
Copy link
Author

peksi commented Feb 18, 2023

Hi @hsingh200! The problem was solved by selsamman's removal of the profile checking in the code

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

No branches or pull requests

3 participants