![]() |
|
General Discussion General discussion about SageTV and related companies, products, and technologies. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
Batch video conversion
I've been looking for a way to convert .mov files to .ts or .m2ts for use in sagetv. The reason I want to be able to do this is sage splitter and .mov don't get along so well. I can easily convert with tsmuxer, but it doesn't support batch operations. The automatic trailer downloader on the mymovies.dk site supports "post processing" which I need a program that supports batch. Does anyone know of any software that will do what I'm asking?
__________________
SageTV Server: unRAID Docker v9, S2600CPJ, Norco 24 hot swap bay case, 2x Xeon 2670, 64 GB DDR3, 3x Colossus for DirecTV, HDHR for OTA Living room: nVidia Shield TV, Sage Mini Client, 65" Panasonic VT60 Bedroom: Xiomi Mi Box, Sage Mini Client, 42" Panasonic PZ800u Theater: nVidia Shield TV, mini client, Plex for movies, 120" screen. Mitsubishi HC4000. Denon X4300H. 7.4.4 speaker setup. |
#2
|
||||
|
||||
I wrote this a while back to remux Apple Trailers into mkv with AC3 audio, using only tools that come with Sage, aside form MKVMerge. Just paste it into notepad and save it as a .bat file.
Code:
@echo OFF cd d:\test\ set input=%1 set output=%input:.mov=.mkv% if EXIST %output% GOTO EXISTS D:\sageserver\sagetv\sagetvtranscoder.exe -i %input% > d:\test\fmt.txt 2>&1 findstr /R "Audio.*5\.1" d:\test\fmt.txt echo. %errorlevel% if %ERRORLEVEL% EQU 0 GOTO DD findstr /R "Audio.*stereo" d:\test\fmt.txt echo. %errorlevel% if %ERRORLEVEL% EQU 0 GOTO ST goto ERR :DD echo. "It's 5.1!" REM D:\sageserver\sagetv\sagetvtranscoder.exe -i %input% -vn -acodec ac3 -ab 640k -ar 48000 -ac 6 -y d:\test\tmp.ac3 "C:\Program Files (x86)\megui\tools\mencoder\mencoder" -channels 6 -oac lavc -lavcopts acodec=ac3:abitrate=640 -ovc frameno -of rawaudio -o d:\test\tmp.ac3 %input% REM "C:\Program Files (x86)\megui\tools\mkvmerge\mkvmerge" -o %output% -d 1 -A S %input% -a 0 -D -S d:\test\tmp.ac3 --track-order 0:1,1:0 goto OK :ST echo. "It's Stereo!" REM D:\sageserver\sagetv\sagetvtranscoder.exe -i %input% -vn -acodec ac3 -ab 192k -ar 48000 -ac 2 -y d:\test\tmp.ac3 "C:\Program Files (x86)\megui\tools\mencoder\mencoder" -oac lavc -lavcopts acodec=ac3:abitrate=192 -ovc frameno -of rawaudio -o d:\test\tmp.ac3 %input% REM "C:\Program Files (x86)\megui\tools\mkvmerge\mkvmerge" -o %output% -d 1 -A S %input% -a 0 -D -S d:\test\tmp.ac3 --track-order 0:1,1:0 goto OK :OK findstr /R "0\.0.*Video" d:\test\fmt.txt echo %errorlevel% if %ERRORLEVEL% EQU 0 GOTO V0 findstr /R "0\.1.*Video" d:\test\fmt.txt echo %errorlevel% if %ERRORLEVEL% EQU 0 GOTO V1 goto ERR :V0 echo. "Video is stream 0!" "C:\Program Files (x86)\megui\tools\mkvmerge\mkvmerge.exe" -o %output% -d 1 -A -S %input% -a 0 -D -S d:\test\tmp.ac3 --track-order 0:1,1:0 REM echo "C:\Program Files (x86)\megui\tools\mkvmerge\mkvmerge" -o %output% "--forced-track" "2:no" "-d" "2" "-A" "-S" "-T" "--no-global-tags" "--no-chapters" %input% "--forced-track" "0:no" "-a" "0" "-D" "-S" "-T" "--no-global-tags" "--no-chapters" "D:\test\tmp.ac3" "--track-order" "0:1,1:0" REM "C:\Program Files (x86)\megui\tools\mkvmerge\mkvmerge" -o %output% "--forced-track" "2:no" "-d" "2" "-A" "-S" "-T" "--no-global-tags" "--no-chapters" %input% "--forced-track" "0:no" "-a" "0" "-D" "-S" "-T" "--no-global-tags" "--no-chapters" "D:\test\tmp.ac3" "--track-order" "0:1,1:0" REM del tmp.ac3 REM del %input% goto end :V1 echo. "Video is stream 1!" REM"C:\Program Files (x86)\megui\tools\mkvmerge\mkvmerge.exe" -o %output% -d 1 -A -S %input% -a 0 -D -S d:\test\tmp.ac3 --track-order 0:1,1:0 echo "C:\Program Files (x86)\megui\tools\mkvmerge\mkvmerge" -o %output% "--forced-track" "2:no" "-d" "2" "-A" "-S" "-T" "--no-global-tags" "--no-chapters" %input% "--forced-track" "0:no" "-a" "0" "-D" "-S" "-T" "--no-global-tags" "--no-chapters" "D:\test\tmp.ac3" "--track-order" "0:1,1:0" "C:\Program Files (x86)\megui\tools\mkvmerge\mkvmerge" -o %output% "--forced-track" "2:no" "-d" "2" "-A" "-S" "-T" "--no-global-tags" "--no-chapters" %input% "--forced-track" "0:no" "-a" "0" "-D" "-S" "-T" "--no-global-tags" "--no-chapters" "D:\test\tmp.ac3" "--track-order" "0:1,1:0" REM del tmp.ac3 REM del %input% goto end :EXISTS echo. "Already exists, skipping." REM del %input% :ERR echo. "It's Unknown!" goto end :end del d:\test\fmt.txt |
#3
|
||||
|
||||
Thanks. I'll give that a try. I don't know why the sage splitter makes .mov files play so blocky, but this might help.
__________________
SageTV Server: unRAID Docker v9, S2600CPJ, Norco 24 hot swap bay case, 2x Xeon 2670, 64 GB DDR3, 3x Colossus for DirecTV, HDHR for OTA Living room: nVidia Shield TV, Sage Mini Client, 65" Panasonic VT60 Bedroom: Xiomi Mi Box, Sage Mini Client, 42" Panasonic PZ800u Theater: nVidia Shield TV, mini client, Plex for movies, 120" screen. Mitsubishi HC4000. Denon X4300H. 7.4.4 speaker setup. |
#4
|
||||
|
||||
That didn't work. MKV's use the same splitter as .mov files. If I convert to .m2ts or .ts it uses a different splitter and the playback issues go away.
__________________
SageTV Server: unRAID Docker v9, S2600CPJ, Norco 24 hot swap bay case, 2x Xeon 2670, 64 GB DDR3, 3x Colossus for DirecTV, HDHR for OTA Living room: nVidia Shield TV, Sage Mini Client, 65" Panasonic VT60 Bedroom: Xiomi Mi Box, Sage Mini Client, 42" Panasonic PZ800u Theater: nVidia Shield TV, mini client, Plex for movies, 120" screen. Mitsubishi HC4000. Denon X4300H. 7.4.4 speaker setup. |
#5
|
||||
|
||||
Interesting, the MKV's play fine on the extenders (though mov's don't).
Though it would be pretty easy to replace mkvmerge in that with tsmuxer. |
#6
|
||||
|
||||
Quote:
If I could find a way to automatically create the .meta file I would be in business. I suck at creating batch files or even using command line .exe's. It's been too long since my dos days. Here is the manual if anyone would like to help me out with this.
__________________
SageTV Server: unRAID Docker v9, S2600CPJ, Norco 24 hot swap bay case, 2x Xeon 2670, 64 GB DDR3, 3x Colossus for DirecTV, HDHR for OTA Living room: nVidia Shield TV, Sage Mini Client, 65" Panasonic VT60 Bedroom: Xiomi Mi Box, Sage Mini Client, 42" Panasonic PZ800u Theater: nVidia Shield TV, mini client, Plex for movies, 120" screen. Mitsubishi HC4000. Denon X4300H. 7.4.4 speaker setup. Last edited by panteragstk; 03-20-2011 at 04:40 PM. |
#7
|
||||
|
||||
looking into this more it would seem that mencoder or ffmpeg could accomplish the same thing.
"mencoder.exe -oac copy -ovc copy" the above would keep the audio and video in tact, but I have no idea how to get the file to output a .m2ts file. I would like to be able to run the batch file in the directory with the trailers and have it change all to .m2ts then send them to another directory after deleting the original files. How do I make that happen?
__________________
SageTV Server: unRAID Docker v9, S2600CPJ, Norco 24 hot swap bay case, 2x Xeon 2670, 64 GB DDR3, 3x Colossus for DirecTV, HDHR for OTA Living room: nVidia Shield TV, Sage Mini Client, 65" Panasonic VT60 Bedroom: Xiomi Mi Box, Sage Mini Client, 42" Panasonic PZ800u Theater: nVidia Shield TV, mini client, Plex for movies, 120" screen. Mitsubishi HC4000. Denon X4300H. 7.4.4 speaker setup. |
#8
|
|||
|
|||
Quote:
Code:
echo "V_MPEG4/ISO/AVC, D:\media\test\stream.h264, fps=25" >> temp.meta echo "A_AC3, D:\media\test\stream.ac3, timeshift=-10000ms" >> temp.meta tsmuxer --blah --blah --blah del temp.meta ![]() |
#9
|
||||
|
||||
Quote:
this are the parameters I have now " -i %1 -vcodec copy -acodec copy %1.m2ts" but nothing happens. if I'm correct %1 is like having *.mov right? I'm starting to remember how to create these files, but it is taking a while.
__________________
SageTV Server: unRAID Docker v9, S2600CPJ, Norco 24 hot swap bay case, 2x Xeon 2670, 64 GB DDR3, 3x Colossus for DirecTV, HDHR for OTA Living room: nVidia Shield TV, Sage Mini Client, 65" Panasonic VT60 Bedroom: Xiomi Mi Box, Sage Mini Client, 42" Panasonic PZ800u Theater: nVidia Shield TV, mini client, Plex for movies, 120" screen. Mitsubishi HC4000. Denon X4300H. 7.4.4 speaker setup. |
#10
|
||||
|
||||
ffmpeg doesn't support .m2ts. That answers that question.
__________________
SageTV Server: unRAID Docker v9, S2600CPJ, Norco 24 hot swap bay case, 2x Xeon 2670, 64 GB DDR3, 3x Colossus for DirecTV, HDHR for OTA Living room: nVidia Shield TV, Sage Mini Client, 65" Panasonic VT60 Bedroom: Xiomi Mi Box, Sage Mini Client, 42" Panasonic PZ800u Theater: nVidia Shield TV, mini client, Plex for movies, 120" screen. Mitsubishi HC4000. Denon X4300H. 7.4.4 speaker setup. |
#11
|
|||
|
|||
You won't be able to use wildcards like *.mov due to the way the command interperter will expand things. You would have to call the .bat fiile once for each .mov. That can be accomplished using a for statement from the command line
Code:
for %i in (*.mov) do myconverter.bat %i ![]() Also the way you have that written it would expand to Code:
ffmpegenc -i mov1.mov -vcodec copy -acodec copy mov1.mov.m2ts Code:
ffmpegenc -i %1 -vcodec copy -acodec copy %2 Code:
for %i in (*.mov) do myconverter.bat %i~ni.m2ts There are other ways to skin that cat, but that's the first one that comes to mind |
#12
|
|||
|
|||
You might also check out VLC from videolan.org. It does support command line work, and has many options. Getting everything figured out might be tricky, but once you get it done, it should be smooth.
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Video Category batch set | 0x1a4 | SageMC Custom Interface | 2 | 06-01-2008 09:02 AM |
questions on video conversion | garyellis | SageTV Beta Test Software | 0 | 12-08-2006 08:56 AM |
Windows Media batch conversion recipe | ku71 | General Discussion | 0 | 06-18-2003 10:47 PM |
The quest for batch conversion | ku71 | General Discussion | 3 | 05-30-2003 12:41 PM |