I am trying to write a batch file that will convert MTS files to M2TS via tsmuxer.
I am getting a syntax error on the first line...what am I missing?for /f %%a in ('dir /b *.mts') do (
set batFile=".\00.bat"
set metaFile=".\00.meta"
set tsCommand1=MUXOPT --no-pcr-on-video-pid --new-audio-pes --vbr --vbv-len=500
set tsCommand2=V_MPEG4/ISO/AVC
set tsCommand3=fps=, insertSEI, contSPS, track=4113
set tsCommand4=A_LPCM, %%a, track=4352
echo %tsCommand1% > %metaFile%
echo %tsCommand2%, %%a, %tsCommand3% >> %metaFile%
echo %tsCommand4% >> %metaFile%
)
		
			+ Reply to Thread
			
		
		
		
			
	
	
				Results 1 to 3 of 3
			
		- 
	'Do I look absolutely divine and regal, and yet at the same time very pretty and rather accessible?' - Queenie
- 
	first thing before you do anything else (did not check the script, its function, not checking meta file), I'd call a function to avoid parentheses, because batch script does weird things within parentheses, shortly it loads all lines at first then executes them and some other stuff ... 
 
 dir /b is for directories, you want filename I guess,
 
 I remember tsMuxeR did not like quotes for output file, not sure if it is going to be a problemCode:SET tsmuxer="C:\tools\tsMuxeR\tsMuxeR.exe" for /f %%a in ("*.mts") do call :make_ts "%%a" echo DONE & pause goto :eof :make_ts set metaFile=".\00.meta" set tsCommand1=MUXOPT --no-pcr-on-video-pid --new-audio-pes --vbr --vbv-len=500 set tsCommand2=V_MPEG4/ISO/AVC set tsCommand3=insertSEI, contSPS, track=4113 set tsCommand4=A_LPCM, "%~1", track=4352 echo %tsCommand1% > %metaFile% echo %tsCommand2%, "%~1", %tsCommand3% >> %metaFile% echo %tsCommand4% >> %metaFile% %tsmuxer% "%metaFile%" "new_%~n1.m2ts" goto :eofLast edited by _Al_; 20th Apr 2016 at 18:32. 
- 
	Thanks for your post...I really appreciate it!!! 
 
 The only this is you need the dir /b command in single quotes to pass file names properly
 
 thanks again!!for /f %%a in ('dir /b *.mts') do call :make_ts "%%a"'Do I look absolutely divine and regal, and yet at the same time very pretty and rather accessible?' - Queenie
Similar Threads
- 
  [BATCH PROCESSING] how to replace CHOOSE.EXE in a batch routine?By marcorocchini in forum Newbie / General discussionsReplies: 3Last Post: 10th Nov 2015, 04:33
- 
  How to Batch Demux with TSMuxer?By VideoFanatic in forum Video ConversionReplies: 24Last Post: 28th Mar 2013, 11:50
- 
  VOB2MPG Batch ProcessingBy jonj1611 in forum SVCD2DVD & VOB2MPGReplies: 2Last Post: 26th Aug 2011, 14:35
- 
  tsmuxer batchBy Tylerr in forum Video ConversionReplies: 0Last Post: 13th Jul 2011, 01:16
- 
  Batch ProcessingBy keefytee in forum SVCD2DVD & VOB2MPGReplies: 0Last Post: 7th May 2011, 05:41


 
		
		 View Profile
				View Profile
			 View Forum Posts
				View Forum Posts
			 Private Message
				Private Message
			 
 
			
			 
			

 Quote
 Quote