I have made a player for stream flv movies in flash with netstream but it needs some metadata information named " keyframe " containing two array of times and positions , some flv videos have this meta data and some not , i could add the keyframe metadata with a program named "flvmdi" and player worked properly , but i can`t install this software on my server for some reasons. I know that we can add metadata to a movie with ffmpeg function in PHP . Can i use ffmpeg function in PHP to add keyframe arrays as metadata to flv file? How can we make times and positions arrays to inject to a flv file with ffmpeg in php?
Asked
Active
Viewed 2,824 times
1 Answers
-1
Using ffmpeg you could insert key frames preserving video (-vcodec copy) / audio (-acodec copy) codecs, to insert key frames at variable intervals.
e.g; each 1 second: -g 1
ffmpeg -i /INPUT.FLV -acodec copy -vcodec copy -copyts -g 1 /OUTPUT.FLV
Break the command to variables and modify your input and output file / path, the adjust the value of -g as such;
$interval = 1; // 1sec
$pI = '/usr/local/www/sitex/upload'; // Input
$pO = '/usr/local/www/sitex/encode'; // Output
$fI = 'inp.flv';
$fO = 'out.flv';
ffmpeg -i $pI+$fI -acodec copy -vcodec copy -copyts -g $interval $pO+$fO

mrhassell
- 125
- 2
-
This does not answer the question. OP asked about metadata insertion, while the command you list here does litteraly nothing, apart from creating a little bit bigger output file with exactly the same frames. – SirDarius Aug 11 '14 at 15:09