Raw. Bold. Unapologetic.

The New Era of Blogging.

Exploring the intersection of design, technology, and neobrutalist energy. Join the movement.

Start Reading

Latest Stories

Showing posts with label Linux. Show all posts

Converting .ts to .mp4 or .mkv using ffmpeg in Linux



Introduction

If you are working with video files, you may come across the .ts (Transport Stream) format, which is commonly used for digital television broadcasting. However, this format is not widely supported by media players and devices, so you may need to convert it to a more widely recognized format such as .mp4 or .mkv. In this article, we will show you how to use ffmpeg in Linux to convert .ts files to .mp4 or .mkv.



Step 1: Install ffmpeg First, you need to install ffmpeg on your Linux machine. You can do this by running the following command:

sudo apt-get install ffmpeg

on Arch

sudo pacman -S ffmpeg

    FFmepg Github: https://github.com/FFmpeg/FFmpeg


Step 2: Convert a single .ts file to .mp4 or .mkv To convert a single .ts file to .mp4 or .mkv, you can use the following command:


ffmpeg -i input_file.ts -c:v libx264 -preset medium -crf 23 -c:a copy output_file.mp4


This command uses the libx264 video codec to encode the video with a medium preset and a CRF (Constant Rate Factor) value of 23, which determines the video quality. The audio stream is copied without re-encoding using the -c:a copy option.

To convert to .mkv instead of .mp4, simply change the output file extension to .mkv.

Step 3: Convert multiple .ts files using a for loop If you have multiple .ts files that you want to convert, you can use a for loop to automate the process. Here's an example:


for file in *.ts; do ffmpeg -i "$file" -c:v libx264 -preset medium -crf 23 -c:a copy "${file%.*}.mp4" done

This for loop iterates through all the .ts files in the current directory and converts each one to .mp4 using the same ffmpeg command as in Step 2. The "${file%.*}.mp4" syntax is used to generate the output file name based on the input file name.


Quickly Convert:


for file in *.ts; do
ffmpeg -i "$file" -c copy "${file%.ts}.mp4"
done

Conclusion

Converting .ts files to .mp4 or .mkv is a simple process using ffmpeg in Linux. With the commands provided in this article, you can convert a single file or multiple files using a for loop. Whether you are working with digital television broadcasting or just have some .ts files that you want to watch on your media player, ffmpeg makes it easy to convert to a more widely recognized format.

March 23, 2023 Read →

The Operating System Battle Royale: Windows vs Linux vs MacOS





Windows, Linux, and macOS - are the three most popular operating systems in the world. They have been battling it out for years, each trying to outdo the other with their unique features, user experience, and overall coolness factor. But which one is the best? Let's take a look and have some fun comparing them!




Windows 

The Tried and True Ah, Windows. The OG of operating systems. It's been around since the 80s and has been a staple for many computer users. With its user-friendly interface, a wide range of software options, and compatibility with most hardware, it's no wonder that it's the most popular operating system in the world. But it's not all sunshine and rainbows for Windows users. The constant updates and never-ending pop-ups can be a nuisance, not to mention the dreaded Blue Screen of Death.


Pros:

  • Highly compatible with software and hardware, making it easy to find and use programs and devices.
  • User-friendly interface that is easy to navigate.
  • Huge range of software options is available, including many proprietary programs.
  • Great for gaming, with support for DirectX and other gaming technologies.

Cons:

  • Can be less stable than other operating systems, particularly older versions of Windows.
  • Frequent updates and security patches can be a hassle for some users.
  • Proprietary software can be expensive, particularly for professional or enterprise-level programs.


Linux

The Underdog Linux is like the hipster of operating systems - not everyone has heard of it, but those who have sworn by it. It's open-source, meaning that anyone can contribute to its development, and it's highly customizable. Linux users tout its stability, security, and the fact that it's completely free. But there are some downsides. Linux isn't the most user-friendly, and it may take some time to get used to. Plus, not all software is compatible with Linux, so you may have to hunt down alternatives.


Pros:

  • Highly customizable and open-source, so you can modify it to your heart's content.
  • Extremely stable and secure, thanks to its Unix-based architecture.
  • A vast array of free, open-source software is available for use.
  • Often used for development, coding, and other technical tasks.

Cons:

  • Can have a steep learning curve for beginners.
  • Software compatibility can be an issue, particularly with proprietary programs.
  • The user interface may not be as polished or intuitive as other operating systems.




macOS

The Cool Kid MacOS is the operating system for those who want a sleek, stylish, and seamless user experience. It's designed to work seamlessly with Apple hardware, making it the go-to choice for many creatives and professionals. With features like Siri, AirDrop, and Continuity, MacOS users have everything they need at their fingertips. But there are some drawbacks. MacOS isn't as customizable as Windows or Linux, and it comes with a hefty price tag. Plus, not all software is available for MacOS, so you may have to make some compromises.


Pros:

  • User-friendly interface that is aesthetically pleasing and intuitive.
  • Integration with Apple's ecosystem, including iPhone and iPad.
  • Built-in features such as Time Machine backup, make it easy to recover lost files.
  • Generally more secure than Windows due to Apple's strict control over hardware and software.

Cons:

  • Fewer software options are available compared to Windows, particularly in the gaming industry.
  • Expensive hardware and software, making it less accessible to some users.
  • Limited customization options compared to Linux.



So, Which One is the Best? 

Honestly, it depends on your needs and preferences. If you want a user-friendly experience and wide software compatibility, go with Windows. If you're a tech-savvy person who wants more customization options and doesn't mind a learning curve, go with Linux. And if you're looking for a sleek, seamless experience and don't mind shelling out some cash, go with MacOS.

In conclusion, the debate of Windows vs Linux vs MacOS will continue for years to come. But instead of arguing over which one is the best, let's appreciate the fact that we have three amazing operating systems to choose from. And hey, if you're feeling adventurous, why not try all three? Who knows, you might just discover your new favorite.

March 23, 2023 Read →

The Ultimate Guide to unrar Command in Linux: All Possible Use Cases


In the world of Linux, there are numerous commands that make it easier to navigate and manipulate files and directories. One such command is 'unrar,' which is used to extract files from a RAR archive. RAR stands for 'Roshal Archive,' and is a file format used to compress and archive files. In this blog, we will explore the different use cases of the 'unrar' command in Linux.


1. Extracting RAR archives


The most common use case of the 'unrar' command is to extract files from a RAR archive. To extract a file using 'unrar,' simply type the following command in the terminal:


unrar x filename.rar


where 'filename.rar' is the name of the RAR archive you want to extract. This command will extract all the files in the archive to the current directory.


2. Extracting files from password-protected RAR archives


If the RAR archive is password-protected, you will need to provide the password while extracting the files. To do this, use the following command:


unrar x -pPASSWORD filename.rar


where 'PASSWORD' is the password for the RAR archive. This command will extract all the files in the archive to the current directory.


3. Extracting specific files from a RAR archive


Sometimes, you may only need to extract specific files from a RAR archive. In this case, you can use the following command:


unrar e filename.rar file1 file2 file3


where 'filename.rar' is the name of the RAR archive, and 'file1', 'file2', and 'file3' are the names of the files you want to extract. This command will extract only the specified files from the archive to the current directory.


4. Listing the contents of a RAR archive


To view the contents of a RAR archive before extracting it, you can use the following command:


unrar l filename.rar


where 'filename.rar' is the name of the RAR archive. This command will display a list of all the files in the archive, along with their sizes, dates, and other information.


5. Testing a RAR archive for errors


Before extracting files from a RAR archive, it's a good idea to test it for errors. To do this, use the following command:


unrar t filename.rar


where 'filename.rar' is the name of the RAR archive. This command will test the archive for errors and display a message indicating whether the archive is intact or not. If there are errors in the archive, the command will display an error message.


6. Creating RAR archives


Apart from extracting files from RAR archives, the 'unrar' command can also be used to create RAR archives. To create a RAR archive, use the following command:


unrar a archive.rar file1 file2 file3


where 'archive.rar' is the name of the new RAR archive you want to create, and 'file1', 'file2', and 'file3' are the names of the files you want to add to the archive. This command will create a new RAR archive containing the specified files.


In conclusion, the 'unrar' command is a useful utility for extracting files from RAR archives in Linux. It also has several other use cases, including creating RAR archives, testing archives for errors, and listing the contents of archives. By mastering the different use cases of the 'unrar' command, you can efficiently manage and manipulate RAR archives in Linux.

March 22, 2023 Read →
Energy Loading...

Search the Blog

Press ESC to close