Murga-Projects Forums

Full Version: FLTK and ffmpeg
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Juergen Wrote:
Normally I don't use Xine, but mplayer, which should be able to do that whithout calling ffmpeg.
But to start with your example, you should try the following first:

Code:
ffmpeg -vd /dev/video -f video4linux -r 25 -s 352x288 -sameq -f mpeg - | xine -G 352x288 -B --no-splash stdin:/

It should work better, but I haven't tested it, since I don't have xine available at the moment.

Juergen


Well I tried that about ten or twenty times and it worked once. All the other times the camera would come on and ffmpeg would start encoding. The xine window would open and display a scrambled window. As soon as I stopped ffmpeg, the xine window would display it's normal splash screen. It makes me wonder if it is a xine or a ffmpeg issue. If mplayer is more repeatable, I guess that I will have to install it. That would be a bit of a bummer since xine works so well for me otherwise.

mikshaw Wrote:

Quote:
>/dev/null & echo $!"

Looks like this is where I was going wrong.
I'd tried "urxvt & && echo $!" and "urxvt &; echo $!", which choked, and "(urxvt &) && echo $!", which echoed nothing.
I didn't know using a single "&" would separate the commands, but that makes sense to me now.


All control operators terminate a command. Control operators are "|" "&" "||" "&&" ";" ";;" "(" ")" and a new line.

You can also write someting like os.execute("cmd1 \n cmd2 \n cmd3") or use the ";" operator to separate two commands, but you can't use two control operators together (except for newline or the subshell operators). The || and && operators also require two expressions (expression1 || expression2) which cmd& can't be because it is executed in the background and can't give anything back.

Actually the bash manpage isn't that bad. If you open it and go down a few paragraphs to the "DEFINITIONS" section you'll see it is pretty easy. Although you should be aware that bash is only a bourne compatible shell and is a mix of Korn shell, Bourne shell and POSIX shell (which is also a mix). So not everything in that manual applies to other shells.

Juergen

dvw86 Wrote:
Well I tried that about ten or twenty times and it worked once. All the other times the camera would come on and ffmpeg would start encoding. The xine window would open and display a scrambled window. As soon as I stopped ffmpeg, the xine window would display it's normal splash screen. It makes me wonder if it is a xine or a ffmpeg issue. If mplayer is more repeatable, I guess that I will have to install it. That would be a bit of a bummer since xine works so well for me otherwise.


Actually the problem might be on the Xine side of the pipeline but on the ffmpeg side. You should test it with files first. It would be a good to try something like that (bash syntax):

Code:
mkdir vout
for ((i=1;i<=20;i++))
  do
     ffmpeg -vd /dev/video -f video4linux -r 25 -s 352x288 -sameq -f mpeg -t 30 vout/clip`printf "%.2i" $i`.mpg
  done

echo vout/* | xargs xine

If that works well, then there might be a problem with the pipes, but the chance is higher that there is a problem with the video input.

Juergen

Hi,

Because of this thread I have pondering on incorporating sys_proc, sys_file, sys_comm and maybe sys_env into 0.6.8.

The code is complete and I am trying to get time to do all the tests and cross builds, but I feel that sys_file in particular would help people here ... Juergen, your thoughts ?

Cheers
JohnM

JohnMurga Wrote:
Hi,

Because of this thread I have pondering on incorporating sys_proc, sys_file, sys_comm and maybe sys_env into 0.6.8.

The code is complete and I am trying to get time to do all the tests and cross builds, but I feel that sys_file in particular would help people here ... Juergen, your thoughts ?

Cheers
JohnM


And what about luaEx (http://lua-ex.luaforge.net/) ?

LuaSys is proving to be a pain in the arse :-)

Cheers
JohnM

JohnMurga Wrote:

JohnMurga Wrote:
Hi,

Because of this thread I have pondering on incorporating sys_proc, sys_file, sys_comm and maybe sys_env into 0.6.8.

The code is complete and I am trying to get time to do all the tests and cross builds, but I feel that sys_file in particular would help people here ... Juergen, your thoughts ?

Cheers
JohnM


And what about luaEx (http://lua-ex.luaforge.net/) ?

LuaSys is proving to be a pain in the arse :-)

Cheers
JohnM

Actually I have proposed luaEx a few days ago ;-)

Nevertheless it would be good to have an IO implementation that can use buffers, work with file descriptors, can manipulate them and provides a select/poll/epoll/... type call. Also pipes and something like spawn implementation in luaex would be a really good thing.
While I have no problem with luasys, it looks very raw and is completely undocumented.

Unfortunately on Linux I have the problem that I can't use most of the external modules, because I get a segmentation fault with murgaLua.
It would also be a good idea to export the symbols from libLua, which should remove the necessity to recompile libraries for murgaLua to explicitly link against liblua. (I tested it with the original lua interpreter and it works also with UPX). Unfortunately it doesn't work this way on Windows. So for Windows it will be necessary to either distribute a liblua or compile the external modules specifically for murgaLua.

Juergen

luaEx doesn't have the IO stuff that I think you'd need ...

I have done a lot of work tidying up LuaSys and got it all working nicely on Windows last night ... If it works OK on Mac/Linux then we'll be looking good.

Primarily what you'll be getting is the IO stuff, memory buffers, serial port support, environment and and spawn implementations from LuaSys.

Fingers crossed for this evening (!)

If it all works then you are right ...
I have to document things, as LuaSys is completely undocumented :-)

Cheers
JohnM

JohnMurga Wrote:
Primarily what you'll be getting is the IO stuff, memory buffers, serial port support, environment and and spawn implementations from LuaSys.


WooHoo! Thanks! With serial port support I could use murgaLua to talk with PLC's.
PLC Info

Juergen Wrote:
Unfortunately on Linux I have the problem that I can't use most of the external modules, because I get a segmentation fault with murgaLua.
It would also be a good idea to export the symbols from libLua, which should remove the necessity to recompile libraries for murgaLua to explicitly link against liblua. (I tested it with the original lua interpreter and it works also with UPX). Unfortunately it doesn't work this way on Windows. So for Windows it will be necessary to either distribute a liblua or compile the external modules specifically for murgaLua.


I think that is due to my link options under Linux, it'll most likely work on 0.6.8 ... Either for Windows I have also put an example in place.

Either way you'll get to try it out this weekend as I'll definitely do the release in the next couple of days ...

Cheers
JohnM

Pages: 1 2
Reference URL's