Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 04-28-2009, 08:30 AM   #1
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
:stop 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.
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2009, 08:38 AM   #2
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
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.
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2009, 08:49 AM   #3
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
Awesome, Thanks man.
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2009, 09:30 AM   #4
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by Killswitch View Post
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 ;)
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2009, 09:48 AM   #5
ExLust
Confirmed User
 
ExLust's Avatar
 
Join Date: Aug 2008
Posts: 3,223
Thanks for sharing.
__________________

BE A PARTNER
ExLust is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2009, 09:49 AM   #6
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
Quote:
Originally Posted by quantum-x View Post
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?
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2009, 09:55 AM   #7
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by Killswitch View Post
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
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2009, 10:21 AM   #8
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
Quote:
Originally Posted by quantum-x View Post
Depends how you're releasing it I guess. Commercial product, let's talk.
Small script to get something done: credits to lemonparty.org
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.
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2009, 10:24 AM   #9
nation-x
Confirmed User
 
nation-x's Avatar
 
Industry Role:
Join Date: Mar 2004
Location: Rock Hill, SC
Posts: 5,370
Quote:
Originally Posted by quantum-x View Post
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

Last edited by nation-x; 04-28-2009 at 10:25 AM..
nation-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2009, 10:35 AM   #10
munki
Do Fun Shit.
 
munki's Avatar
 
Industry Role:
Join Date: Dec 2004
Location: OC
Posts: 13,393
And that is ninja style done right...
__________________

I have the simplest tastes. I am always satisfied with the best. -Oscar Wilde
munki is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2009, 10:36 AM   #11
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by Killswitch View Post
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
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2009, 10:50 AM   #12
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
Quote:
Originally Posted by quantum-x View Post
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);
?>
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2009, 10:57 AM   #13
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by Killswitch View Post
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);
?>
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 ;)
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2009, 11:01 AM   #14
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
Quote:
Originally Posted by quantum-x View Post
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

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);
?>
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2009, 11:03 AM   #15
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by Killswitch View Post
I fixed it for you

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
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright 2000- Jelsoft Enterprises Limited.