wiki:video_repair
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige ÜberarbeitungLetzte ÜberarbeitungBeide Seiten, nächste Überarbeitung | ||
wiki:video_repair [2021/01/12 17:16] – [ffmpeg] pulsar | wiki: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, |
- | ffmpeg -ss 00:00:11 -i half_the_frame_size.mkv -t 31 -c copy supershort01.mkv | + | |
+ | |||
+ | |||
+ | Aus der Mitte eines Videos einen bestimmten Bereich wählen. Hier ab der 11. Sekunde und ab da 31 Sekunden weiter. | ||
+ | |||
+ | | ||
| | ||
+ | | ||
+ | Video beschleunigen | ||
+ | |||
+ | ffmpeg -i 20210112_15171777.mp4 -filter:v " | ||
+ | | ||
+ | |||
+ | Video verlangsamen | ||
+ | |||
+ | ffmpeg -i 20210112_15171777.mp4 -filter:v " | ||
+ | |||
- | Zweit einzelne Video Dateien zusammenfügen. Hierzu müssen die beiden oder mehrere Dateien untereinander in einer Text Datei eingetragen werden: | + | Zwei einzelne Video Dateien zusammenfügen. Hierzu müssen die beiden oder mehrere Dateien untereinander in einer Text Datei eingetragen werden: |
< | < | ||
cat files.txt | cat files.txt | ||
- | file '20210112_150713_mid4.mp4' | + | file '20210112_video01.mp4' |
- | file '20210112_150713_midmid.mp4' | + | file '20210112_video02.mp4' |
</ | </ | ||
- | Anschließend beginnt das zusammenfügen | + | Anschließend beginnt das zusammensetzen der Dateien |
ffmpeg -f concat -safe 0 -i files.txt -c copy output.mp4 | ffmpeg -f concat -safe 0 -i files.txt -c copy output.mp4 | ||
- | ==== Untrunc ==== | ||
- | * https:// | ||
- | * http:// | ||
- | It is possible to repair the broken mp4 or m4v file using Untrunc. For this method you need: | + | Audio, Musik, Ton aus einer Musik-Datei zu einem Video hinzufügen |
- | another video file which isn't broken | + | ffmpeg -i ronnimachtsport01.mp4 -i music.m4a -map 0:v -map 1:a -c:v copy -shortest output_mit_musik.mp4 |
- | and Install some pre-requisite libraries with apt or zypper: | ||
- | sudo apt install libavformat-dev libavcodec-dev libavutil-dev | + | ==== Untrunc ==== |
- | Unter Suse benötigte ich noch das Paket zlib-devel | + | * https:// |
- | zypper in zlib-devel | + | oder eine verbesserte Version: |
+ | * https:// | ||
- | This is what to do: | ||
- | + | Es wir neben der defekten Videodatei noch eine funktionierende Datei benötigt welche vom gleichen Gerät erstellt worden ist wie die defekte. | |
- | Download the source code for Untrunc from the github repo: | + | |
- | wget https:// | + | Zusätzlich werden noch benötigte Libraries mit '' |
- | Unzip the source code: | + | sudo apt install libavformat-dev libavcodec-dev libavutil-dev |
- | unzip master.zip | + | Unter Suse benötigte ich noch das Paket // |
- | Go into the directory where it's been unzipped: | + | zypper in zlib-devel |
- | cd untrunc-master | ||
- | Compile the source code using this command (all one line): | + | Dann '' |
- | g++ -o untrunc | + | Die Verwendung von '' |
- | (you can try skipping this step and using the ready-provided executable, but it didn't work for me) | ||
- | Then you can actually fix the video. You need both the broken video and an example working video. | + | |
+ | |||
+ | | ||
- | 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. | + | ===== Video und Bild Aufnahme ===== |
- | Run this command in the folder where you have unzipped and compiled Untrunc but replace the / | + | Mit hilfe gängiger Programme wie Mplay, mpv und Vlc |
- | ./untrunc / | + | ==== Video aufnehmen ==== |
- | Then it should churn away and hopefully produce a playable file called broken-video_fixed.m4v | + | If you want to record continuous video: |
- | That's it you're done! | + | mencoder tv:// -tv driver=v4l2: |
+ | |||
+ | Press Ctrl+c to end the recording. | ||
+ | |||
+ | Unter Debian, openSuse und weiteren zu finden | ||
+ | guvcview | ||
- | 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' | ||
Zeile 151: | 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: | ||
- | |||
- | Press Ctrl+c to end the recording. | ||
- | |||
- | Unter Debian, openSuse und weiteren zu finden | ||
- | guvcview | ||