NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Add-ons (3rd party plugins, utilities and skins) Old Stuff (Legacy) v
« Previous 1 2 3 4 5 6 … 125 Next »
Automated Cutting and Transcoding Guide Using Mencoder

 
  • 0 Vote(s) - 0 Average
Automated Cutting and Transcoding Guide Using Mencoder
-stattik-
Offline

Posting Freak

Posts: 924
Threads: 26
Joined: Mar 2005
#41
2005-12-15, 08:47 PM
wtg Wrote:-stattik-

Thanks a bunch for sharing your batch file. I really liked the results I got with it, but I do have a question. I noticed the avi file is darker than the mpeg. Is there an option that controls this somewhere? I don't see an option for this, but I'm new mencoder too.


Just an update. I'm still looking into this. I should have something soon.
wtg
Offline

Posting Freak

Posts: 1,402
Threads: 120
Joined: Mar 2005
#42
2005-12-16, 03:00 PM
sbp Wrote:But I need to find a more robust version of the mencoder - it often closes without finishing the job. (I don't know if it is because of my processor (AMD X2 4200).

Steen

I wonder if it's related to the dual core... I'm sure you've seen how many applications have issues with them. Have you tried binding the process to just one CPU?
-stattik-
Offline

Posting Freak

Posts: 924
Threads: 26
Joined: Mar 2005
#43
2005-12-16, 05:13 PM
Here's a quick update:

0.08.1

What's new:

- Added the ability to set the default action to skip the file. Since I watch certain shows right away, I don't need to waste time processing them. I just add them to the list. If I only want to transcode a few shows, I can set the script to script to skip by default if the show doesn't fall into a specific profile.

- I successfully tested this file as the PostConversion.bat file. It should also work as a PostProcessing.bat file. This way you don't need to have Dirmon running if you don't want to. Here's how the processing works. (I'll use PostProcessing.bat as the example.)
-The show get recorded and converted (dvr-ms to mpg in my case)
-When GBPVRconvert.exe is done, PostConversion is called and my script starts running.
-comskip will run (after you remove the Rem from the line)
-Then the script will run and transcode the file according to your settings.
-Since transcoding can take awhile, if GBPVR finishes recording another show, that show waits until mencoder is finished processing and then it gets converted (dvr-ms to mpg in my case), comskipped and mencoded.
-stattik-
Offline

Posting Freak

Posts: 924
Threads: 26
Joined: Mar 2005
#44
2005-12-16, 06:31 PM
Another tip:

You can also drag-and-drop mpg's/avi's on the script if you want to test or transcode specific files (IE: Files that are not recorded by GBPVR or files that don't have corresponding edl files.)
wtg
Offline

Posting Freak

Posts: 1,402
Threads: 120
Joined: Mar 2005
#45
2005-12-16, 07:23 PM
Thanks for sharing your work with everyone, -Stattik-. It's sure saved me a lot of time. It's great for conversion even if you don't want to automate things, like me.
-stattik-
Offline

Posting Freak

Posts: 924
Threads: 26
Joined: Mar 2005
#46
2005-12-16, 10:26 PM
Thanks wtg. If you're interested, I've also written a small script that allows you to transcode decrypted DVD's in one step. You just drop the video_ts folder on the script and come back a few hours later.
sbp
Offline

Junior Member

Posts: 17
Threads: 1
Joined: May 2005
#47
2005-12-17, 10:19 AM
Dear Stattic.
I have used you script, but changed it a bit so it fits better for my purpose. I hope this is OK.
Basicly the script is just as yours, but as I could not use mencoder (often it crashes, and the result was not very good - it skipped several frames and it was difficult to find the right filters and so on (I'm using PAL, interlaced, captured using Picvideo MJPEG).

For me it is much easier to use virtualdub. Here you can select the right filters, see the results realtime, select compression of video and audio ect. When you are satisfied you save the "process settings as a TVcapture.vcf file. You can even have different vcf files for cartoon, sport ect.

Then if virtualdub is started using the commandline parser vdub.exe, it will start in the backgound (just like when you use mencoder).

The last change I have made, is because I don't have an edl file to start with, but I like the idea of having a dne file to tell dirmon that this avi-file have been processed, therefore I make the script produce an edl file and a dne file.

I have left the different transcoding proceures - so it will be easier to change - just put in something like I have done as in "default"



I hope this is OK

Steen

Here is the script:


@echo off

Rem ### Start User settings ###

Rem - Should the original MPG's be deleted after processing? yes or no. Make sure you are happy with the results before enabling this!
set file_delete=no


Rem ### End User settings ###

set name=%1
copy "e:\autrecode\dummy.edl" "%~dpn1.ptl"

Rem The following channels listed below are HDTV channels and will be processed with the HDTV config. Note: this will only work if this batch file is used as the postprocessing.bat file.
if "%2" == "1041" goto hdtv:
if "%2" == "1061" goto hdtv:
if "%2" == "1101" goto hdtv:
if "%2" == "1102" goto hdtv:
if "%2" == "1103" goto hdtv:
if "%2" == "1104" goto hdtv:
if "%2" == "1105" goto hdtv:
if "%2" == "1106" goto hdtv:
if "%2" == "1107" goto hdtv:
if "%2" == "1121" goto hdtv:
if "%2" == "1181" goto hdtv:
if "%2" == "1301" goto hdtv:
if "%2" == "1361" goto hdtv:
if "%2" == "1551" goto hdtv:
if "%2" == "1581" goto hdtv:
if "%2" == "1582" goto hdtv:
if "%2" == "1583" goto hdtv:
if "%2" == "1584" goto hdtv:
if "%2" == "1585" goto hdtv:
if "%2" == "121" goto hdtv:

Rem ----Is original file MPG or AVI?----

if "%~x1"==".mpg" goto mpg:
if "%~x1"==".avi" goto avi:

goto :mpg

:avi

move "%~dpn1.avi" "%~dpn1_original.avi"
del "%~dpn1.avi"
set name="%~dpn1_original.avi"


Rem ----Profiles----
:mpg


Rem #### 2-PASS PROFILE #### Add any other show needed.
if exist "%~dp12pass*" goto 2pass:


Rem #### PSP Profile ### !!experimental and currently non-functional!!
if exist "%~dp1psp*" goto psp:


Rem #### MPEG2 PROFILE #### This will create a commercial-free mpeg2 file. Add any other show needed.
if exist "%~dp1mpeg*" goto mpeg:


Rem #### HDTV PROFILE #### The following programs will use the HDTV transcode settings. Add any other show needed.
if exist "%~dp1hdtv*" goto hdtv:


Rem #### LETTERBOX PROFILE #### The following programs are broadcasted in letterbox format. Add any other show needed. The transcoder assumes that the source is 740x480 and crops the black bars from the frames to maximize the bits used to do the encode.
if exist "%~dp1Medium*" goto letterbox:
if exist "%~dp1Surface*" goto letterbox:
if exist "%~dp1The Office*" goto letterbox:


Rem #### CARTOON PROFILE #### The following shows are animated and will be transcoded using the -cartoon flag. Add any other show needed.
if exist "%~dp1Family Guy*" goto cartoon:
if exist "%~dp1American Dad*" goto cartoon:
if exist "%~dp1The Boondocks*" goto cartoon:
if exist "%~dp1The Simpsons*" goto cartoon:


goto default:



Rem----Transcode Parameters----


:letterbox
Rem #### This is for Letterboxed material ####
start /low /wait %mencoder_path% %name% -edl "%~dpn1.edl" -ovc xvid -xvidencopts bitrate=900:me_quality=6:chroma_me:noqpel:chroma_opt:vhq=4:bvhq=1:trellis:hq_ac:gmc:quant_type=mpeg:max_key_interval=240 -oac mp3lame -lameopts mode=2:cbr:br=128 -vf filmdint,softskip,crop=720:364:0:58,scale=608:336,hqdn3d=3:2:3:3 -ofps 24000/1001 -o "%~dpn1.avi"
goto post:


:cartoon
Rem #### This is for cartoon material ####
start /low /wait %mencoder_path% %name% -edl "%~dpn1.edl" -ovc xvid -xvidencopts bitrate=900:me_quality=6:chroma_me:noqpel:chroma_opt:vhq=4:bvhq=1:trellis:hq_ac:gmc:cartoon:quant_type=mpeg:max_key_interval=240 -oac mp3lame -lameopts mode=2:cbr:br=128 -vf filmdint,softskip,scale=512:384,hqdn3d=3:2:3:3 -ofps 24000/1001 -o "%~dpn1.avi"
goto post:


:hdtv
Rem #### This is for High Definition material ####
start /low /wait %mencoder_path% %name% -edl "%~dpn1.edl" -ovc xvid -xvidencopts bitrate=900:me_quality=6:chroma_me:noqpel:chroma_opt:vhq=4:bvhq=1:trellis:hq_ac:gmc:quant_type=mpeg:max_key_interval=240 -oac mp3lame -lameopts mode=2:cbr:br=128:vol=5 -vf field=0,scale=608:336 -ofps 24000/1001 -o "%~dpn1.avi"
goto post:


:default
Rem #### This is for all material that doesn't fall into the above catagories ####
start/wait c:\programmer\virtualdub\vdub.exe /s"c:\programmer\virtualdub\tvcapture.vcf"/p"%name%","%~dpn1.avi" /r /x /c
goto post:



:2pass
Rem #### This will perform a 2-pass encoding. You will need to set the target file size at the top of this file. Default is 175MB which is good for 30 min shows.
start /low /wait %mencoder_path% %name% -passlogfile "%temp%\%~n1.2passlog" -edl "%~dpn1.edl" -ovc xvid -xvidencopts bitrate=900:me_quality=6:chroma_me:noqpel:chroma_opt:vhq=4:bvhq=1:trellis:hq_ac:gmc:quant_type=mpeg:max_key_interval=240:turbo:pass=1 -oac mp3lame -lameopts mode=2:cbr:br=128 -vf filmdint,softskip,crop=720:364:0:58,scale=608:336,hqdn3d=3:2:3:3 -ofps 24000/1001 -o "%~dpn1.avi"
start /low /wait %mencoder_path% %name% -passlogfile "%temp%\%~n1.2passlog" -edl "%~dpn1.edl" -ovc xvid -xvidencopts bitrate=-%size2pass%:me_quality=6:chroma_me:noqpel:chroma_opt:vhq=4:bvhq=1:trellis:hq_ac:gmc:quant_type=mpeg:max_key_interval=240:turbo:pass=2 -oac mp3lame -lameopts mode=2:cbr:br=128 -vf filmdint,softskip,crop=720:364:0:58,scale=608:336,hqdn3d=3:2:3:3 -ofps 24000/1001 -o "%~dpn1.avi"
del /q "%temp%\%~n1.2passlog"
goto post:


:mpeg
Rem #### This will reencode a MPEG2 file without commercials ####
move %1 "%~dpn1_original.mpg"
start /low /wait %mencoder_path% "%~dpn1_original.mpg" -edl "%~dpn1.edl" -oac copy -ovc lavc -of mpeg -mpegopts format=dvd -vf filmdint,softskip,harddup -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=%mpegbitrate%:keyint=18 -o "%~dpn1.mpg"
goto post:


:psp
Rem #### This will encode PSP-compliant files #### !!experimental and currently non-functional!!
start /low /wait %mencoder_path% %name% -of lavf -lavfopts format=mp4:vcodec=mpeg4 -vf scale=368:208 -oac faac -faacopts br=128:mpeg=4 -ovc xvid -xvidencopts bitrate=900 -endpos 5mb -o "%~dpn1.mp4"
goto post:


:post

copy "%~dpn1.ptl" "%~dpn1.dne"
del /q "%~dpn1.ptl"
if %name% == "%~dpn1_original.avi" goto edldel:
if "%file_delete%" == "yes" goto delete:
if "%file_delete%" == "no" goto eof:

:edldel
del /q "%~dpn1.edl"
goto eof:

:delete
del /q "%~dpf1"
del /q "%~dpn1_original.mpg"
del /q "%~dpn1_original.avi"


:eof
-stattik-
Offline

Posting Freak

Posts: 924
Threads: 26
Joined: Mar 2005
#48
2005-12-17, 07:01 PM
sbp Wrote:Dear Stattic.
I have used you script, but changed it a bit so it fits better for my purpose. I hope this is OK.


That is fine. I created the script to solve a specific problem I was having and I've been adding users suggestions to make it more general-purpose. I welcome anyone's comments and suggestions to make it more feature-full.

With that said, if possible I'd like to get my hands on some of that PAL MJPEG material just so I can get an idea of how it's put together. Do you have an FTP site or other method of sending me that file?
sbp
Offline

Junior Member

Posts: 17
Threads: 1
Joined: May 2005
#49
2005-12-18, 01:11 PM
Sure I can send you a short recording, But how?


Do you now of a place where I can upload it to?

Steen
erik
Offline

Posting Freak

Posts: 1,138
Threads: 123
Joined: Apr 2005
#50
2005-12-18, 01:27 PM
If you need a server to upload/download with 1GB space PM me.
P4 3GHz 1GB, 250GB, nVidia dualTV, GBPVR 1.3.11, XP
Support Comskip, visit the forum and donate at http://www.comskip.org/
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (89): « Previous 1 … 3 4 5 6 7 … 89 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  Yet another guide enhancer :0) carpeVideo 18 10,359 2010-04-07, 03:39 PM
Last Post: carpeVideo
  Guide Questions native 6 4,271 2010-02-10, 01:23 PM
Last Post: native
  Mencoder with multiple TS audio streams lanmat 2 4,611 2009-11-09, 12:15 PM
Last Post: lanmat
  mencoder error messages fvfv 3 2,858 2009-10-19, 08:07 PM
Last Post: -stattik-
  TV guide table colour Pob 3 2,494 2009-09-21, 10:55 PM
Last Post: Snooze
  Searching Guide Contents skycyclepilot 1 2,026 2009-08-23, 03:30 PM
Last Post: McBainUK
  Search for Movies in TV Guide spdrac1 1 2,038 2009-05-23, 03:37 PM
Last Post: JavaWiz
  MPEG2 transcoding to Xvid/AAC -which plug-in/tool are best fit? blizard 6 5,131 2009-03-01, 05:43 PM
Last Post: Deusxmachina
  Warning: Mencoder and large MPEG2 files can fail jam_zhou 1 1,696 2008-07-26, 01:39 AM
Last Post: sgilani
  Comskip, Comclean, Rename Recording, and Transcoding heath11 18 10,742 2008-03-27, 11:45 PM
Last Post: _Dude_

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

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

Linear Mode
Threaded Mode