Wowza Community

Export DVR video segment to MP4 file

Hello,

in my wowza setup I have an application configured as live-record, with the dvr plugin which stores the latest n hours of video.

Now I need the ability to export arbitrary video segments recorded with the dvr plugin, such that they are viewable with a standard media player (such as windows media player, vlc, or others).

I searched for a way to recompose the thousands of files stored in the /dvr/ folder, but without any success.

I even tried the “LiveStreamRecord” example, successfully recording videos to MP4 files, but the problem is that the user should be able to get an MP4 file of something happened before, for example he may want to download the latest 5 minutes.

Is there anyone who can suggest a way to do this?

Should I write a custom module with Wowza IDE? And if so, any suggestion on where to start?

Please note that the DVR is still needed, and that I don’t want to waste disk space recording all the streams with the dvr and in mp4!

Thanks!

Matteo

It is not currently possible to re-compose the .m4fa and .m4fv files into an MP4 file. It would require a custom module to parse and modify the atom structure of the fragmented MP4 file. I understand that additional disk space is used when you pair recording with both nDVR and live-record, but if you wish to have a final output in .MP4 format, you’ll need to continue to use StreamType live-record or the Live Stream Record module. This How to plan your nDVR workflow article describes the different recording options in Wowza Media Server.

-Lisa

Thanks for adding this. Engineering remarked that this is not guaranteed to work in future updates.

Richard

We do not have any documentation specific to the .m4fa and .m4fv files. Re-composing the .m4f* files isn’t currently supported.

-Lisa

I’ll also add that the .m4fa and .m4fv files are an internal format. I don’t know of anything planned, but it is possible that the atom structure could change in the future. Since there is a possibility of change, it is not recommended to re-compose the .m4f* files.

-Lisa

Thanks Lisa,

You say that with a custom module I could parse the atom structure of m4fa and m4fv files, but is there some documentation on how these files are made?

If it is available, this could be the best solution to my problem.

For the moment I decided to go with nDVR for about an hour of recordings, plus liveStreamRecord for the remaining hours, and I’m writing a custom module based on LiveStreamRecord to integrate wowza with our existing application.

This module splits mp4 files every some minutes, and when an user request to download a video from X to Y I can merge these small pieces together in an unique mp4 file.

Thank you,

Matteo

I managed to export wowza recorded DVR chunks to one mp4 file using the following method :

Install on you local computer or on your server the following script :

AdobeHDS.php

https://github.com/K-S-V/Scripts/blob/master/AdobeHDS.php

Download all chunks, based on manifest file, using the command :

[PHP]php AdobeHDS.php --manifest “/manifest.f4m?DVR” --delete[/PHP]

more information here : https://github.com/K-S-V/Scripts/wiki

This will produce a single mp4 file ( in flv container ).

Download the generated flv file and change flv container to mp4 using MP4tools.

http://www.emmgunn.com/mp4tools/mp4toolshome.html

Use the “MP4” tab and configure “passthrough” for video and audio track.

You can extract a specific segment of your video if needed with the same tool using the “Edit files” tab

The resulting file is proper mp4 file.

Thanks livd3o.

With your tip I was able to join the fragments into a single .flv file, and after that, to a .mp4 file.

But in my case, the audio was missing. The video was ok, but the audio not.

I’m using ubuntu 14.04, PHP 5.5.9-1ubuntu4.4, and avconv.

I tried to play the .flv and .mp4 files, and both were video ok, but mute.

Does anybody know what could be wrong?

I’m new to wowza.

Thanks in advance for any help.