chung-leong / av Goto Github PK
View Code? Open in Web Editor NEWPHP extension for encoding/decoding video through libavcodec
License: Other
PHP extension for encoding/decoding video through libavcodec
License: Other
PHP complains of memory corruption.
The subtitle transfer test case is failing
Hello, I've written a class which watermarks video, everything works well except the fact that a segmentation fault occurs in av_stream_write_pcm when processing certain videos. av_stream_write_pcm processes only several samples in such videos and then the program crashes with segmentation fault.
It looks like a memory corruption, my code is OOP and I tried to reproduce the error on a plain php code without success.
I will post my class if you will be unable to track the issue from this brief description.
The following code causes a "Illegal operation: not an array" error:
<?php
/**
* A test function
*
* @engine qb
* @local float32[2][4] $a
* @local int32[x,y] $c
*
* @return void
*
*/
function test_function() {
$a[$c->x][$c->y] = 5;
echo "$a\n";
}
qb_compile();
test_function();
?>
Release = Agnieszka A.
I tried to compile the extension for Windows x64 (PHP 5.5). This was possible by adding a lib64 directory besides the lib directory and add Zeranoe's 64-bit libs over there. I used these libs:
http://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-20130424-git-aa96439-win64-dev.7z
Then I had to tweak the config.w32 a little bit:
PHP_CL = PATH_PROG('cl', null, 'PHP_CL');
if (!PHP_CL) {
ERROR("MS C++ compiler is required");
}
X64 = probe_binary(PHP_CL, 64, null, 'PHP_CL');
if (X64) {
ADD_FLAG("LIBS_AV", "ext\\av\\win32\\ffmpeg\\lib64\\avcodec.lib");
ADD_FLAG("LIBS_AV", 'ext\\av\\win32\\ffmpeg\\lib64\\avformat.lib');
ADD_FLAG("LIBS_AV", 'ext\\av\\win32\\ffmpeg\\lib64\\avutil.lib');
ADD_FLAG("LIBS_AV", 'ext\\av\\win32\\ffmpeg\\lib64\\swscale.lib');
ADD_FLAG("LIBS_AV", 'ext\\av\\win32\\ffmpeg\\lib64\\swresample.lib');
} else {
ADD_FLAG("LIBS_AV", "ext\\av\\win32\\ffmpeg\\lib\\avcodec.lib");
ADD_FLAG("LIBS_AV", 'ext\\av\\win32\\ffmpeg\\lib\\avformat.lib');
ADD_FLAG("LIBS_AV", 'ext\\av\\win32\\ffmpeg\\lib\\avutil.lib');
ADD_FLAG("LIBS_AV", 'ext\\av\\win32\\ffmpeg\\lib\\swscale.lib');
ADD_FLAG("LIBS_AV", 'ext\\av\\win32\\ffmpeg\\lib\\swresample.lib');
}
For one video, a mkv file, the duration of both streams is -9.2233720368548E+15. The overall duration is correctly return as 7056.864.
Doing an av_stream($file, "audio") then exiting leads to divide by zero error
Passing an numeric index to av_stream_open() leads to crash on Windows
A URL that begins with mms:// will fail with a error opening for reading error. Changing the protocol to mmsh allows the live stream to open correctly. This should happen automatically.
When av_stream_write_pcm() is given a time that is smaller than possible for the number of samples already received, the extension crashes.
I am getting an error: "av_stream_open(): unable to find codec" when I try to open a *.wmv file. Is there anything I should do to make it work? OS; Windows x86, PHP 56 nts. I am using the latest 32-bits shared build by Zeranoe. The FFmpeg.exe in that build supports WMV-input.
The following code causes a "Cannot use an array as an index" error to be thrown
<?php
/**
* @engine qb
* @local float32[4] $a
* @return void
*/
function test_function() {
isset($a[1]), "\n";
}
?>
Release = Agnieszka A.
A error should be thrown instead
Target formats other than MP4 don't work, I've tryed WebM and OGV and got the
"error encountered writing file header" message.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.