Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
systemverwaltung:user_info:howto:videoedit [2015/04/16 07:36] admin [CLI Tools: avconv, mp4box, ffmpeg] |
systemverwaltung:user_info:howto:videoedit [2021/12/02 11:27] (aktuell) |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== Video Editing ====== | ====== Video Editing ====== | ||
- | ~~TOC~~ | + | First you should install some video related packages: |
+ | apt-get install libav-tools vlc | ||
+ | |||
+ | optional: | ||
+ | apt-get install mediainfo | ||
===== Convert ===== | ===== Convert ===== | ||
- | Convert MTS files with AVCHD to MP4 Format | + | Some Cameras divide the recording in several pieces. |
+ | Then you first should concatenate with | ||
+ | '' | ||
+ | Convert MTS files with AVCHD video format and ac3 sound format | ||
+ | to MP4 and aac format. | ||
- | ==== Handbrake ==== | + | <code bash> |
+ | # | ||
+ | # put here original size of movie: | ||
+ | SIZE=1920x1080 | ||
+ | avconv-copy() { | ||
+ | | ||
+ | } | ||
+ | case " | ||
+ | (avconv) | ||
+ | | ||
+ | ;; | ||
+ | (avconv-resize) | ||
+ | | ||
+ | ;; | ||
+ | (avconv-full) | ||
+ | | ||
+ | | ||
+ | ;; | ||
+ | (*) | ||
+ | echo " | ||
+ | ;; | ||
+ | esac | ||
+ | </ | ||
+ | ====== Handbrake | ||
Tool in ubuntu packages from [[https:// | Tool in ubuntu packages from [[https:// | ||
+ | Intermediate format on Linux is MKV because this is the most free video package | ||
- | ==== xmodulo ==== | + | ====== xmodulo ====== |
- | ==== CLI Tools: avconv, mp4box, ffmpeg ==== | + | .... |
- | === avconv === | + | ====== CLI Tools: |
+ | ===== avconv ===== | ||
<code bash> | <code bash> | ||
Zeile 32: | Zeile 64: | ||
winff - graphical video and audio batch converter using ffmpeg or avconv | winff - graphical video and audio batch converter using ffmpeg or avconv | ||
- | === mp4box === | + | ===== mp4box |
| | ||
Zeile 47: | Zeile 79: | ||
</ | </ | ||
- | === ffmpeg === | + | ===== ffmpeg ===== |
+ | |||
+ | // | ||
+ | |||
+ | This package is very common but discontinued. | ||
<code bash> | <code bash> | ||
Zeile 76: | Zeile 112: | ||
http:// | http:// | ||
- | === mencoder === | + | ===== mencoder |
Question: How to convert AVCHD (MTS/M2TS) to MP4 __losslessly__. | Question: How to convert AVCHD (MTS/M2TS) to MP4 __losslessly__. | ||
I'll start with the end: | I'll start with the end: | ||
+ | |||
<code bash> | <code bash> | ||
mencoder infile.mts -demuxer lavf -oac copy -ovc copy -of lavf=mp4 -o outfile.mp4 | mencoder infile.mts -demuxer lavf -oac copy -ovc copy -of lavf=mp4 -o outfile.mp4 | ||
</ | </ | ||
+ | |||
and now to explain myself: | and now to explain myself: | ||
- | | + | AVCHD (MTS) is basically a container format for MPEG4-AVC video and AC-3 Audio. It's commonly found on modern camcorders. I have pulled files off a Sony Camcorder, which records in 1080i@50Hz. It seems there are timestamp problems, and both the even and odd fields are stamped with the same time, and not 1/50th of a second apart as you'd expect. This currently breaks ffmpeg (0.6~svn20100711), |
If you run ' | If you run ' | ||
Zeile 196: | Zeile 234: | ||
Stream size : 1.71 MiB (3%) | Stream size : 1.71 MiB (3%) | ||
</ | </ | ||
+ | |||
Note that the final video will still be interlaced. __Removing the interlacing requires re-encoding.__ | Note that the final video will still be interlaced. __Removing the interlacing requires re-encoding.__ | ||
(This was tested on 10.04 with the VDPAU team's cutting-edge-multimedia PPA installed.) | (This was tested on 10.04 with the VDPAU team's cutting-edge-multimedia PPA installed.) | ||
by pHr34kY; September 11th, 2010 at 11:55 AM. | by pHr34kY; September 11th, 2010 at 11:55 AM. | ||
- | Advanced reply Adv Reply | + | Advanced reply |
September 14th, 2010 #2 | September 14th, 2010 #2 | ||
- | Talking Re: How to convert AVCHD (MTS/M2TS) to MP4 losslessly. | + | I want to do this on files from a canon hg-21. Here is my output from mediainfo: |
- | + | < | |
- | | + | |
- | + | ||
General | General | ||
ID : 0 | ID : 0 | ||
Zeile 250: | Zeile 286: | ||
Sampling rate : 48.0 KHz | Sampling rate : 48.0 KHz | ||
Video delay : -66ms | Video delay : -66ms | ||
+ | </ | ||
This is after conversion: | This is after conversion: | ||
+ | < | ||
General | General | ||
Complete name : RyanFreakout.mp4 | Complete name : RyanFreakout.mp4 | ||
Zeile 306: | Zeile 342: | ||
Encoded date : UTC 1970-01-01 00:00:00 | Encoded date : UTC 1970-01-01 00:00:00 | ||
Tagged date : UTC 1970-01-01 00:00:00 | Tagged date : UTC 1970-01-01 00:00:00 | ||
+ | </ | ||
+ | Does everything look right? The playback on .mp4 is still obviously interlaced but it seems to be worse than before. When usually I get better playback. Previously, I had always used Adobe Media Encoder on Windows (deinterlaces the file). Can I deinterlace this file (reencode with '' | ||
- | Does everything look right? The playback on .mp4 is still obviously interlaced but it seems to be worse than before. When usually I get better playback. Previously, I had always used Adobe Media Encoder on Windows (deinterlaces the file). Can I deinterlace this file (reencode with mencoder)? Are my settings right for converting this like yours? | + | >Advanced reply |
- | + | >September 17th, 2010 #3 | |
- | Advanced reply Adv Reply | + | > |
- | September 17th, 2010 #3 | + | |
- | webdevelopment | + | |
- | Re: How to convert AVCHD (MTS/M2TS) to MP4 losslessly. | + | |
- | + | ||
- | looking | + | |
- | + | ||
- | **WinFF** gives this error when trying to convert MTS files: | + | |
- | + | ||
- | Input #0, mpegts, from '/ | + | |
- | Duration: 00: | + | |
- | Program 1 | + | |
- | Stream # | + | |
- | Stream # | + | |
- | Unknown encoder ' | + | |
- | Press Enter to Continue | + | |
- | + | ||
- | Advanced reply Adv Reply | + | |
- | September 17th, 2010 #4 | + | |
- | > Re: How to convert AVCHD (MTS/M2TS) to MP4 losslessly.> | + | |
- | > Unknown encoder ' | + | |
> | > | ||
- | > Looks like your copy of FFmpeg has not been compiled for mp3 encoding, have a look here for the fix: | + | >**WinFF** gives this error when trying to convert MTS files: |
> | > | ||
- | > HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoders in FFmpeg | + | > Input #0, mpegts, from '/ |
- | > http:// | + | > Duration: 00:04:56.32, start: 1.000067, bitrate: 17173 kb/s |
+ | > Program 1 | ||
+ | > Stream # | ||
+ | > | ||
+ | > Unknown encoder ' | ||
+ | > Press Enter to Continue ... | ||
> | > | ||
- | > | + | > |
- | > | + | > |
- | >> Re: How to convert AVCHD (MTS/M2TS) to MP4 losslessly. | + | >> Re: How to convert AVCHD (MTS/M2TS) to MP4 losslessly.>Y |
- | >> | + | >> |
+ | >> Looks like your copy of FFmpeg has not been compiled for mp3 encoding, | ||
+ | >> have a look here for the fix: | ||
+ | >> HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoders in FFmpeg | ||
+ | >> http:// | ||