Convert m2ts files to avi. #M2ts to avi #Convert m2ts #Avi converter #M2ts #Avi #Video
m2tstoavi is a script for people who have recorded .m2ts videos using a high def camcorder and want to play them on their Linux / Unix / Mac OS X computer, or want to convert them to another format.
Here is the procedure used to convert a .m2ts file by the m2tstoavi script:
1. Use xporthdmv to convert the file into .mpv and .mpa files. 2. Use ldecod to convert the .mpv file into a .yuv file. 3. Rename the .mpa file ldecod created to .ac3
At this point, a .yuv file and .ac3 file are created which should be standard.
4. Use ffmpeg to create a .avi file that contains the .yuv transcoded to something else and the .ac3 file.
Step 4 is highly customizable. You should be able to transcode to whatever format you want at this step.
There are different versions of m2tstoavi including m2tstoavi.fifo which uses a fifo to speed up the conversion process, and m2tstoavi.mencoder which uses mencoder instead of ffmpeg to create the video. Use whichever of the three versions of the scripts works best for you.
The commands for steps 1-4 would look something like this, for a sample file named samplevideo.m2ts:
xporthdmv -nh samplevideo.m2ts 1 1 1 ldecod -i bits0001.mpv -o /tmp/samplevideo.yuv mv bits0001.mpa /tmp/samplevideo.ac3 ffmpeg -r 29.97 -s 1440x1080 -i /tmp/samplevideo.yuv -i /tmp/samplevideo.ac3 -vcodec mpeg4 -sameq -acodec copy -aspect 16:9 -b 15000k samplevideo.avi
The commands above would produce a samplevideo.avi file that contains the converted version of the samplevideo.m2ts. In this example, it's converted to the mpeg4 codec, but you can use whatever codec you choose.
The included example script m2tstoavi performs the conversion task, and makes things a little easier. Modify the m2tstoavi script to suit your specific transcoding needs by changing the ffmpeg line in the script.
Usage: m2tstoavi filename ...
where filename is something like homevideo.m2ts and it will start the process, creating homevideo.avi as output.
You can also use wildcards, like:
m2tstoavi *.m2ts
This process is extremely slow.
You will need a LOT of disk space in /tmp.
I have included a sample video file, samplevideo.m2ts.
Try converting it and watch it with the commands:
m2tstoavi samplevideo.m2ts mplayer samplevideo.m2ts
DO NOT DELETE YOUR ORIGINAL .m2ts or .MTS FILES. Save them in case a better solution to this problem appears in the future.
For those of your with a Sony HDR-SR1 AVC HD Camcorder and Linux:
I plug in the HSR-SR1 to my USB 2.0 port and run the script:
hdrsr1
which converts all the .MTS files in the camcorder to .avi and places them in the current directory.
If someone comes up with a better process, please modify this package and run with the ball.
m2tstoavi 0.5
add to watchlist add to download basket send us an update REPORT- runs on:
- Linux
- filename:
- m2ts.tar.gz
- main category:
- Multimedia
- developer:
- visit homepage
7-Zip 23.01 / 24.04 Beta
Windows Sandbox Launcher 1.0.0
Microsoft Teams 24060.3102.2733.5911 Home / 1.7.00.7956 Work
4k Video Downloader 1.5.3.0080 Plus / 4.30.0.5655
calibre 7.9.0
Context Menu Manager 3.3.3.1
ShareX 16.0.1
Zoom Client 6.0.3.37634
Bitdefender Antivirus Free 27.0.35.146
IrfanView 4.67
- Zoom Client
- Bitdefender Antivirus Free
- IrfanView
- 7-Zip
- Windows Sandbox Launcher
- Microsoft Teams
- 4k Video Downloader
- calibre
- Context Menu Manager
- ShareX