Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flv to mp4 conversion

Tags:

android

mp4

flv

I want to play the flv files in Android. So what I thought is to convert the flv file to mp4 or 3gp(for which there is a decoder in Android). OpenCore can be used to convert. I have looked into opencore code, there is a class in opencore "/android/external/opencore/fileformats/mp4/composer" to create the mp4 file. It has apis like

AddTrack 
AddSampleToTrack

I should give the input as frames, but in Flv I will get the Sorenson Video and Mp3 audio frame(after doing some trivial string operations to remove the headers). Can I use these directly as input to above apis or is there any good way to convert flv to mp4? And also I have looked into "/android/external/opencore/nodes/pvmp4ffcomposernode" but it reads from ports not able to know how to send input to this class.

Let me know your thoughts.

like image 636
Vinay Avatar asked Nov 05 '22 20:11

Vinay


1 Answers

I have solved using ffmpeg. I have ported ffmpeg and libfaac to Android. It works great.

like image 63
Vinay Avatar answered Nov 12 '22 12:11

Vinay