Log in

View Full Version : modify frames in mpeg4 without writing the whole file to disk


thommyfilm
4th June 2008, 15:20
hello

we want to achieve a very tricky thing. no one was able to offer a real solution for this up to now. so it's a real challenge!

we're looking for a system that can do the following:

1. a user clicks on a movie download link for on a website (php/mysql)
2. some information is pulled out of a database
3. a short movie (3 secs) containing this info as a title is generated (we currently do this with quartz under os x)
4. this short movie is connected with a very long movie (90 min 1 gb) that is already encoded with the same parameters
5. the download of the new movie (short and long conntected to one movie) begins

and now it comes: this has to happen very fast (ca. 5 secs). we only found solutions where the two movies have to be written down to a new file, before the download starts. even with a fast machine this is very time consuming. it also needs a lot of storage.

is there a possebility to do this directly?
we imagine something like modifying mp4box to accept two files as an input then ultimately generating the mpeg4 header and passing it on to the webserver to start with the download. can the movie information be pulled out of the two existing files? for the user it has to be like just downloading one file.

currently we have a os x leopard server. we would also be ready to switch to linux.


cu t.

Doom9
4th June 2008, 16:59
You might wanna pick a title that's more descriptive of what you're trying to do in order to get people to help you.

Dark Shikari
4th June 2008, 17:27
He also might want to not crosspost into three forums.

DigitAl56K
4th June 2008, 17:33
Can you access files on the server with PHP/ZEND or through Apache plug-ins directly? If so then you could probably write your own handlers for GET requests, taking into account headers such as accept-range, and then serve the right parts of each file directly without a write down.

I've done a very small project with ZEND and it's basically just C, so unless your system is really locked down with something like an SELINUX policy that prevents Apache modules accessing the filesystem you need it should easily be doable in the worst case by passing some arguments off to a custom PHP function that serves these two files as a single response.

cdanddvdpublisher
5th June 2008, 03:30
Not sure what to offer; you may want to be more specific

thommyfilm
5th June 2008, 16:50
hello cdanddvdpublisher

may be i was too specific? i'm just looking for an easy solution to do the following:

a user clicks on a link on a website. he gets a link to a mpeg4 movie file that has special information for him: there is a special title at the beginning of the movie (ca. 3 secs).

would be cool if the user would not have to wait to long for the download link to appear (ca. 10 secs). the movie is around 90 minutes long. so it is around 1 gb size. i'm looking for a solution that can do this without creating to much harddisk activity on the server. if 1 gb have to bee copied it takes very long for the user to wait and the hds a used a lot. would be cool if a server could process several request in parallel.

cu t

DigitAl56K
8th June 2008, 01:04
Looking at the Apache API what I wrote before doesn't seem like a good plan, don't waste time on it because I think you'll still have to write the file to avoid burning memory on the response through the module API. In my opinion the result of this "personalization" will be at the very least annoying and possibly even a method for applying DRM to videos, so I'm no longer inclined to help you with it. Good luck though.

thommyfilm
8th June 2008, 07:40
hello DigitAl56K

looking at the apache api seemed to be a good idea. this has nothing to do with drm. it is a very useful application.

smok3
8th June 2008, 10:49
and you can't apply that title with soft subtitles because?

thommyfilm
8th June 2008, 19:31
hm thats an interesting idea. the information belongs more to the movie itself. subtitles would not be the place where one expects the introduction title.

thommyfilm
12th June 2008, 08:45
an other idea: suppose the long movie is already prepared: is there a tool that can change some frames or GOPs inside an existing mpeg4/h264 file? the size and duration and everything would stay the same. just the data of a few gops is replaced. i guess like this the header would not have to be rewritten?

any thoughts?