Simple way to transcode TS into MPG2 (1 Viewer)

tatus

Portal Pro
March 12, 2007
98
2
Home Country
Germany Germany
Hi there,

after having received so much support from all of you, I would like to share something that I implemented today. I use the server-client based TV engine 3 (TVE3), and I quickly realized that MPG recording is broken, and that I had to use TS files. This has not been fixed by today. Then I found out that the TV recordings compression feature that MP has built in also does not work together with TVE3 and its TS files.

I now have the problem that I am using Tmpgenc to cut and build DVDs from my recordings, and that it does not like the TS files. It uses some 30 minutes to import a file, and it takes another 30 minutes when clicking once (!) at the position slider in the editing dialog...

So I needed a way to transcode, or better to say, re-mux the TS files into normal MPG files.

I found out that the free VLC player can do this very smart and simple, and it even supports batch mode.

So I wrote a small Windows .BAT file that I hope can be useful by for you:

@echo off
FOR %%I IN (*.ts) DO (
echo Transcoding %%~nI.ts ...
"C:\Programme\VideoLAN\VLC\vlc" "%%~nI.ts" --sout #std{access=file,mux=ps,url="%%~nI.mpg"} vlc:quit
if exist "%%~nI.mpg" del "%%~nI.ts"
)

Just be careful, the script deletes the original TS file after having processed it, and VLC allows closing it before the process is completed, which would result in data loss.

Regards
Frank
 

revs

MP Donator
  • Premium Supporter
  • February 1, 2007
    1,274
    72
    The Sauce of Worcester
    Home Country
    Wales Wales
    Superb, just what I needed!

    I can now intergrate this with ComSkip, and hopefully Video Transcoder.

    Its very fast too, always good!

    Here is my slightly different version (for English Installs, and it moves the old file, not delete):

    @echo off
    FOR %%I IN (*.ts) DO (
    echo Transcoding %%~nI.ts ...
    "C:\Program Files\VideoLAN\VLC\vlc" "%%~nI.ts" --sout #std{access=file,mux=ps,url="%%~nI.mpg"} vlc:quit
    if exist "%%~nI.mpg" move "%%~nI.ts" "%%~nIXXX.ts"
    )
     

    tatus

    Portal Pro
    March 12, 2007
    98
    2
    Home Country
    Germany Germany
    glad I could help!

    If I see it right, your file move will not prevent double processing. This one should do it:

    if exist "%%~nI.mpg" move "%%~nI.ts" "%%~nI.ts_backup"


    Regards
    Frank
     

    Keneo

    Portal Pro
    August 28, 2009
    81
    16
    Home Country
    Canada Canada
    Hi

    I know its been a while since you guys posted these messages, but maybe you help me.

    I tried to use your scripts in a batch file.

    I used For the Record's post processing facility to run the bat file after it records.

    but when it tries to run it, I get an error:

    File reading failed:
    VLC could not open the file "vlc:quit".
    Your input can't be opened:
    VLC is unable to open the MRL 'vlc:quit'. Check the log for details.

    any clue?

    (using WinXP)
     

    Users who are viewing this thread

    Top Bottom