NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Legacy (v4.x and earlier) v
« Previous 1 … 199 200 201 202 203 … 433 Next »
Batch file auto run after a recording finishes?

Batch file auto run after a recording finishes?
johnsonx42
Offline

Posting Freak

Posts: 7,298
Threads: 189
Joined: Sep 2008
#11
2014-12-01, 06:15 AM
the full filename of the recording is passed to postprocessing.bat (and parallelprocessing.bat for that matter) as %1, so instead of using the forfiles command, you could just do this:

ffmpeg -i %1 -acodec copy -vcodec copy "%~dpn1.mpg"
if not exist "%~dpn1.mpg" goto skipdelete
del %1
Confusedkipdelete

(the last bit is just to avoid deleting the .ts file if the ffmpeg process didn't produce an .mpg file for some reason)
server: NextPVR 5.0.7/Win10 2004/64-bit/AMD A6-7400k/hvr-2250 & hvr-1250/Winegard Flatwave antenna/Schedules Direct
main client: NextPVR 5.0.7 Desktop Client; LG 50UH5500 WebOS 3.0 TV
GrimLoke
Offline

Junior Member

Posts: 9
Threads: 3
Joined: Nov 2014
#12
2014-12-01, 08:26 AM (This post was last modified: 2014-12-01, 09:12 AM by GrimLoke.)
johnsonx42 Wrote:the full filename of the recording is passed to postprocessing.bat (and parallelprocessing.bat for that matter) as %1, so instead of using the forfiles command, you could just do this:

ffmpeg -i %1 -acodec copy -vcodec copy "%~dpn1.mpg"
if not exist "%~dpn1.mpg" goto skipdelete
del %1
Confusedkipdelete

(the last bit is just to avoid deleting the .ts file if the ffmpeg process didn't produce an .mpg file for some reason)

The latest version of ffmpeg ends up streaming the file distorted and without audio to my blu ray player. I tried using vlc and it works perfectly.

Thanks for the help. The code below works for vlc, but it didn't delete the .ts file afterwords.
D:
CD DVR

START /LOW D:\VLC\vlc.exe -I dummy --dummy-quiet %1 --sout "file/ps://%~dpn1.mpg" vlc://quit"
if not exist "%~dpn1.mpg" goto skipdelete
del %1
Confusedkipdelete
johnsonx42
Offline

Posting Freak

Posts: 7,298
Threads: 189
Joined: Sep 2008
#13
2014-12-01, 04:32 PM
hmmm... I'm not sure why that script wouldn't delete the .ts file if the .mpg file was present, unless the .ts file was still held open for some reason. am I just missing something obvious?

you could add some logging, like "echo now deleting file >>dvr.log" and "del %1 >>dvr.log" to see what might be happening.
server: NextPVR 5.0.7/Win10 2004/64-bit/AMD A6-7400k/hvr-2250 & hvr-1250/Winegard Flatwave antenna/Schedules Direct
main client: NextPVR 5.0.7 Desktop Client; LG 50UH5500 WebOS 3.0 TV
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,926
Threads: 956
Joined: May 2006
#14
2014-12-01, 11:38 PM
johnsonx42 Wrote:hmmm... I'm not sure why that script wouldn't delete the .ts file if the .mpg file was present, unless the .ts file was still held open for some reason. am I just missing something obvious?

Yes it's something obvious. The start needs a /wait because it runs in a separate thread.

Martin
GrimLoke
Offline

Junior Member

Posts: 9
Threads: 3
Joined: Nov 2014
#15
2014-12-02, 04:43 AM
mvallevand Wrote:Yes it's something obvious. The start needs a /wait because it runs in a separate thread.

Martin

That worked. Thanks for the help everyone. Smile

Here's the code for anyone interested.
D:
CD DVR
START /LOW /WAIT D:\VLC\vlc.exe -I dummy --dummy-quiet %1 --sout "file/ps://%~dpn1.mpg" vlc://quit
if not exist "%~dpn1.mpg" (goto skipdelete)
del %1
Confusedkipdelete
johnsonx42
Offline

Posting Freak

Posts: 7,298
Threads: 189
Joined: Sep 2008
#16
2014-12-02, 08:25 AM
mvallevand Wrote:Yes it's something obvious. The start needs a /wait because it runs in a separate thread.
yeah, that would be it. I don't use the start command much, so I didn't think about that.
server: NextPVR 5.0.7/Win10 2004/64-bit/AMD A6-7400k/hvr-2250 & hvr-1250/Winegard Flatwave antenna/Schedules Direct
main client: NextPVR 5.0.7 Desktop Client; LG 50UH5500 WebOS 3.0 TV
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): « Previous 1 2


Possibly Related Threads…
Thread Author Replies Views Last Post
  Recording movies / TV to XBMC directory stucture spinnaker 10 3,513 2024-06-03, 03:56 AM
Last Post: Rod Hutchinson
  Not recording errors vidwiz 4 972 2024-04-17, 05:39 PM
Last Post: mvallevand
  Add Series/Episode Info to Recording Metadata andrewj 2 1,049 2023-11-20, 03:42 PM
Last Post: sub
  incorrect frequency in adelaide .ini file spin35 5 3,010 2023-02-01, 05:40 PM
Last Post: sub
  Recording to a network drive woes. 2leftfeet 12 7,162 2022-04-05, 08:03 PM
Last Post: mvallevand
  device needed for recording David209 2 1,726 2021-04-04, 08:47 AM
Last Post: David209
  PC not going to sleep after recording LeoL 7 3,243 2021-04-01, 07:17 PM
Last Post: Handy.Man
  HDHomerun recording bizzarely not working Jean0987654321 3 2,025 2021-03-27, 03:23 PM
Last Post: Jean0987654321
  Auto Update EPG not running as scheduled? BairStrokes 2 1,717 2021-03-26, 12:02 PM
Last Post: NumberFive
  ts file shows length too long? SuttonWillow 2 1,893 2021-03-15, 01:56 PM
Last Post: mvallevand

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

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

Linear Mode
Threaded Mode