GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP Ninjas Inside! (https://gfy.com/showthread.php?t=902306)

Killswitch - BANNED FOR LIFE 04-28-2009 08:30 AM

PHP Ninjas Inside!
 
I've been racking my brain over this for the last 3 days, I'm working on some stuff and my local server has ffmpeg so I have a wrapper class already made to use that... but the actual server doesn't allow ffmpeg, the host wont do it, and yes, I know, the host needs changed, but for now, it can't not to mention I want to get this working with ffmpeg anyway!

How the fuck do you get the flv length without ffmpeg? I've gotten it down to opening the file, reading so much of it to grab the duration line, but I get a bunch of bullshit and cannot figure out for the life of me to convert it to something readable.

Here's what I got so far:
Quote:

duration�@f\)�width�@??������height�@~������ �
Any help is appreciated and credit will be given.

quantum-x 04-28-2009 08:38 AM

Hah: This is going to be fun.
First, you're going to have to be reading in binary mode.
Second, you're going to have to scratch of up on little and big endian notation.

Third, you'll find out the strpos etc completely aren't binary safe.

My recommendation?

Do a GFY search on my name, find where I posted my movie anti-piracy script.
It's got a bunch of classes written exactly for this: loading a movie, and doing binary searches inside the movie, and pulling out data.

That will probably sold your problem entirely.

Killswitch - BANNED FOR LIFE 04-28-2009 08:49 AM

Awesome, Thanks man.

quantum-x 04-28-2009 09:30 AM

Quote:

Originally Posted by Killswitch (Post 15796477)
Awesome, Thanks man.

OK, just because I'm feeling like a ninja:
This requires my VPX package as mentioned before.

PHP Code:

<?
 require_once('./VPX/VPX.php');
 $VPX = new VPXBase('C:\TEMP\finalCut.flv');
 $VPX->Seek($VPX->SeekString(pack('H*','40443D4FDF3B645A')));
 $duration    =    BigEndian2Float($VPX->Read(8));
 var_dump($duration);
?>

Will output something like:
float(40.479)

Game over ;)

ExLust 04-28-2009 09:48 AM

Thanks for sharing.

Killswitch - BANNED FOR LIFE 04-28-2009 09:49 AM

Quote:

Originally Posted by quantum-x (Post 15796645)
OK, just because I'm feeling like a ninja:
This requires my VPX package as mentioned before.

PHP Code:

<?
 require_once('./VPX/VPX.php');
 $VPX = new VPXBase('C:\TEMP\finalCut.flv');
 $VPX->Seek($VPX->SeekString(pack('H*','40443D4FDF3B645A')));
 $duration    =    BigEndian2Float($VPX->Read(8));
 var_dump($duration);
?>

Will output something like:
float(40.479)

Game over ;)

Haha, thanks, I just gotta go through your code and remove what I don't need, I hate extra code :D

Will give you credit, any special url you want me to put in the source code?

quantum-x 04-28-2009 09:55 AM

Quote:

Originally Posted by Killswitch (Post 15796730)
Haha, thanks, I just gotta go through your code and remove what I don't need, I hate extra code :D

Will give you credit, any special url you want me to put in the source code?

Depends how you're releasing it I guess. Commercial product, let's talk.
Small script to get something done: credits to lemonparty.org :winkwink:

Killswitch - BANNED FOR LIFE 04-28-2009 10:21 AM

Quote:

Originally Posted by quantum-x (Post 15796772)
Depends how you're releasing it I guess. Commercial product, let's talk.
Small script to get something done: credits to lemonparty.org :winkwink:

Personal script... It's for my own site, most likely won't be sold due to the amount of work I'm putting into it, and your code may possibly be removed before it gets sold if it does and replaced with my ffmpeg wrapper. So it's mostly just to remind me that snippet of code was from you.

nation-x 04-28-2009 10:24 AM

Quote:

Originally Posted by quantum-x (Post 15796645)
OK, just because I'm feeling like a ninja:
This requires my VPX package as mentioned before.

PHP Code:

<?
 require_once('./VPX/VPX.php');
 $VPX = new VPXBase('C:\TEMP\finalCut.flv');
 $VPX->Seek($VPX->SeekString(pack('H*','40443D4FDF3B645A')));
 $duration    =    BigEndian2Float($VPX->Read(8));
 var_dump($duration);
?>

Will output something like:
float(40.479)

Game over ;)

edit... nevermind... I actually read the thread AFTER I posted because I am tarded today

munki 04-28-2009 10:35 AM

And that is ninja style done right...

quantum-x 04-28-2009 10:36 AM

Quote:

Originally Posted by Killswitch (Post 15796852)
Personal script... It's for my own site, most likely won't be sold due to the amount of work I'm putting into it, and your code may possibly be removed before it gets sold if it does and replaced with my ffmpeg wrapper. So it's mostly just to remind me that snippet of code was from you.

No credit necessary then :)

Killswitch - BANNED FOR LIFE 04-28-2009 10:50 AM

Quote:

Originally Posted by quantum-x (Post 15796889)
No credit necessary then :)

GOD DAMNIT MAN!

PHP Code:

<?php
/*
Quantum-X from GFY supplied the code to do this shizzat mofacka,
but he's to big of a poopoo head to take the credit 
so heres where you got the code stupid mcfuckface!
http://www.gfy.com/showthread.php?t=902306
*/
$Ninja->GetDuration($flv);
?>

:mad::mad::mad:

quantum-x 04-28-2009 10:57 AM

Quote:

Originally Posted by Killswitch (Post 15796939)
GOD DAMNIT MAN!

PHP Code:

<?php
/*
Quantum-X from GFY supplied the code to do this shizzat mofacka,
but he's to big of a poopoo head to take the credit 
so heres where you got the code stupid mcfuckface!
http://www.gfy.com/showthread.php?t=902306
*/
$Ninja->GetDuration($flv);
?>

:mad::mad::mad:

Actually what I was really trying to avoid was having my nickname in a script that I didn't control.. I've been trying to clean up my google record ;)

Killswitch - BANNED FOR LIFE 04-28-2009 11:01 AM

Quote:

Originally Posted by quantum-x (Post 15796957)
Actually what I was really trying to avoid was having my nickname in a script that I didn't control.. I've been trying to clean up my google record ;)

I fixed it for you :thumbsup

PHP Code:

<?php
/*
BLEEEP from BLEEEEP supplied the code to do this BLEEEEP BLEEEEP,
but he's to big of a BLEEEEP head to take the credit 
so heres where you got the code stupid BLEEEEP!
http://www.gfy.com/showthread.php?t=902306
*/
$Ninja->GetDuration($flv);
?>


quantum-x 04-28-2009 11:03 AM

Quote:

Originally Posted by Killswitch (Post 15796973)
I fixed it for you :thumbsup

PHP Code:

<?php
/*
BLEEEP from BLEEEEP supplied the code to do this BLEEEEP BLEEEEP,
but he's to big of a BLEEEEP head to take the credit 
so heres where you got the code stupid BLEEEEP!
http://www.gfy.com/showthread.php?t=902306
*/
$Ninja->GetDuration($flv);
?>


That's cool :winkwink:


All times are GMT -7. The time now is 10:44 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123