Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why my .ts file get saved as MPEG2 TS format when i want it to be saved as typescript

Tags:

typescript

I'm new to the development, currently working on Angular 2 I came across a problem while saving the .ts (typescript) file in my computer (Win 7). I have run the commands using npm:

>npm install typescript

but when I try to save the text file to .ts file it creates MPEG 2 TS file. How to resolve this problem. Please help!

like image 861
user3129348 Avatar asked Sep 19 '15 15:09

user3129348


People also ask

What format is TS file?

A TS file is a type of video stream file. It's used to store video content on DVD and Blu-ray discs. It makes use of standard MPEG compression in order to compress video data, mostly being used for saving streamed or broadcast video content.

Does TS file work with MPEG?

Another option for opening the TS file is to rename it to something that your existing media player will support, like . MPEG. Most multimedia players already support . MPEG files, and since TS files are MPEG files, the same program should also play your TS file.


3 Answers

It doesn't get saved in MPEG-2 TS format. Windows just interprets the .ts extension as MPEG-2 TS and shows a video file like icon for your .ts file. You can ignore that.

like image 56
Rahul Yadav Avatar answered Sep 19 '22 08:09

Rahul Yadav


The fact that windows treats .ts files as video is super annoying for anyone working with typescript daily.

I couldn't find a way to change this in regedit, but I found an app called FileTypeMan.

I used it to set mime type to text/plain and perceived type to text.

Now the explorer doesn't try to generate a video thumbnail when i open a folder with typescript files any more.

I don't like that I had to download a program for this, but at least it doesn't need admin rights to run.

If someone find a way to do it with only regedit please share.

like image 43
zoran404 Avatar answered Sep 21 '22 08:09

zoran404


You can modify how Windows opens any file, with these steps (in this case, a TypeScript source code file):

  • Right click on the file (just open the context menu)
  • Click in Properties
  • You will see the properties configuration window (showing second section in the General tab):

    configuration window

  • Click in the Change... button

  • Then, select your preferred text/code editor or IDE

    enter image description here

  • In this case, I have selected Visual Studio Code:

    enter image description here

  • Click in OK, and that is all. Windows 10 will read all .ts files as source code files.

like image 38
KBeDev Avatar answered Sep 20 '22 08:09

KBeDev