NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Windows v
1 2 3 4 5 … 103 Next »
postprocessing simultaneous vs queued execution

 
  • 0 Vote(s) - 0 Average
postprocessing simultaneous vs queued execution
Druhl
Offline

Junior Member

USA
Posts: 33
Threads: 11
Joined: Feb 2025
#1
2025-08-10, 03:52 PM
Have worked out a pretty good postprocessing.bat for the purpose of having ffmpeg repair time stamps in my recordings. This was a problem for me for a while, either due to my IPTV provider or my ISP, but I have it very well handled now.

I plan to contribute to this community by posting the file I'm using and some detail about it once I fix one issue I have remaining.

On a different matter the other day Martin mentioned I should be redirecting stdout from my ffmpeg which I hadn't thought of myself (I was capturing errorlevels and echoing to a log file manually, which was inferior) and this has now shown me a problem I have.

If two recordings end at the same time, they appear to simultaneously call postprocessing.bat but only one actually gets the ffmpeg command executed on it and the other does not.

Is there something I'm missing to force these postprocessings to queue, so that they both fully execute, or...?

Any suggestions appreciated!

Thanks
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,878
Threads: 770
Joined: Nov 2003
#2
2025-08-10, 10:08 PM
Quote:If two recordings end at the same time, they appear to simultaneously call postprocessing.bat but only one actually gets the ffmpeg command executed on it and the other does not.

Is there something I'm missing to force these postprocessings to queue, so that they both fully execute, or...?
There is nothing built in to queue PostProcessing.bat calls. They're called when the recording has completed. If two recordings complete at the same time, they'll usually be called a few seconds apart.

If the ffmpeg commands in your batch file aren't running, it's likely a bug in your logic in the batch file, like you're using some fixed filename or similar. You should be able to resolve it by making sure there is no logic in your script which doesn't allow for a more than one simultaneous run.
Druhl
Offline

Junior Member

USA
Posts: 33
Threads: 11
Joined: Feb 2025
#3
2025-08-12, 08:07 PM
Thanks for the reply.

The ffmpeg command works very well, and any time a recording finishes on its own, it 100% of the time executes successfully. It has totally eliminated my nagging time stamp / index problems.

I only have an issue with simultaneous finishes. I also pass %~n1 for the temp workfile to prevent a fixed filename conflict.

However - could that still be conflicting, if NextPVR calls these postprocessings close enough together that if one is still running, that variable is still set to the first one's filename? Or because they are separate processes, this could not be the case?
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,370
Threads: 963
Joined: May 2006
#4
2025-08-12, 08:18 PM
I would still say it is your script.

I did make available a feature in NextPVR to queue post processing calls but it is mainly meant for serial processing in the update EPG processing since there is no incluied mechanism to activate it. See --process and --queue here https://github.com/sub3/NextPVR/wiki/NextTool

Martin
gEd
Offline

Posting Freak

London
Posts: 3,519
Threads: 100
Joined: Jan 2005
#5
2025-08-12, 08:53 PM
It's very common for shows to finish at the same time (like top or bottom of the hour) and I've never had any problems with my postprocessing.bat running ffmpeg to remux my recordings into an mp4 container.

You really need to share your batch file if you want help to fix the problem.

you can send me a copy via DM if you want a second pair of eyes on it to help resolve the issue before making it public.
“If this is the way Queen Victoria treats her prisoners, she doesn't deserve to have any.”
Druhl
Offline

Junior Member

USA
Posts: 33
Threads: 11
Joined: Feb 2025
#6
2025-08-12, 09:27 PM
Not trying to keep my file a secret!

File is attached.

I will repeat my only problem is this simultaneous issue - I would love to hear it has some simple repair. Otherwise I have been extremely happy with this file.

Thanks
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,370
Threads: 963
Joined: May 2006
#7
2025-08-12, 09:38 PM
Files need to be zipped and under 2MB.

Martin
Druhl
Offline

Junior Member

USA
Posts: 33
Threads: 11
Joined: Feb 2025
#8
2025-08-12, 10:09 PM
Sorry, I thought for such a tiny file zipping might be optional.

Now if I had a postprocessing.bat that was over 2mb without zipping, that would be a problem!

Re-attached.


Attached Files
.zip   PostProcessing.zip (Size: 532 bytes / Downloads: 5)
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,370
Threads: 963
Joined: May 2006
#9
2025-08-12, 10:23 PM
You can't write to %LOGFILE% from two processes.

Martin
Druhl
Offline

Junior Member

USA
Posts: 33
Threads: 11
Joined: Feb 2025
#10
2025-08-12, 10:59 PM (This post was last modified: 2025-08-12, 11:34 PM by Druhl.)
Would you have a suggestion as to how I might capture the stdout and stderr from these otherwise?

Maybe some "if in use" logic that has to write to a "b" file? That would be okay if necessary, I'm not keeping them forever.

EDIT: I'm going to just pass the %~n1 for the logfile name as well. Unless someone has a nicer suggestion.

Thank you everyone for the help as usual!
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  ffmpeg in postprocessing fails on spaces in filename Druhl 3 733 2025-03-29, 06:25 PM
Last Post: mvallevand
  postprocessing tsduck on recordings Druhl 3 635 2025-03-07, 02:24 AM
Last Post: mvallevand
  Help with PostProcessing.bat and Episode names TVHelp 3 615 2024-10-06, 10:16 PM
Last Post: mvallevand
  PostProcessing.bat, Can I do this? three6zerocool 15 2,650 2023-09-26, 11:39 AM
Last Post: three6zerocool
  PostProcessing.bat Boots315 6 1,456 2023-06-26, 01:08 AM
Last Post: Boots315
  PostProcessing.bat puck64 15 2,278 2023-06-21, 09:26 AM
Last Post: puck64
  Postprocessing Script folder and VideoredoTVsuite4 not working Spotspot 4 2,341 2020-06-24, 11:16 AM
Last Post: MCEabused
  PostProcessing.bat problem 4zm4r3d02 26 8,561 2020-02-16, 08:24 PM
Last Post: aderlopas

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode