Welcome Guest, Not a member yet? Register   Sign In
About encoding FFMPEG and CRON
#1

[eluser]yannyannyann[/eluser]
I everybody,

My system is providing the user a form to upload a video.

After file has been uploaded I'd like to add it to a queue for files to be processed. The process is converting video file into FLV using FFMPEG.

So far so good, but I have had information about CRON JOBS, CURL, ... Is it necessary ?

I don't want the user to wait the encoding time, but give hime the opportunity to continue navigation...

Could you help me understand this as i have no experience in using these tools ?

thanks in advance,

Yann
#2

[eluser]yannyannyann[/eluser]
Precision : it's just for an administrator, there are not multiple users using the encoding tool....
#3

[eluser]bapobap[/eluser]
Basically if you have your scripts encode the file upon upload, the user will be hanging around in their browser for your server to get it done. If you have lots of this happening at the same time on one server, people will be doing a lot of waiting around.

Using something like cron, you can just take the uploaded file and put it in an encode queue. You'll then have another script come along every minute, grab some files to encode, encode them then make them available. The user won't be hanging around while this happens, as it goes on in the background.

A daemon is a step further again:

http://ffencoderd.sourceforge.net/

Hope that helps.
#4

[eluser]yannyannyann[/eluser]
I'd like to encode videos and audio files as well, example:

MOV -> FLV
WAV -> MP3


ffencoderd is able to deal with audio files as well ?
#5

[eluser]bapobap[/eluser]
I'm pretty sure ffmpeg can handle most things, give it a go and see what happens!
#6

[eluser]yannyannyann[/eluser]
Ok Encoding with FFMPEG works but I don't have any duration information in my FLV, as indicated here with this command :
Code:
$ ffmpeg -i apple-ipodshuffle-guidedtour-us-848x4801_112_2009-03-31.flv
Code:
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --prefix=/opt/local --disable-vhook --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-avfilter-lavf --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libfaac --enable-libfaad --enable-libxvid --enable-libx264 --mandir=/opt/local/share/man --enable-shared --enable-pthreads --disable-mmx --cc=gcc-4.0
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 0 / 52.20. 0
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    1. 4. 0 /  1. 4. 0
  libswscale     1. 7. 1 /  1. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Apr  1 2009 22:55:22, gcc: 4.0.1 (Apple Inc. build 5490)

Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)
Input #0, flv, from 'apple-ipodshuffle-guidedtour-us-848x4801_112_2009-03-31.flv':
  Duration: 00:00:00.00, start: 0.000000, bitrate: 364 kb/s
    Stream #0.0: Video: flv, yuv420p, 400x300, 300 kb/s, 25 tbr, 1k tbn, 1k tbc
    Stream #0.1: Audio: mp3, 11025 Hz, stereo, s16, 64 kb/s
At least one output file must be specified
Duration says : 00:00:00:00 ... wierd !

I don't understand ... this is the kind of command I'm typing :
Code:
ffmpeg -i Sequence_6_60_2009-03-81_117_2009-03-31.mov -ar 11025 -ab 64000 -r 25 -s "400x300" -f "flv" -b "300000"  -y ../flv/Sequence_6_60_2009-03-281_117_2009-03-31.flv
I have this error coming :
Code:
[libmp3lame @ 0x1806400]lame: output buffer too small (buffer index: 8359, free bytes: 1433)
Audio encoding failed

I have sound , video, ... works fine... just no duration info !!! Sad and that screws the thing in the flash player Sad


Do you think it's LAME that is not setting the duration info ? I have version 3.98.2


I would love it if you have any idea about that... Thanks in advance.
#7

[eluser]omar-303[/eluser]
i think it's something about meta-info of the FLV file , google it
#8

[eluser]oll[/eluser]
I developed exactly this kind of site with CI and ffmpeg. (a youtube like site for my job)

You have to detach the process from PHP using 'nohup &' :
http://en.wikipedia.org/wiki/Nohup

If you robust enough with Unix (Linux), you can also 'ajaxize' the log from ffmpeg so that the user knows if his video is processing or if there were an error.




Theme © iAndrew 2016 - Forum software by © MyBB