Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

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  
 +''cat FILE1.MTS FILE2.MTS FILEx.MTS > OUTPUT.MTS'' 
 +Convert MTS files with AVCHD video format and ac3 sound format  
 +to MP4 and aac format.
  
-==== Handbrake ====+<code bash> 
 +#!/bin/bash 
 +# put here original size of movie: 
 +SIZE=1920x1080 
 +avconv-copy() { 
 +   avconv -i ${1}.MTS -c:a copy -c:v copy ${1}.mp4 
 +
 +case "$1" in 
 +(avconv) 
 +   avconv-copy $2 
 +   ;; 
 +(avconv-resize) 
 +   avconv -i ${2}.mp4 -s $SIZE -strict experimental ${2}_$SIZE.mp4 
 +   ;; 
 +(avconv-full) 
 +   avconv-copy $2 
 +   avconv -i ${2}.mp4 -s $SIZE -strict experimental ${2}_$SIZE.mp4 
 +   ;; 
 +(*) 
 +   echo "Usage: $0 avconv|avconv-resize|avconv-full <file> # ohne Endung .MTS angeben " 
 +   ;; 
 +esac 
 +</code> 
 +====== Handbrake ======
  
 Tool in ubuntu packages from [[https://handbrake.fr/]] Tool in ubuntu packages from [[https://handbrake.fr/]]
 +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, mp4box, ffmpeg ======
  
 +===== 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 =====
  
  apt-get install gpac  apt-get install gpac
Zeile 47: Zeile 79:
 </code> </code>
  
-=== ffmpeg ===+===== ffmpeg ===== 
 + 
 +//obsolete// use avconv instead 
 + 
 +This package is very common but discontinued.
  
 <code bash> <code bash>
Zeile 76: Zeile 112:
 http://stackoverflow.com/questions/24720063/how-can-i-convert-mts-file-avchd-to-mp4-by-ffmpeg-without-re-encoding-h264-v http://stackoverflow.com/questions/24720063/how-can-i-convert-mts-file-avchd-to-mp4-by-ffmpeg-without-re-encoding-h264-v
  
-=== 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
 </code> </code>
 +
 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), and the mencoder (SVN-r31722) internal demuxer doesn't like it either. The libavformat (lavf 0.6~svn20100711) demuxer/muxer seems to handle it, so that's what we'll use.+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), and the mencoder (SVN-r31722) internal demuxer doesn't like it either. The libavformat (lavf 0.6~svn20100711) demuxer/muxer seems to handle it, so that's what we'll use.
  
 If you run 'mediainfo' over an MTS file, you'll see something like this: If you run 'mediainfo' over an MTS file, you'll see something like this:
Zeile 196: Zeile 234:
     Stream size                      : 1.71 MiB (3%)     Stream size                      : 1.71 MiB (3%)
 </code> </code>
 +
 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: 
- +<code>
-    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
 +</code>
  
     This is after conversion:     This is after conversion:
  
 +<code>
     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
 +</code>
  
 +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?
  
-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   +>Looking to convert MTS into a usable format too ...
-September 17th, 2010 #3 +
-webdevelopment +
-Re: How to convert AVCHD (MTS/M2TS) to MP4 losslessly. +
- +
-looking to convert MTS into a usable format too... +
- +
-**WinFF** gives this error when trying to convert MTS files: +
- +
-    Input #0, mpegts, from '/home/admin1/Pictures/AVCHD/BDMV/STREAM/00000.MTS': +
-    Duration: 00:04:56.32, start: 1.000067, bitrate: 17173 kb/s +
-    Program 1 +
-    Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 59.94 tbr, 90k tbn, 59.94 tbc +
-    Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s +
-    Unknown encoder 'libmp3lame' +
-    Press Enter to Continue  +
- +
-Advanced reply Adv Reply   +
-September 17th, 2010 #4 +
-> Re: How to convert AVCHD (MTS/M2TS) to MP4 losslessly.>+
-> Unknown encoder 'libmp3lame'+
 > >
-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:
 > >
-HOWTOEasily enable MP3MPEG4AACand other restricted encoders in FFmpeg +   Input #0, mpegts, from '/home/admin1/Pictures/AVCHD/BDMV/STREAM/00000.MTS': 
-http://ubuntuforums.org/showthread.php?t=1117283+>    Duration: 00:04:56.32start: 1.000067bitrate: 17173 kb/s 
 +>    Program 1 
 +>    Stream #0.0[0x1011]: Video: h264yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 59.94 tbr, 90k tbn, 59.94 tbc 
 +   Stream #0.1[0x1100]Audio: ac3, 48000 Hz, stereo, s16, 256 kb/
 +>    Unknown encoder 'libmp3lame' 
 +>    Press Enter to Continue ...
 > >
->Advanced reply Adv Reply   +>Advanced reply 
->September 17th, 2010 #5 +>September 17th, 2010 #4 
->> Re: How to convert AVCHD (MTS/M2TS) to MP4 losslessly. +>> Re: How to convert AVCHD (MTS/M2TS) to MP4 losslessly.>Y 
->> this worked...+>> Unknown encoder 'libmp3lame' 
 +>> 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://ubuntuforums.org/showthread.php?t=1117283
  

QR-Code
QR-Code systemverwaltung:user_info:howto:videoedit (erstellt für aktuelle Seite)