PHP Classes

width x height => bug + fix

Recommend this page to a friend!

      PHP Video Toolkit  >  All threads  >  width x height => bug + fix  >  (Un) Subscribe thread alerts  
Subject:width x height => bug + fix
Summary:small bug
Messages:15
Author:Istvan Szakacs
Date:2008-03-30 21:22:54
Update:2008-04-02 22:02:15
 
  1 - 10   11 - 15  

  1. width x height => bug + fix   Reply   Report abuse  
Picture of Istvan Szakacs Istvan Szakacs - 2008-03-30 21:22:54
as it seems i discovered another small issue with the file information given from the function $ffmpeg->getFileInfo();

i changed line 653 to:

$dimension_parts = explode('x', trim($data["video"]["format"][2]));

now the width and height have proper values in the returned xml;

great class, thanks for all,

istvan

  2. Re: width x height => bug + fix   Reply   Report abuse  
Picture of Oliver Lillie Oliver Lillie - 2008-03-31 07:02:59 - In reply to message 1 from Istvan Szakacs
Hi Istvan,

Thanks for giving the fix, however I picked up on the issue when I made yesterdays update already. This issue should be fixed in 0.1.1, what version is this for?

  3. Re: width x height => bug + fix   Reply   Report abuse  
Picture of Istvan Szakacs Istvan Szakacs - 2008-03-31 08:26:10 - In reply to message 2 from Oliver Lillie
Hello,

well, as far as i am concerned i grabbed the very latest release... unless i downloaded an older version on sunday the bug is still around,

i was messing around with the ffmpeg-php class you provided and i got a notification this weekend some time that there has been a new version released with a couple of bug fixes and minor changes (functions i added myself last week :P but i am sure your code is cleaner than mine as i just "hooked" in some php lines).

if i am not mistaken, i grabbed the newest ffmpeg.php class file and ftp'ed it to my webserver instantly and still had this issue with the file information.

i will check it again and will reply as soon as possible.

  4. Re: width x height => bug + fix   Reply   Report abuse  
Picture of Oliver Lillie Oliver Lillie - 2008-03-31 08:38:06 - In reply to message 3 from Istvan Szakacs
If you download the latest package and copy over the demo files then run example05.php the width and heights in the video should be fixed. I updated the class and other files on Sunday around 5pm GMT

  5. Re: width x height => bug + fix   Reply   Report abuse  
Picture of Istvan Szakacs Istvan Szakacs - 2008-03-31 09:10:38 - In reply to message 4 from Oliver Lillie
Hello again

its partly fixed in your release (if i am not mistaken):

this is the array which is returned from the fileinfo fkt:

Array ( [duration] => Array ( [seconds] => 17.1 [timecode] => Array ( [rounded] => 00:00:17 [seconds] => Array ( [exact] => 00:00:17.1 [excess] => 1 ) [frames] => Array ( [exact] => 00:00:17.0 [excess] => 0 ) ) ) [bitrate] => 172 kb/s [video] => Array ( [format] => Array ( [0] => wmv3 [1] => yuv420p [2] => 160x120 [3] => 163 kb/s ) [dimensions] => Array ( [width] => 15 [height] => 0 ) [frame_rate] => 0 [frame_count] => 0 ) [audio] => Array ( [stereo] => 1 [frequency] => 0 [format] => Array ( [0] => wmav2 [1] => 8000 Hz ) ) )

as you can see, the

$xx["format"][2] has a proper value (=160x120) which can be exploded to gather the x y values, thats right! this ["format"][2] and [3] were added in the current release as far as i can recall the older release.

the problem which i ment:
[dimensions] => Array ( [width] => 15 [height] => 0 )

as of it looks frame_rate, frame_count do not give any valueable information by now aswell

but there is still the "dimensions" part which displays ["width"] => 15, ["height"] => 0, either these values are no more needed and can be dropped out of your code or my fix provided in the very first post fixes this issue which seems to be still about.

thanks again, bye istvan

  6. Re: width x height => bug + fix   Reply   Report abuse  
Picture of Oliver Lillie Oliver Lillie - 2008-03-31 11:20:35 - In reply to message 5 from Istvan Szakacs
hmmm, there must be differences in the way the ffmpeg releases this information in differing versions/os's because it's fine here on mac os x, this is what i get for the first video in example05.php

Array
(
[duration] => Array
(
[seconds] => 10.4
[timecode] => Array
(
[rounded] => 00:00:10
[seconds] => Array
(
[exact] => 00:00:10.4
[excess] => 4
)

[frames] => Array
(
[exact] => 00:00:10.4
[excess] => 4
)

)

)

[bitrate] => 78 kb/s
[video] => Array
(
[format] => Array
(
[0] => h263
[1] => yuv420p
)

[dimensions] => Array
(
[width] => 176
[height] => 144
)

[frame_rate] => 10
[frame_count] => 104
)

[audio] => Array
(
[stereo] =>
[frequency] => 8000
[format] => Array
(
[0] => amr_nb
)

)

)

you see everything is correct.

can you post what you get if you enter

xxx/your/ffmpeg/binary/path -i xxx/your/file/path

into your command line please. what os are you running this on?

  7. Re: width x height => bug + fix   Reply   Report abuse  
Picture of Istvan Szakacs Istvan Szakacs - 2008-03-31 11:37:50 - In reply to message 6 from Oliver Lillie
[root@AHN003 /]# ffmpeg -i /var/www/vhosts/**********/subdomains/silvia/httpdocs/6/29/1.wmv
FFmpeg version SVN-r12559, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared
libavutil version: 49.6.0
libavcodec version: 51.53.0
libavformat version: 52.12.0
libavdevice version: 52.0.0
built on Mar 26 2008 19:19:59, gcc: 3.4.6 20060404 (Red Hat 3.4.6-9)

Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)
Input #0, asf, from '/var/www/vhosts/hot-amateure.com/subdomains/silvia/httpdocs/6/29/1.wmv':
Duration: 00:00:03.9, start: 3.100000, bitrate: 701 kb/s
Stream #0.0: Audio: wmav2, 44100 Hz, stereo, 64 kb/s
Stream #0.1: Video: wmv2, yuv420p, 360x288, 25.00 tb(r)
Must supply at least one output file

// ---

seems i encounter some other problem or is it an os (=redhat 3.4.6-9) based known issue?
=> Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)

i havnt teste ffmpeg in all its functions by now, but converting to flv works fine, file info works aswell (apart from this issue)

mplayer, a few codecs etc. are installed correctly as of it looks

  8. Re: width x height => bug + fix   Reply   Report abuse  
Picture of Istvan Szakacs Istvan Szakacs - 2008-03-31 11:42:58 - In reply to message 7 from Istvan Szakacs
oops now the url is included in the msg aswell :P unlucky me... doesnt matter really at all ;o(

hope this "snapshot" was helpful.

  9. Re: width x height => bug + fix   Reply   Report abuse  
Picture of Oliver Lillie Oliver Lillie - 2008-03-31 16:23:28 - In reply to message 8 from Istvan Szakacs
hah, no worries. I will look at this sometime tomorrow.

  10. Re: width x height => bug + fix   Reply   Report abuse  
Picture of Oliver Lillie Oliver Lillie - 2008-03-31 16:27:07 - In reply to message 9 from Oliver Lillie
I've taken a quick look already. It seems to be your output that is the problem. I shall tidy up the regex to make it work with both your output and mine. I'll update the class shortly.

 
  1 - 10   11 - 15