Konvertieren problematischer 9.99fps-Videos in etwas Standard (ffmpeg?)

515
Sai

Ich habe kürzlich ein CCTV-Video über eine FOIA / PA-Anfrage erhalten. Ich möchte die Vollversion auf YouTube sowie die mit Final Cut Pro bearbeitete Version veröffentlichen. Handbrake, Quicktime, Final Cut Pro und YouTube können die ursprüngliche .avi-Datei jedoch nicht alle öffnen. :-(

ffmpeg -i sagt für avi-eingang # 0 (es gibt keinen audio-teil):

 Duration: 00:48:48.73, start: 0.000000, bitrate: 2497 kb/s Stream #0:0: Video: h264 (Main) (V264 / 0x34363256), yuv420p, 1280x960, 2495 kb/s, 9.99 fps, 9.99 tbr, 9.99 tbn, 19.98 tbc 

Das Protokoll von Handbrake zeigte dies vor dem Aufgeben von "Keine gültige Quelle gefunden" (beachten Sie die tbr-Diskrepanz vs ffmpeg -i):

 Duration: 00:48:48.72, start: 0.000000, bitrate: 2497 kb/s Stream #0.0: Video: V264 / 0x34363256, 1280x960, 10 fps, 29.97 tbr, 9.99 tbn [13:54:47] scan: decoding previews for title 1 [13:55:28] scan: could not get a decoded picture [13:55:38] scan: could not get a decoded picture [13:55:43] scan: could not get a decoded picture [13:55:49] scan: could not get a decoded picture [13:55:54] scan: could not get a decoded picture [13:55:58] scan: could not get a decoded picture [13:56:03] scan: could not get a decoded picture [13:56:06] scan: could not get a decoded picture [13:56:07] Warning: Could not read data for preview 9, skipped [13:56:07] Warning: Could not read data for preview 10, skipped [13:56:07] libhb: scan thread found 0 valid title(s) [13:56:07] macgui: ScanDone state received from fHandle 

VLC ist in der Lage, es gut abzuspielen, aber ich habe es nicht geschafft, dass VLC es in etwas Nutzbares umcodiert. Ein Versuch, in m4v umzucodieren und in FCP zu importieren, führte zu einem seltsamen, stotternden und mondaleren Video, als FCP versuchte, es in ein normales FPS umzuwandeln. (Edit: Nicht FCPs Schuld; der Transcode selbst war fehlerhaft. Habe jetzt auch VLCs Transcode auf mp4 h264 mit fps @ 30 gesetzt [außer fps nicht gesetzt, und dessen Transcode-Assistent)]; der fps @ 30-Versuch schlug fehl sogar etwas spielbares ausgeben.> <)

Wie kann ich das in etwas konvertieren, das eine normale Größe / fps / Codec hat, damit ich es in FCP bearbeiten und in die YouTube- Spezifikationen hochladen kann ?

Ich vermute, dass ffmpeg in der Lage sein sollte, den Job zu erledigen, aber ich bin mir nicht sicher, wie ich vorgehen soll.

ETA: Versuchen Sie jetzt Folgendes: ffmpeg -i input.avi -r "29.97" -an -sn -c:v libx264 -qp 0 -preset ultrafast -pix_fmt yuv420p -f mp4 -benchmark output.mp4- Versuchen Sie nicht, zu diesem Zeitpunkt eine Komprimierung durchzuführen, nur um etwas zu erreichen, das in FCP & YT funktioniert.

ETA2: Ausgabe von oben in VLC abspielbar, nicht in QT oder FCP (aber FCP noch nicht für optimierte / Proxy-Medien transcodieren lassen). In VLC hat es 29,97 fps, stottert nicht. Ungefähr das 11-fache der Größe des Originals (~ 11,5 GB vs. 914 MB) oo

Erneuter Versuch -crf 18 -preset slowstatt qp 0 -preset ultrafastzu sehen, ob ich eine überschaubarere Größe erhalten kann, ohne merklichen Qualitätsverlust. ffmpeg-Dokumente warnen davor, dass viele Dinge nicht verlustfrei kompatibel sind (sagen aber, dass YouTube dies ist).

ETA3: Sieht so aus, als hätte der letzte gearbeitet. Kann in QuickTime und FCP angezeigt werden. Partielle Bearbeitung jetzt in YT hochladen. Yay!

1
Versuchter Kompressor, unabhängig von FCP? Tetsujin vor 9 Jahren 0
@Tetsujin Yup, das war eigentlich mein erster Versuch. Compressor konnte die Datei nicht in der Vorschau anzeigen und gab ein völlig weißes Video mit falscher Länge aus. Sai vor 9 Jahren 0
Ich habe nicht das Wissen, um mit irgendeiner Autorität zu antworten, aber ich glaube, dass das Quell-Vid seine tatsächlichen Statistiken nicht korrekt angibt. Sie befinden sich also in einem "hacky" -Bereich, um diese Header zu ersetzen oder zu überschreiben. [außerhalb meines Fachgebiets, sorry] Tetsujin vor 9 Jahren 0
@Tetsujin Das ist durchaus möglich. FWIW, andere Dokumente von FOIA zeigten, dass die Mitarbeiter der Agentur selbst beim Lesen des Quellvideos Schwierigkeiten hatten. Sie erwähnen, dass das Quellvideo Verint-Videocodec war. Ich weiß nicht, ob das Video, das ich zur Verfügung gestellt habe, dem Video entspricht, auf das sie sich beziehen, oder eine Art Transcode davon. Sai vor 9 Jahren 0

1 Antwort auf die Frage

1
Sai

Folgendes hat letztendlich für mich funktioniert:

ffmpeg -i input.avi -r "29.97" -an -sn -c:v libx264 -crf 18 -preset slow -pix_fmt yuv420p -f mp4 -benchmark output.mp4

Einzelheiten:

ffmpeg version 2.4.1 Copyright (c) 2000-2014 the FFmpeg developers built on Sep 28 2014 17:37:55 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --enable-vda --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid libavutil 54. 7.100 / 54. 7.100 libavcodec 56. 1.100 / 56. 1.100 libavformat 56. 4.101 / 56. 4.101 libavdevice 56. 0.100 / 56. 0.100 libavfilter 5. 1.100 / 5. 1.100 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 0.100 / 3. 0.100 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 0.100 / 53. 0.100 Input #0, avi, from 'input.avi': Duration: 00:48:48.73, start: 0.000000, bitrate: 2497 kb/s Stream #0:0: Video: h264 (Main) (V264 / 0x34363256), yuv420p, 1280x960, 2495 kb/s, 9.99 fps, 9.99 tbr, 9.99 tbn, 19.98 tbc [libx264 @ 0x7ff583005800] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX [libx264 @ 0x7ff583005800] profile High, level 4.0 [libx264 @ 0x7ff583005800] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=crf mbtree=1 crf=18.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'output.mp4': Metadata: encoder : Lavf56.4.101 Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x960, q=-1--1, 29.97 fps, 11988 tbn, 29.97 tbc Metadata: encoder : Lavc56.1.100 libx264 Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help frame=87772 fps= 11 q=-1.0 Lsize= 1800751kB time=00:48:48.59 bitrate=5037.1kbits/s dup=58545 drop=0 video:1799693kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.058756% bench: utime=18905.661s bench: maxrss=381239296kB [libx264 @ 0x7ff583005800] frame I:352 Avg QP:13.93 size:362691 [libx264 @ 0x7ff583005800] frame P:28322 Avg QP:16.87 size: 48853 [libx264 @ 0x7ff583005800] frame B:59098 Avg QP:20.71 size: 5611 [libx264 @ 0x7ff583005800] consecutive B-frames: 2.3% 23.2% 1.5% 73.0% [libx264 @ 0x7ff583005800] mb I I16..4: 14.7% 27.1% 58.2% [libx264 @ 0x7ff583005800] mb P I16..4: 0.8% 1.1% 1.1% P16..4: 43.3% 7.4% 6.6% 0.0% 0.0% skip:39.7% [libx264 @ 0x7ff583005800] mb B I16..4: 0.1% 0.1% 0.0% B16..8: 18.8% 2.0% 0.8% direct: 1.6% skip:76.5% L0:49.7% L1:46.8% BI: 3.4% [libx264 @ 0x7ff583005800] 8x8 transform intra:35.1% inter:14.5% [libx264 @ 0x7ff583005800] direct mvs spatial:100.0% temporal:0.0% [libx264 @ 0x7ff583005800] coded y,uvDC,uvAC intra: 87.7% 87.0% 66.9% inter: 15.9% 13.2% 7.3% [libx264 @ 0x7ff583005800] i16 v,h,dc,p: 10% 9% 19% 63% [libx264 @ 0x7ff583005800] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 17% 16% 6% 7% 7% 10% 8% 13% [libx264 @ 0x7ff583005800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 9% 8% 9% 11% 10% 12% 11% 18% [libx264 @ 0x7ff583005800] i8c dc,h,v,p: 52% 17% 20% 10% [libx264 @ 0x7ff583005800] Weighted P-Frames: Y:0.1% UV:0.0% [libx264 @ 0x7ff583005800] ref P L0: 82.7% 3.9% 6.2% 5.1% 1.7% 0.4% 0.0% [libx264 @ 0x7ff583005800] ref B L0: 93.4% 4.4% 1.9% 0.3% [libx264 @ 0x7ff583005800] ref B L1: 97.6% 2.4% [libx264 @ 0x7ff583005800] kb/s:5034.07