6
votes

I'm trying to port FFmpeg into my NaCl module.

So far, my module linked ffmpeg and SDL libraries.

It already can play YUV format video which is directed load into memory and copy into YUVOverlay buffer (it's very easy).

Now, I want to use ffmpeg to decode video, but when I call the function avformat_open_input it returns -5 when input is URL string, such as rtmp:// or mmsh://; it returns -1052488119 when input is file name, such as /saved/tmp (I mount the file system - html5fs).


There are some questions:

  1. What means of -5 and -1052488119?
  2. If file can't open by avformat_open_input, is it possible the input type is from buffer not from file name or url string?

If I'm not clearly about my question or description, you can tell me. If you are doing the same thing or having the same problem, we can discuss together.

Thanks, Jar

2
can you post your intial code where you are open the file and container format of the file which you are trying to open. In most case avfromat_open_input should work. - praks411
I forgot to tell you, I use ffmpeg on my Native Client Module. I register these three functions. avcodec_register_all(); av_register_all(); avformat_network_init(); and call avformat_open_input function int r = avformat_open_input(&pFormatCtx, "/persistent/tmp", NULL, NULL);. I got r = -2 when input is URL, r = -1052488119 when input is mp4 file. MP4 contain h264 video and acc audio. - Jar
I found that, for configure the network is disabled and protocol only enable file. That's why I can't parse the URL as input (it returns -2). Even I enable all protocols and enable network, I still can't open file (it returns -1052488119). - Jar
Now I use URL as input, I got the return value is -5. ****What means of it?**** - Jar
I check the error code, -1052488119 means Invalid data found when processing input and -5 means Input/output error. - Jar

2 Answers

1
votes

There is a ffmpeg port in naclports. Maybe that would be useful for you?