Creating videos with ffmpeg when FPS is below 25
Creating videos with ffmpeg when FPS is below 25
Hello,
This issue has been spread out in various threads for a long time, one of the latest being
http://www.zoneminder.com/forums/viewtopic.php?t=4013
In order to use ZM professionally this would be a problem to solve. Therefore I think the subject deserves a separate thread.
Problem: by default ffmpeg refuses to generate a video when the frame rate is below the standard (24 or 25 AFAIK). This situation is usual when using surveillance cameras.
It is possible to circumvent this by using the -strict -1 parameter in the ffmpeg command line. This method however creates a video clip that does not conform to MPEG2 specification and therefore does not work in commercial (windows) players and codecs even if it would work with Linux players.
The -strict parameter is poorly documented in the ffmpeg documentation. It is only said that values -1, 0 and 1 may be given. But what do they actually do?
Does anyone know a way to create a video (whatever video format is OK) when the FPS rate is well below the 25 FPS rate so that
1) it would be compatible with the standard?
2) the video would maintain the time sync (a second in the ZM screen clock would be a second when playing the video)?
I have a way to do this using command line using mpeg2enc but without the timestamps in the ZM database. Therefore the time sync does not work with this method.
In my opinion the ability of exporting stardards compliant video is needed when you need to take the clip of a burglar etc. to police that is using WinXP with Windows Media Player.
This issue has been spread out in various threads for a long time, one of the latest being
http://www.zoneminder.com/forums/viewtopic.php?t=4013
In order to use ZM professionally this would be a problem to solve. Therefore I think the subject deserves a separate thread.
Problem: by default ffmpeg refuses to generate a video when the frame rate is below the standard (24 or 25 AFAIK). This situation is usual when using surveillance cameras.
It is possible to circumvent this by using the -strict -1 parameter in the ffmpeg command line. This method however creates a video clip that does not conform to MPEG2 specification and therefore does not work in commercial (windows) players and codecs even if it would work with Linux players.
The -strict parameter is poorly documented in the ffmpeg documentation. It is only said that values -1, 0 and 1 may be given. But what do they actually do?
Does anyone know a way to create a video (whatever video format is OK) when the FPS rate is well below the 25 FPS rate so that
1) it would be compatible with the standard?
2) the video would maintain the time sync (a second in the ZM screen clock would be a second when playing the video)?
I have a way to do this using command line using mpeg2enc but without the timestamps in the ZM database. Therefore the time sync does not work with this method.
In my opinion the ability of exporting stardards compliant video is needed when you need to take the clip of a burglar etc. to police that is using WinXP with Windows Media Player.
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
i second this but have been able to play back 0.4.9 ffmpeg created mpegs in media player without problems. I would prefer a better media player and wouldnt have an issue telling customers that they need 9realpayer gsplayer whatever) to playback zm mpegs (for the time being anyway). Unfortunaly ffmpeg is still a beta piece of software and as such i assume changes in the way it works each release. AFAIK 0.4.8 ffmmpeg works correctly, and if Phil changes zm to work with 0.4.9 there will be another issue when 0.5 comes out.
So to my point. Is there another means of creating video that is on a non beta release that we can use as an ecoder, even if we cant use m$ media player. I have seen mention of ogg in other threads?. I dont think the issue of not using m$ media player is a huge one as virtually all comercial recorders use their own software to playback video. As long as we have a reliable place to download it and give this address to people that need to view any zm video.
JAmes
So to my point. Is there another means of creating video that is on a non beta release that we can use as an ecoder, even if we cant use m$ media player. I have seen mention of ogg in other threads?. I dont think the issue of not using m$ media player is a huge one as virtually all comercial recorders use their own software to playback video. As long as we have a reliable place to download it and give this address to people that need to view any zm video.
JAmes
Are you saying that you are able to view videos that are created with ffmpeg 0.4.9 andjameswilson wrote:i second this but have been able to play back 0.4.9 ffmpeg created mpegs in media player without problems.
1) the original framerate (in the ZM database) is less that 25 FPS
2) and you have created the videos using the "ffmpeg -strict -1" method
To me it seems that the problems begin when both of these apply.
The problem is not only the lacks and other downsides of WMP. The same thing goes for other SW too , RealPlayer for instance. It is very much possible that Linux & Open Source software can tolerate streams that are beyond the specification. That however is not a good argument for not following the standard.jameswilson wrote:I would prefer a better media player and wouldnt have an issue telling customers that they need 9realpayer gsplayer whatever) to playback zm mpegs (for the time being anyway).
In my opinion the video clips should be exportable in some standard video format. The file should be viewable by customers, police, courts, insurance companies and other technically less talented bodies and people without downloading any software. Now it does not seem to be possible.
I am trying to get some clips into Adobe Premiere for editing. Seems to be really tricky.
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
I would just mention that ZM does support ffmpeg 0.4.9 but unfortunately the data structures have changed again since the beta release. Also unfortunately the version number hasn't changed so there is no way for the ZM build scripts to figure out what they should do. There is also no guarantee that it won't change again today, and again tomorrow, so it's very difficult to track.
There is a movement afoot amongst several open source authors that use ffmpeg to try and get the ffmpeg development teams to formalise some kind of release schedule or timeline but I don't know how far along that is. The ffmpeg people can be a bit of a finickity lot as well so it might never get off the ground.
Phil
There is a movement afoot amongst several open source authors that use ffmpeg to try and get the ffmpeg development teams to formalise some kind of release schedule or timeline but I don't know how far along that is. The ffmpeg people can be a bit of a finickity lot as well so it might never get off the ground.
Phil
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
Well, I thought ffmpeg was state of the art...
LOLjameswilson wrote:well there confidence for you lol. Can we (i say we god knows why i cant do anything with it lol)/you use another encoder for mpeg or isnt there one thats any good?
James
Well, I thought Phil had a reason to choose ffmpeg as the primary encoder. I also thought mpeg_enc was a dying piece of sw.
Well - maybe I'll try that instead. Is there a RPM for the latest LiveCD version around? I tried to browse with MCC but could not find any packages including mpeg_enc.
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
after 30 seconds of searching i found this. It appears i can crete a script to creat mpegs, i will have a play tonight when i get home but i may be way off as i aint tried out like this before. I assume i can use it from that command line to create a video of the 10 minute segment from zm. It details this in a howto....
http://mjpeg.sourceforge.net/
James
https://sourceforge.net/docman/display_ ... 5776#ss4.1
http://mjpeg.sourceforge.net/
James
https://sourceforge.net/docman/display_ ... 5776#ss4.1
Thank you!
Thank you! I will try this!jameswilson wrote:after 30 seconds of searching i found this.
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
I've spent a few hours on this today and have managed to get ZM to correctly detect CVS ffmpeg sources and use the new formats. So it should be possible (at least until they change it all again) to use ZM with CVS ffmpeg if anyone wants to try it. As the ffmpeg developers have all but abandoned the formal release there may well be an enormous amount of differences in what you get out.
If anyone wants it I can post a patch, otherwise it will be in the next release. Also note that I've not actually checked it actually works yet, just compiles.
Phil
If anyone wants it I can post a patch, otherwise it will be in the next release. Also note that I've not actually checked it actually works yet, just compiles.
Phil
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK