ffmpeg video output to a specific path

Forum for questions and support relating to the 1.27.x releases only.
Locked
mcll
Posts: 33
Joined: Tue Feb 11, 2014 9:26 am
Location: Hungary

ffmpeg video output to a specific path

Post by mcll »

Hi All,

Is there a way to add somehow a path where ffmpeg should place locally the video was made manually? Because it stores the videos now in that folder where the source pictures are. Unfortunatelly the server is far away from me, and the bandwith is very low. I'm trying to get the videos in one common folder, but when i add a path in the FFMPEG_OUTPUT_OPTIONS i get always error. So how can i define there where the videos should be placed?

Thanks
Regards
Laszlo
Greetings,
Laszlo

Ubuntu Server 14.04.3LTS 64bit - ZoneMinder v1.32.3 - 2x AV-Tech AVN257 IP Cam; 1x Hikvision DS-2CD2020F-I IP Cam
mikb
Posts: 604
Joined: Mon Mar 25, 2013 12:34 pm

Re: ffmpeg video output to a specific path

Post by mikb »

mcll wrote:Hi All,

Is there a way to add somehow a path where ffmpeg should place locally the video was made manually? Because it stores the videos now in that folder where the source pictures are. Unfortunatelly the server is far away from me, and the bandwith is very low. I'm trying to get the videos in one common folder, but when i add a path in the FFMPEG_OUTPUT_OPTIONS i get always error. So how can i define there where the videos should be placed?

Thanks
Regards
Laszlo
This is for v1.25, you may have to adapt, but my notes say to do this ...

Under "Configure Options/Images/FFMPEG_OUTPUT_OPTIONS set (was just "-r 25" here)

-r 25 -q:v 1 -f avi -vtag XVID -g 30 -bf 2 -vf "hqdn3d,lutyuv=y=gammaval(1.4),unsharp" /mnt/place/where/you/want/it/`date +"%Y%m%d-%H%M%S-%N"`.avi

So that's what I do ... a bit of denoising and image improvement in the middle (-vf...) and a filename based on the date AT THE TIME OF RUNNING FFMPEG (not necessarily the date of the clip, it depends when you get ffmpeg to run!)

Your error may be that you are only providing a path to a folder, not a full path to a file NAME?
mcll
Posts: 33
Joined: Tue Feb 11, 2014 9:26 am
Location: Hungary

Re: ffmpeg video output to a specific path

Post by mcll »

mikb wrote: -r 25 -q:v 1 -f avi -vtag XVID -g 30 -bf 2 -vf "hqdn3d,lutyuv=y=gammaval(1.4),unsharp" /mnt/place/where/you/want/it/`date +"%Y%m%d-%H%M%S-%N"`.avi

Your error may be that you are only providing a path to a folder, not a full path to a file NAME?
Thanks a lot, now it's working! Only the "-q:v 1" tag was unknown to my version, but i removed, so it's working. But instead of the date stamp i'd like to set the filename to the same as the recorded event. When i want to save an event as video i always rename it on the Event viewer to my own. So how can i configure the FFMPEG_OUTPUT_OPTIONS to read the name (renamed event) of the event and use that in the video?

Thanks
Regards
Laszlo
Greetings,
Laszlo

Ubuntu Server 14.04.3LTS 64bit - ZoneMinder v1.32.3 - 2x AV-Tech AVN257 IP Cam; 1x Hikvision DS-2CD2020F-I IP Cam
mikb
Posts: 604
Joined: Mon Mar 25, 2013 12:34 pm

Re: ffmpeg video output to a specific path

Post by mikb »

I don't think you can. I skipped that bit, in case it was too much for your case :)

Mostly I don't create videos from events. When I do ... the nearest I found was to do this (this may not work for you, depending on if you use the Archive facility...)

1) Make a new filter to make a video from any file older than 7 days that is also tagged for archiving.

"Archive Status equal to Archived Only" and "Date/Time less than 7 days ago" <-- this means OLDER THAN 7 days
"Sort by date/time ascending" <-- so they come out in order!
Tick "Create Video"
Then click "Save" and select "Run Filter In Background"

2) put the FFMPEG options as I said above, but do this ... /`date -d "-7 days" +"%Y%m%d-%H%M%S-%N"`.avi ... instead. Which gives you the date 7 days ago.

3) I manually tag any events I want to be created as a video with the "Archive" tag. In 7 days (from the date of the event), it will be turned into a video. You have a 7 day window to decide to go back and mark something as "interesting".

4) Create a rule to kill off events that didn't end up a video (purge when old, part 1)
"Archive Status equal to Unarchived Only" "and Date less than 7 days ago"
"Limit to first 50 results only" <-- reduce load on machine
and tick "Delete All Matches"
Then click "Save" and select "Run Filter In Background"

5) And then "Purge Archived When Old" (purge when old part 2) to delete events that WERE made into a video, the video is left behind in /your/chosen/location
"Archive Status equal to Archived Only" "and Date less than 14 days ago"
and tick "Delete All Matches"
Then click "Save" and select "Run Filter In Background"

You can adjust the "7 days" and "14 days" above as needed, but bear in mind that if you turn it down too far, an event (say 3 days ago) that suddenly becomes relevant will be GONE :)

The filters run every 9 mins? so you will find the time and date (filename) will be to within a few mins of the time of the event, but will definitely be sorted into the right order. The T&D embedded in the picture will be accurate.

If there's a better way, someone let me know :)
Locked