kylegilman / video-embed-thumbnail-generator

A WordPress plugin that generates thumbnails, HTML5-compliant videos, and embed codes for locally hosted videos. Requires FFMPEG or LIBAV for encoding.
http://wordpress.org/plugins/video-embed-thumbnail-generator/
GNU General Public License v2.0
48 stars 27 forks source link

Frame sync notices lead to incomplete encoding #168

Closed kylegilman closed 9 years ago

kylegilman commented 10 years ago

@chiggyman brought this up in #165

The frame sync error probably looks like this

[libfaac @ 0x959e080] 1 frames left in the queue on closing

Need to add check for that message which will allow for the several different aac encoding libraries.

chiggyman commented 10 years ago

This is the error I've been having, is replicatable.

chiggyman commented 10 years ago

Any movement on this? I have probably 4/5 video files at the minute which I can't get up due to these niggle even though the video files have encoded fine. Is there a specific method that checks for messages in the log file to check for completion? If so I will dig around see if I can alter it

kylegilman commented 10 years ago

Can you send me a link to one of those videos? I've never been able to reproduce the bug so I can't test to make sure it's fixed. kylegilman@gmail.com if you don't want to post it publicly.

chiggyman commented 9 years ago

Sorry for the delay Kyle, video can be found at http://iotimelapse.co.uk/wp-content/uploads/2014/06/QMCA52Bridge.mov it's a big file but we have decent bandwidth so shouldn't be too bad.

kylegilman commented 9 years ago

That is a monster file. I don't know what your workflow is like, but if I were you I would compress it using Handbrake before uploading to the server. Unfortunately I did not get a frame left in the queue when compressing that file so I still don't know if my solution works. If you want to try the development version and test it yourself, you can download it here.

chiggyman commented 9 years ago

Sorry about the file size! That's weird, just tried it again using the new dev version of the plugin and it still says failed due to frames left, and that was using the video that i've put in the link above. Error listed is [libvo_aacenc @ 000000000301c000] 1 frames left in the queue on closing It's a newish version of ffmpeg, that's the only difference I can think of? What version are you using?

chiggyman commented 9 years ago

Tried to edit the preg_match statements and can't quite follow the code, just for debugging the log file of a failed encode is below, i've removed some of the status encodes as they just repeat.

ffmpeg version N-66289-gb76d613 Copyright (c) 2000-2014 the FFmpeg developers built on Sep 15 2014 22:11:04 with gcc 4.8.3 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib 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 libswscale 3. 0.100 / 3. 0.100 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 0.100 / 53. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\iotimelapse/wp-content/uploads/2014/06/QMCA52Bridge.mov': Metadata: major_brand : qt
minor_version : 537199360 compatible_brands: qt
creation_time : 2013-10-16 09:57:54 album_artist : InsideOut Timelapse description : This video is about QMC A52 Bridge title : QMC A52 Bridge timecode : 00:00:00:00 Duration: 00:04:25.92, start: 0.000000, bitrate: 109232 kb/s Stream #0:0(eng): Video: prores (apcn / 0x6E637061), yuv422p10le, 1920x1080, 107106 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc (default) Metadata: creation_time : 2013-10-16 09:57:55 handler_name : Apple Video Media Handler encoder : Apple ProRes 422 Stream #0:1(eng): Audio: pcm_s24be (in24 / 0x34326E69), 44100 Hz, stereo, s32 (24 bit), 2116 kb/s (default) Metadata: creation_time : 2013-10-16 09:57:58 handler_name : Apple Sound Media Handler Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default) Metadata: creation_time : 2013-10-16 10:01:02 handler_name : Time Code Media Handler timecode : 00:00:00:00 [libx264 @ 000000000304acc0] frame MB size (120x68) > level limit (1620) [libx264 @ 000000000304acc0] DPB size (3 frames, 24480 mbs) > level limit (0 frames, 8100 mbs) [libx264 @ 000000000304acc0] MB rate (204000) > level limit (40500) [libx264 @ 000000000304acc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 [libx264 @ 000000000304acc0] profile Constrained Baseline, level 3.0 [libx264 @ 000000000304acc0] 264 - core 142 r2479 dd79a61 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=2 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'C:\iotimelapse/wp-content/uploads/2014/10/QMCA52Bridge-fullres.mp4': Metadata: major_brand : qt
minor_version : 537199360 compatible_brands: qt
timecode : 00:00:00:00 album_artist : InsideOut Timelapse description : This video is about QMC A52 Bridge title : QMC A52 Bridge encoder : Lavf56.4.101 Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080, q=-1--1, 25 fps, 12800 tbn, 25 tbc (default) Metadata: creation_time : 2013-10-16 09:57:55 handler_name : Apple Video Media Handler encoder : Lavc56.1.100 libx264 Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, s16 (24 bit), 128 kb/s (default) Metadata: creation_time : 2013-10-16 09:57:58 handler_name : Apple Sound Media Handler encoder : Lavc56.1.100 libvo_aacenc Stream mapping: Stream #0:0 -> #0:0 (prores (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (pcm_s24be (native) -> aac (libvo_aacenc)) Press [q] to stop, [?] for help frame= 14 fps=0.0 q=0.0 size= 0kB time=00:00:00.45 bitrate= 0.9kbits/s
frame= 24 fps=3.9 q=0.0 size= 0kB time=00:00:00.49 bitrate= 0.8kbits/s
frame= 36 fps=5.4 q=0.0 size= 0kB time=00:00:00.96 bitrate= 0.4kbits/s
frame= 44 fps=5.9 q=28.0 size= 7kB time=00:00:01.44 bitrate= 41.8kbits/s
frame= 46 fps=1.3 q=28.0 size= 9kB time=00:00:01.44 bitrate= 50.2kbits/s
frame= 57 fps=1.6 q=28.0 size= 16kB time=00:00:01.96 bitrate= 64.9kbits/s
frame= 70 fps=1.9 q=28.0 size= 219kB time=00:00:02.44 bitrate= 731.7kbits/s
frame= 84 fps=2.2 q=28.0 size= 568kB time=00:00:02.95 bitrate=1573.2kbits/s
frame= 108 fps=2.8 q=28.0 size= 629kB time=00:00:03.95 bitrate=1302.6kbits/s
frame= 6603 fps= 13 q=28.0 size= 169311kB time=00:04:23.95 bitrate=5254.7kbits/s
frame= 6639 fps= 13 q=28.0 size= 169334kB time=00:04:25.46 bitrate=5225.6kbits/s
[mp4 @ 0000000003049d80] Starting second pass: moving the moov atom to the beginning of the file frame= 6648 fps= 13 q=-1.0 Lsize= 169540kB time=00:04:25.92 bitrate=5222.9kbits/s

video:165218kB audio:4155kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.098939% [libx264 @ 000000000304acc0] frame I:102 Avg QP:21.10 size:135573 [libx264 @ 000000000304acc0] frame P:6546 Avg QP:23.26 size: 23733 [libx264 @ 000000000304acc0] mb I I16..4: 38.5% 0.0% 61.5% [libx264 @ 000000000304acc0] mb P I16..4: 2.7% 0.0% 1.6% P16..4: 37.0% 6.6% 2.4% 0.0% 0.0% skip:49.7% [libx264 @ 000000000304acc0] coded y,uvDC,uvAC intra: 40.2% 66.2% 24.0% inter: 11.5% 28.6% 0.9% [libx264 @ 000000000304acc0] i16 v,h,dc,p: 49% 24% 8% 18% [libx264 @ 000000000304acc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 27% 16% 5% 6% 5% 7% 4% 6% [libx264 @ 000000000304acc0] i8c dc,h,v,p: 55% 23% 15% 6% [libx264 @ 000000000304acc0] ref P L0: 63.4% 19.3% 17.2% [libx264 @ 000000000304acc0] kb/s:5089.73 [libvo_aacenc @ 000000000304c000] 1 frames left in the queue on closing

kylegilman commented 9 years ago

The problem is libvo_aacenc, which is the worst of the available AAC encoders. The plugin is set to use any other AAC encoders if they're installed. I just forced ffmpeg to use it on my development server and I was able to duplicate the message so I'll be able to fix it now.

chiggyman commented 9 years ago

After reading that it might make more sense for me to force my ffmpeg to use the better codec?

Edit; Tried this and changed the order so the experimental aac encoder is used before libvo_aacenc and it works fine, and sounds better.. Going to look at recompiling a version of ffmpeg with libfaac etc

Also working on moving off this IIS hunk of junk..

kylegilman commented 9 years ago

Sure, if you can I would recommend re-compiling FFMPEG and enabling libfdk_aac. I've fixed this frames left in queue error though.