I have been trying to get my videos onto my JomSocial site and when it goes to convert them using ffmpeg, it keeps creating empty (zero bytes) files over and over again using different filenames. When I upload the videos, they go onto the server fine, it's when the ffmpeg is converting them via cron job.
I've used the cron command recommended here on JS: lynx -source "
dev.hraworld.com/index.php?option=com_community&task=cron
". When that didn't work, I talked to the support at my server and on their suggestion used curl or wget instead of the lynx -source - all to no avail.
I'm using Joomla 3.2.3 and JomSocial 3.1.1 with php 5.4.26. If it matters, I'm using the Akeeba backup and AdminTools extensions too - pro versions.
When I try to run the cron job in my browser window (FireFox), I'm getting:
XML Parsing Error: junk after document element
Location: dev.hraworld.com/index.php?option=com_community&task=cron
Line Number 1, Column 43:<pre>FFmpeg could not convert videos</pre><pre>/usr/bin/ffmpeg -y -i
/link/to/my/sitel/dev.hraworld.com/images/videos/originalvideos/30/lYlfc0CqVxz.wmv -vcodec libx264 -acodec aac -strict -2 -crf 23 -s
480x360 /home/hraworld/public_html/dev.hraworld.com/images/videos/videos/30/0jRwKwyvsvx.mp4</pre><pre></pre><?xml version="1.0" encoding="UTF-
8" ?><messages><message>Could not convert video</message><message>No temporary videos to delete.</message><message>No files to
transfer.</message><message>No Videos to transfer.</message><message>No avatars or cover of users needed to be transferred</message><message>No
avatars or cover of groups needed to be transferred</message><message>Removed Pending Invitation for Past Event</message></messages>
^
Hi,
Can you try to execute this command via terminal on your server, please?
/usr/bin/ffmpeg -y -i /link/to/my/sitel/dev.hraworld.com/images/videos/originalv...s/30/lYlfc0CqVxz.wmv -vcodec libx264 -acodec aac -strict -2 -crf 23 -s 480x360 /home/hraworld/public_html/dev.hraworld.com/images/videos/videos/30/0jRwKwyvsvx.mp4
Please let me know what do you get then.
Anyway, your backend account is not working, can you verify it?
thank you
Metadata:
WM/ParentalRating:
WMFSDKVersion : 10.00.00.3646
WMFSDKNeeded : 0.0.0.0000
IsVBR : 0
title :
author :
copyright :
comment :
Duration: 00:01:31.99, start: 5.000000, bitrate: 1167 kb/s
Stream #0.0: Audio: wmav2, 48000 Hz, 2 channels, s16, 128 kb/s
Stream #0.1: Video: wmv3, yuv420p, 320x240, 29.97 tbr, 1k tbn, 1k tbc
[libx264 @ 0x84be90]broken ffmpeg default settings detected
[libx264 @ 0x84be90]use an encoding preset (e.g. -vpre medium)
[libx264 @ 0x84be90]preset usage: -vpre <speed> -vpre <profile>
[libx264 @ 0x84be90]speed presets are listed in x264 --help
[libx264 @ 0x84be90]profile is optional; x264 defaults to high
Output #0, mp4, to '/home/hraworld/public_html/dev.hraworld.com/images/videos/videos/30/0jRwKwyvsvx.mp4':
Stream #0.0: Video: libx264, yuv420p, 480x360, q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
Stream #0.1: Audio: libfaac, 48000 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
You are using centos right? can you read here for how to fix this issue in centos www.dropbox.com/s/vhekitc2zkxo9s8/FFMPEG...0a%20Centos%206X.pdf
I had to go ask for help on the path for ffmpeg/flvtool2, but they are /usr/bin/ffmpeg and /usr/bin/flvtool2.
here's the other info - for ffmpeg:
This email address is being protected from spambots. You need JavaScript enabled to view it. [~]# ffmpeg
FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
built on Jan 29 2012 23:55:02 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
and for flvtool2:
This email address is being protected from spambots. You need JavaScript enabled to view it. [~]# flvtool2
FLVTool2 1.0.6
Copyright (c) 2005-2007 Norman Timmler (inlet media e.K., Hamburg, Germany)
Get the latest version from
www.inlet-media.de/flvtool2
This program is published under the BSD license.
Usage: flvtool2 [-ACDPUVaciklnoprstvx]... [-key:value]... in-path|stdin [out-path|stdout]
If out-path is omitted, in-path will be overwritten.
In-path can be a single file, or a directory. If in-path is a directory,
out-path has to be likewise, or can be omitted. Directory recursion
is controlled by the -r switch. You can use stdin and stdout keywords
as in- and out-path for piping or redirecting.
Chain commands like that: -UP (updates FLV file than prints out meta data)
Commands:
-A Adds tags from -t tags-file
-C Cuts file using -i inpoint and -o outpoint
-D Debugs file (writes a lot to stdout)
-H Helpscreen will be shown
-P Prints out meta data to stdout
-U Updates FLV with an onMetaTag event
Switches:
-a Collapse space between cutted regions
-c Compatibility mode calculates some onMetaTag values different
-key:value Key-value-pair for onMetaData tag (overwrites generated values)
-i timestamp Inpoint for cut command in miliseconds
-k Keyframe mode slides onCuePoint(navigation) tags added by the
add command to nearest keyframe position
-l Logs FLV stream reading to stream.log in current directory
-n Number of tag to debug
-o timestamp Outpoint for cut command in miliseconds
-p Preserve mode only updates FLVs that have not been processed
before
-r Recursion for directory processing
-s Simulation mode never writes FLV data to out-path
-t path Tagfile (MetaTags written in XML)
-v Verbose mode
-x XML mode instead of YAML mode
REPORT BUGS at
projects.inlet-media.de/flvtool2
Hi,
I think you current FFMPEG Path is correct, but the problem is come from your FFMPE setting in your server.. so please read again carefully the pdf file from me... in that doc you can see how to troubleshoot this issue.
thank you
ok, we've gone through this before, but here's the output for the version and the path for both ffmpeg and flvtool2:
FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
built on Jan 29 2012 23:55:02 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
ffmpeg: missing argument for option 'v'
This email address is being protected from spambots. You need JavaScript enabled to view it. [~]# whereis ffmpeg
ffmpeg: /usr/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz
This email address is being protected from spambots. You need JavaScript enabled to view it. [~]# whereis flvtool2
flvtool2: /usr/bin/flvtool2
This email address is being protected from spambots. You need JavaScript enabled to view it. [~]# flvtool2 -v
FLVTool2 1.0.6
Copyright (c) 2005-2007 Norman Timmler (inlet media e.K., Hamburg, Germany)
Get the latest version from www.inlet-media.de/flvtool2
This program is published under the BSD license.
Usage: flvtool2 [-ACDPUVaciklnoprstvx]... [-key:value]... in-path|stdin [out-path|stdout]
If out-path is omitted, in-path will be overwritten.
In-path can be a single file, or a directory. If in-path is a directory,
out-path has to be likewise, or can be omitted. Directory recursion
is controlled by the -r switch. You can use stdin and stdout keywords
as in- and out-path for piping or redirecting.
Chain commands like that: -UP (updates FLV file than prints out meta data)
Commands:
-A Adds tags from -t tags-file
-C Cuts file using -i inpoint and -o outpoint
-D Debugs file (writes a lot to stdout)
-H Helpscreen will be shown
-P Prints out meta data to stdout
-U Updates FLV with an onMetaTag event
Switches:
-a Collapse space between cutted regions
-c Compatibility mode calculates some onMetaTag values different
-key:value Key-value-pair for onMetaData tag (overwrites generated values)
-i timestamp Inpoint for cut command in miliseconds
-k Keyframe mode slides onCuePoint(navigation) tags added by the
add command to nearest keyframe position
-l Logs FLV stream reading to stream.log in current directory
-n Number of tag to debug
-o timestamp Outpoint for cut command in miliseconds
-p Preserve mode only updates FLVs that have not been processed
before
-r Recursion for directory processing
-s Simulation mode never writes FLV data to out-path
-t path Tagfile (MetaTags written in XML)
-v Verbose mode
-x XML mode instead of YAML mode
REPORT BUGS at projects.inlet-media.de/flvtool2
Powered by Riva VX, rivavx.com
Hi Philip,
Lets see if we can get this worked out so you can get videos to convert on the server. There are a few things that i'd like you to try and if you could try these one at a time so we can see if we can find what the problem is
1. The first thing to do is ask you server administrator what the path is to your FFMPEG i notice that there are two /usr/bin/ffmpeg /usr/share/ffmpeg. Normally is would be /usr/bin/ffmpeg but please double check with your server admin. it looks like there is 2 copies on your server.
2. Can you please make a change to the file /components/com_community/helpers/videos.php
around line 279 please change the build FFMPEg code to this
// Build the ffmpeg command
$config = CFactory::getConfig();
$cmd = array();
$cmd[] = $this->ffmpeg;
$cmd[] = '-y -i ' . $videoIn;
/**
+ * @uses Server must compiled with libx264
+ */
$cmd[] = '-vcodec libx264';
$cmd[] = '-acodec aac -ab 64k'; /* Set a lower bitrate (for example "-ab 64k") */
$cmd[] = '-strict -2';
$cmd[] = '-crf 23';
$cmd[] = '-s ' . $videoSize;
$cmd[] = $config->get('customCommandForVideo');
$cmd[] = $videoFullPath;
index.php?option=com_community&task=cron
http://www.yoursite.com/index.php?option=com_community&task=cron
Paul,
thanks for the reply. We're in the middle of a bunch of doctor's appointments - did half today and the rest tomorrow. When we get home tomorrow afternoon, I'll follow your instructions and then post the results.
I think I had mentioned in one of my posts that we had asked the server support and the correct paths are /usr/bin/ffmpeg and /usr/bin/flvtool2. The rest of it I'll work on tomorrow.
Also, it seems that something happened to the site. When we get back at it tomorrow, I'm re-doing the site and we'll go from there.
One quick question - when I redo the site, should I use the newest RC3 of JS or stay with the stable 3.1.1 version?
Thanks again,
Mickey
Hi Philip,
If you are planning to setup the site and test / build it for the next week or so then RC3 is ok to install, but if you are going to install your site and make it live then i recommend using the stable release. I hope this makes sense.
I'll wait for your reply in a few days. I hope all goes well with the doctors. :)
Paul,
I apologize for the delay. We had some problems with our computers and phone lines. We're back online now.
I have to work tonight, but when I get home in the morning, I'll work on the site some more and post the results.
Thanks for your patience.
Mickey
Hi Mickey,
I have had a good look at this and spoken with your hosting provider, The version of ffmpeg on the hosting account is 0.65 which is from 2012 This is a very old version and has incompatibilities with current code. I asked them about upgrading it and they replied with "it is something we will be doing but do not know when". we have tested ffmpeg on centos which i confirmed is the server they are running and FFMPEG would need to be upgrade for it to process videos.though Jomsocial
I notice that you mentioned you have used other applications and they convert OK on this server, but it is not that simple. We use the libx264 codec and they may be using a different one for there conversion.
This really is an issue you will have to peruse with the hosting company.
Because we are not able to view the sever logs (for obvious reasons) The support person said he was happy to look at the logs when the cron was run, but i then got no response back from them. This may be something you can follow up with them and get them to look in the logs for the error.
I also see in some previous replies there is a few errors coming back [libx264 @ 0x84be90]broken ffmpeg default settings detected.maybe discuss this with them also