ffmpeg stop of transcoding for video preview after some time (flv and mp4).

1,202 views
Skip to first unread message

alex

unread,
Oct 19, 2012, 12:40:11 PM10/19/12
to ResourceSpace
Revision 3607 and later have bug:
ffmpeg stop of transcoding for video preview after some time.
Tested on movies over one hour.
Revision 3606 and before not has this bug!

Testing on Ubuntu v12.04.1 (stop of transcoding after 6 min 15 sec),
also on OpenIndiana v151a5 (also on v151a7) (stop of transcoding after
1 min 30 sec) and FreeBSD v9.1-RC1 (testing continues).
All logs is OK!
Installation Check: Status is OK for all rows!

config.php:
$ffmpeg_preview_seconds=10800;
$php_time_limit=99999;
$debug_log=true;

Also increased timeouts in PHP.ini and apache2.conf.
Browser: Firefox v16.0.1

Please check this bug and fix it!

Neil Braddy

unread,
Oct 22, 2012, 5:18:10 AM10/22/12
to resour...@googlegroups.com
I have seen a similar problem on a system with large video files and believe it is due to the verbose nature of the ffmpeg output. I tried adding '-loglevel panic' to the ffmpeg command and it seems to work ok. 

I am not sure this is the best solution as I think run_command should be able to cope with this, but can you try the attached patch and see if it works? If so I will add to the base.

Neil
ffmpeg_largefile.patch

alex

unread,
Oct 22, 2012, 10:44:13 AM10/22/12
to ResourceSpace
I canceled the changes in /include/general.php to ver 3606:
(http://svn.montala.net/websvn/comp.php?
manualorder=1&repname=ResourceSpace&compare[0]=
%2F&compare_rev[0]=3606&compare[1]=%2F&compare_rev[1]=3607)

commented line 2980 (revision 3841):
# $process = @proc_open($command, array(1 => array('pipe', 'w'), 2 =>
array('pipe', 'w')), $pipe, NULL, NULL,
add line after:
$process = @proc_open($command, array(1 => array('pipe', 'w')), $pipe,
NULL, NULL,

commented line 2986:
# debug("CLI errors: ". trim(stream_get_contents($pipe[2])));

Dear developers, it is correct?

alex

mdb

unread,
Oct 22, 2012, 12:39:49 PM10/22/12
to resour...@googlegroups.com
Adding that panic option fixed the issue I was having. my MP4 goes in now and there is a thumbnail preview that I wasnt getting before.


On a side question, how does the thumbnail image get chosen. I have several videos that have a longer lead in that is black and many of the thumbnails are black. I am assuming that there is some frame number somewhere that is set to generate the frame from.

Where is that and how can I set it for longer so I have a better chance of a non-black frame getting picked.

Thanks!

sam

unread,
Oct 23, 2012, 4:03:18 AM10/23/12
to resour...@googlegroups.com
Thanks, Neil. This patch works great  for me. I have been running RS on Windows 7. Video previews were not generated before the patch, now they are.

Sam

alex

unread,
Oct 23, 2012, 11:59:45 AM10/23/12
to ResourceSpace
mdb,

1. Create snapshot from video file in VLC player.
2. Select resource in ResourceSpace -> Edit -> Upload a Preview Image
Only.

Other way for all files:
change $snapshottime in file /resourcespace/include/
preview_preprocessing.php (line 509 revision 3841: $snapshottime = 5;)

alex

mdb

unread,
Oct 23, 2012, 1:44:05 PM10/23/12
to resour...@googlegroups.com
thanks cheers!

Worked great!

Stefan Wild

unread,
Oct 23, 2012, 2:03:14 PM10/23/12
to resour...@googlegroups.com
If that helps make conversion of large videos work, we should make the CLI output logging conditional to $debug_log being true. Can anyone confirm that? I'd be happy to do the change.

Regards,
Stefan

--
ResourceSpace hosting

alex

unread,
Oct 25, 2012, 11:15:31 AM10/25/12
to resour...@googlegroups.com
Stefan,

$debug_log=true; for tests only!

alex

Stefan Wild

unread,
Oct 26, 2012, 1:00:51 PM10/26/12
to resour...@googlegroups.com
alex,

I know it's for test/debugging only. The thing is, though, that at the output of ffmpeg (or any other command) is captured in any case (r3607 as mentioned above captures even more so that the debug_log gives more clues if something goes wrong) and $debug_log only decides whether the captured output is written to the debug.txt or not. Since that apparently causes problems with the huge output of ffmpeg for large files, I am suggesting to only capture ffmpeg output at all if $debug_log is true.

Regards,
Stefan

--
ResourceSpace hosting

Tom Gleason

unread,
Oct 26, 2012, 2:27:52 PM10/26/12
to resour...@googlegroups.com
I don't think the debug log has ever helped me solve a problem. It usually contains too much information that is pointless or irrelevant to any specific problem I want to solve. 

--
 
 



--
Tom Gleason
Buildadam - ResourceSpace Hosting & Development

Colorhythm LLC
http://www.colorhythm.com

Main Office:  +1 415-399-9921
Fax: +1 253-399-9928
Mobile:  +1 347-537-8465

tgle...@colorhythm.com

Stefan Wild

unread,
Oct 26, 2012, 3:34:32 PM10/26/12
to resour...@googlegroups.com, tgle...@colorhythm.com
I use it on a regular basis for debugging and solving problems on clients' servers (to which I sometimes have very limited access). It has also helped get proper information to help people here on the forum, who understandably sometimes have a hard time finding their webserver logs.

The captured output is also being returned as a function value, which is why I haven't made my suggested change, yet. Now, the question is – how can we make sure we get the essential information back to those calls that need it and not capture any unnessecary information for any calls, while still being able to get verbose output for debugging (log)?

Regards,
Stefan

--
ResourceSpace hosting

Henrik

unread,
Oct 30, 2012, 5:43:28 PM10/30/12
to resour...@googlegroups.com
Since r3856 where this patch was applied I don't get any previews for video files. When I tried to 'update' back to r3855 my system started to create previews of the video files again.

In the error log I read:
2012-10-30 19:08:37 CLI command: '/usr/bin/ffmpeg' -loglevel panic -i '/var/www/resourcespace/include/../filestore/8/3/6_1ec154a50e999bb/836_3410a2dbe8f2040.mp4' -f image2 -vframes 1 -ss 5 '/var/www/resourcespace/include/../filestore/8/3/6_1ec154a50e999bb/836_3410a2dbe8f2040.jpg'
2012-10-30 19:08:37 CLI output:
2012-10-30 19:08:37 CLI errors: FFmpeg version SVN-r0.5.9-4:0.5.9-0ubuntu0.10.04.1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5.9-0ubuntu0.10.04.1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1

  libpostproc   51. 2. 0 / 51. 2. 0
  built on Jun 12 2012 16:27:34, gcc: 4.4.3
/usr/bin/ffmpeg: unrecognized option '-loglevel'
2012-10-30 19:08:37 create_previews_using_im(ref=836,thumbonly=,extension=mp4,previewonly=,previewbased=,alternative=-1)
...

The loglevel option doesn't seem to be supported by my version of FFmpeg.

Best regards,
Henrik
Reply all
Reply to author
Forward
Message has been deleted
0 new messages