wiki:video_repair
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung | ||
wiki:video_repair [2021/01/12 17:16] – [ffmpeg] pulsar | wiki:video_repair [2021/05/31 14:15] (aktuell) – gelöscht techguru | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ===== Videos Encodieren ===== | ||
- | |||
- | Manche Videos lassen sich nicht abspielen wegen Codec Warnung, daher muss man manche Videos umwandeln wenn man keine Codecs installieren mag. Dies gelang gut mit '' | ||
- | |||
- | Im weiteren Schritt ließ es sich nun auch mit '' | ||
- | |||
- | |||
- | ===== Videos reparieren ===== | ||
- | |||
- | The idea is to strip off the first 44 bytes of the header, for instance with a hex editor or using '' | ||
- | |||
- | dd ibs=1 skip=44 if=' | ||
- | faad -a adts.aac raw.aac | ||
- | |||
- | |||
- | ==== mplayer mencoder ==== | ||
- | |||
- | Man kann versuchen die defekte Video-Datei mit '' | ||
- | |||
- | mencoder -forceidx -oac pcm -ovc copy corruptvideo.mp4 -o fixedvideo.avi | ||
- | |||
- | | ||
- | Springt zu 56. Sekunde | ||
- | |||
- | mencoder -ss 56 | ||
- | |||
- | |||
- | Verschiedene Optionen an '' | ||
- | |||
- | You can use the scale filer as an output option to tell ffmpeg to scale your images. This allows you | ||
- | to keep the input images at their original size. Examples: | ||
- | |||
- | < | ||
- | -vf scale=1280: | ||
- | -vf scale=1280: | ||
- | </ | ||
- | |||
- | These two scale examples would both resize your 1700x1100 input to 1280x828. The -1 tells ffmpeg to scale | ||
- | the height automatically while keeping the aspect ratio. With your input size and the requested 1280 | ||
- | output width the height would end up being 828. | ||
- | |||
- | |||
- | mplayer -nosound -vf scale=1024: | ||
- | mplayer -nosound -vo x11 -screenw 1920 -screenh 1088 20150502_006.mp4 | ||
- | | ||
- | Forced video codec: ffh264vdpau | ||
- | mplayer -vo vdpau -vc ffh264vdpau 'So Live.avi' | ||
- | | ||
- | | ||
- | ==== ffmpeg ==== | ||
- | |||
- | Das Video zu einer niedrigeren Auflösung encodieren. Oder mit ffmpeg zu einem anderen Format umwandeln: | ||
- | |||
- | ffmpeg -i "So Live.avi" | ||
- | |||
- | ffmpeg -i "So Live.avi" | ||
- | | ||
- | Hiermit wird das Video richtig klein, indem die Framsize verkleiner wird. Von 40 MB auf 5 MB verkleinert. | ||
- | |||
- | ffmpeg -i The\ Run\ of\ the\ Golden\ Bull.webm -vf " | ||
- | | ||
- | oder | ||
- | |||
- | ffmpeg -i input.mkv -vf " | ||
- | | ||
- | |||
- | 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 | ||
- | |||
- | Aus der Mitte eines Video einen bestimmten Bereich wählen. Hier ab der 11. Sekunde und ab da 31 Sekunden weiter. | ||
- | |||
- | ffmpeg -ss 00:00:11 -i half_the_frame_size.mkv -t 31 -c copy supershort01.mkv | ||
- | | ||
- | |||
- | Zweit einzelne Video Dateien zusammenfügen. Hierzu müssen die beiden oder mehrere Dateien untereinander in einer Text Datei eingetragen werden: | ||
- | |||
- | < | ||
- | cat files.txt | ||
- | file ' | ||
- | file ' | ||
- | </ | ||
- | |||
- | Anschließend beginnt das zusammenfügen mit ffmpeg | ||
- | |||
- | 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: | ||
- | |||
- | another video file which isn't broken | ||
- | |||
- | and Install some pre-requisite libraries with apt or zypper: | ||
- | |||
- | sudo apt install libavformat-dev libavcodec-dev libavutil-dev | ||
- | |||
- | Unter Suse benötigte ich noch das Paket zlib-devel | ||
- | |||
- | zypper in zlib-devel | ||
- | |||
- | |||
- | This is what to do: | ||
- | |||
- | | ||
- | Download the source code for Untrunc from the github repo: | ||
- | |||
- | wget https:// | ||
- | |||
- | Unzip the source code: | ||
- | |||
- | unzip master.zip | ||
- | |||
- | Go into the directory where it's been unzipped: | ||
- | |||
- | cd untrunc-master | ||
- | |||
- | Compile the source code using this command (all one line): | ||
- | |||
- | g++ -o untrunc file.cpp main.cpp track.cpp atom.cpp mp4.cpp -L/ | ||
- | |||
- | (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. | ||
- | |||
- | Run this command in the folder where you have unzipped and compiled Untrunc but replace the / | ||
- | |||
- | ./untrunc / | ||
- | |||
- | 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' | ||
- | |||
- | |||
- | ==== Screenshots von WebCam ==== | ||
- | |||
- | === MPlayer === | ||
- | |||
- | To use MPlayer to take snapshots from your webcam run this command from the terminal: | ||
- | |||
- | mplayer tv:// -tv driver=v4l2: | ||
- | |||
- | 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 | ||
- | |||
- | |||
- | ==== MPV ==== | ||
- | |||
- | Unter Raspberry mit OSMC bietet sich das Programm '' | ||
- | mpv av:// | ||
- | |||
- | |||
- | === Spezieller Raspberry Schalter in mpv === | ||
- | |||
- | < | ||
- | --hwdec=< | ||
- | Specify the hardware video decoding API that should be used if possible. | ||
- | back on software decoding. | ||
- | |||
- | <api> can be one of the following: | ||
- | |||
- | no | ||
- | |||
- | auto see below | ||
- | |||
- | vdpau requires --vo=vdpau or --vo=opengl (Linux only) | ||
- | |||
- | vaapi requires --vo=opengl or --vo=vaapi (Linux only) | ||
- | |||
- | vaapi-copy | ||
- | | ||
- | |||
- | videotoolbox | ||
- | | ||
- | |||
- | dxva2-copy | ||
- | | ||
- | |||
- | rpi requires --vo=rpi (Raspberry Pi only - default if available) | ||
- | |||
- | auto tries to automatically enable hardware decoding using the first available method. This still depends what VO you are using. For example, if you are not using --vo=vdpau or --vo=opengl, | ||
- | decoding will never be enabled. Also note that if the first found method doesn' | ||
- | some Linux systems). | ||
- | </ | ||
- | |||
- | ==== VLC ==== | ||
- | |||
- | VLC can also be used to view and record your webcam. In VLC's file menu, open the ' | ||
- | |||
- | vlc v4l:// : | ||
- | |||
- | This will make VLC mirror your webcam. To take stills, simply choose ' | ||
- | |||
- | < | ||
- | vlc v4l:// : | ||
- | </ | ||
- | |||
- | Kein Ton, Optionen habe ich leicht geändert am 25.12.2018 | ||
- | < | ||
- | cvlc v4l:// : | ||
- | </ | ||
- | |||
- | Für Raspberry mit OSMC optimiert | ||
- | cvlc v4l:// : |
wiki/video_repair.1610468194.txt.gz · Zuletzt geändert: 2021/01/12 17:16 von pulsar