Benutzer-Werkzeuge

Webseiten-Werkzeuge


wiki:video_repair

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
Letzte ÜberarbeitungBeide Seiten, nächste Überarbeitung
wiki:video_repair [2021/01/12 23:07] – [ffmpeg] pulsarwiki:video_repair [2021/05/31 14:12] techguru
Zeile 68: Zeile 68:
 Nur die ersten 30 Sekunden eines Videos in eine neue Datei speichern Nur die ersten 30 Sekunden eines Videos in eine neue Datei speichern
  
-  ffmpeg -i half_the_frame_size.mkv -t 00:00:30 TheRunoftheGoldenBull.mkv+  ffmpeg -i originalfilm.mkv -t 00:00:30 TheRunoftheGoldenBull.mkv
  
-Aus der Mitte eines Video einen bestimmten Bereich wählen. Hier ab der 11. Sekunde und ab da 31 Sekunden weiter.+Da der obige Kommando sehr lange dauerte, ohne sichtbare Qualitätsunterschiede, habe ich den folgenden Kommando genommen der wesentlich schneller ist:
  
-  ffmpeg -ss 00:00:11 -i half_the_frame_size.mkv -t 31 -c copy supershort01.mkv+  ffmpeg -i originalfilm.mkv -t 00:00:30 -c copy TheRunoftheGoldenBull_30s.mkv 
 + 
 + 
 +Aus der Mitte eines Videos einen bestimmten Bereich wählen. Hier ab der 11. Sekunde und ab da 31 Sekunden weiter. 
 + 
 +  ffmpeg -ss 00:00:11 -i originalfilm.mkv -t 31 -c copy supershort01.mkv
      
      
Zeile 79: Zeile 84:
   ffmpeg -i 20210112_15171777.mp4 -filter:v "setpts=0.5*PTS" output_fast.mp4   ffmpeg -i 20210112_15171777.mp4 -filter:v "setpts=0.5*PTS" output_fast.mp4
      
 +
 Video verlangsamen Video verlangsamen
  
Zeile 88: Zeile 94:
 <code> <code>
 cat files.txt cat files.txt
-file '20210112_150713_mid4.mp4' +file '20210112_video01.mp4' 
-file '20210112_150713_midmid.mp4'+file '20210112_video02.mp4'
 </code> </code>
  
Zeile 106: Zeile 112:
  
   * https://github.com/ponchio/untrunc   * https://github.com/ponchio/untrunc
-  * http://vcg.isti.cnr.it/~ponchio/untrunc.php 
  
-It is possible to repair the broken mp4 or m4v file using Untrunc. For this method you need:+oder eine verbesserte Version:
  
-another video file which isn't broken+  * https://github.com/anthwlock/untrunc
  
-and Install some pre-requisite libraries with apt or zypper:+ 
 +Es wir neben der defekten Videodatei noch eine funktionierende Datei benötigt welche vom gleichen Gerät erstellt worden ist wie die defekte. 
 + 
 +Zusätzlich werden noch benötigte Libraries mit ''apt'' oder ''zypper'' installiert:
  
   sudo apt install libavformat-dev libavcodec-dev libavutil-dev   sudo apt install libavformat-dev libavcodec-dev libavutil-dev
  
-Unter Suse benötigte ich noch das Paket zlib-devel+Unter Suse benötigte ich noch das Paket //zlib-devel//
  
   zypper in zlib-devel   zypper in zlib-devel
  
  
-This is what to do:+Dann ''untrunc'' nach der README kompilieren und installieren.
  
-   +Die Verwendung von ''untrunc'' geschieht durch den Aufruf des Programms mit benötigten Optionen ''-s''  - step through unknown sequences und optional ''-v'' damit ausführliche Informationen ausgeben werden. Anschließend wird eine funktionierende Videodatei und die defekten Videodatei übergeben.
-Download the source code for Untrunc from the github repo:+
  
-  wget https://github.com/ponchio/untrunc/archive/master.zip 
  
-Unzip the source code:+  ./untrunc -v -s ../../Videos/20150514_001.mp4 ../20150502_006_defekt.mp4 
 +   
 +  
  
-  unzip master.zip+===== Video und Bild Aufnahme =====
  
-Go into the directory where it's been unzipped:+Mit hilfe gängiger Programme wie Mplay, mpv und Vlc
  
-  cd untrunc-master+==== Video aufnehmen ====
  
-Compile the source code using this command (all one line):+If you want to record continuous video:
  
-  g++ -o untrunc file.cpp main.cpp track.cpp atom.cpp mp4.cpp -L/usr/local/lib -lavformat -lavcodec -lavutil+  mencoder tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0:forceaudio:adevice=/dev/dsp -ovc lavc -oac mp3lame -lameopts cbr:br=64:mode=3 -o filename.avi
  
-(you can try skipping this step and using the ready-provided executable, but it didn't work for me)+Press Ctrl+c to end the recording.
  
-Then you can actually fix the video. You need both the broken video and an example working video. +Unter Debian, openSuse und weiteren zu finden 
- +  guvcview             | GTK+ UVC Viewer and Capturer           | Paket 
-Ideally the video should be from the same camera & have the same resolution (mine was but it might work without). Also if it is at least as long as the broken one (preferably roughly the same) this may help. +
- +
-Run this command in the folder where you have unzipped and compiled Untrunc but replace the /path/to/... bits with your 2 video files: +
- +
-  ./untrunc /path/to/working-video.m4v /path/to/broken-video.m4v +
- +
-Then it should churn away and hopefully produce a playable file called broken-video_fixed.m4v +
- +
-That's it you're done!+
  
-VLC Media Player should now be able to play the file. However it may be reporting the wrong length information (Untrunc tries to guess/work this out, but doesn't always get it right). To fix this try re-encoding the video through another program. 
  
  
Zeile 167: Zeile 165:
 From here you have to press s to take the snapshot. The snapshot will be saved in your current folder as shotXXXX.png. From here you have to press s to take the snapshot. The snapshot will be saved in your current folder as shotXXXX.png.
  
-===== Video aufnehmen ===== 
  
-If you want to record continuous video: 
- 
-  mencoder tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0:forceaudio:adevice=/dev/dsp -ovc lavc -oac mp3lame -lameopts cbr:br=64:mode=3 -o filename.avi 
- 
-Press Ctrl+c to end the recording. 
- 
-Unter Debian, openSuse und weiteren zu finden 
-  guvcview             | GTK+ UVC Viewer and Capturer           | Paket