Hi,

august wrote:

> Yeah, Cinelerra almost NEVER reacts as you would expect.  :)  
> 
> I would expect that if I load a video with ./cinelerra myvid.mov, it
> would set the internal cinelerra output format to be the same as the
> loaded video.  However, this does not happen. Because cinelerra works
> with heterogeneous media, you need to go into settings and set it to
> what you want.  The weird thing is that it doesn't take these settings
> on immediately.  You have to quit cinelerra and then start it again.
> Humbug. 

Ok but if I edit multiple of such files, I cannot load them at the
commandline. Nevermind, it was some time ago and I don't know if and
when I'll work with cinelerra again.

> Ok, I didnt look at the log window.
> 
> I just tried the same operation now that failed before...and it is
> working.

:)

> So, you are redirecting stderr to the log window?

No, I have a logging mechanism, which sends messages to stderr by
default. You can define a message queue where the messages are sent.

The code would look like that:

#include <gmerlin/translation.h>
#include <gmerlin/log.h>

void flush_log_queue(bg_msg_queue_t * q)
   {
   bg_msg_t * msg;
   char * message;
   char * domain;
   int id;

   while((msg = bg_msg_queue_try_lock_read(q)))
     {
     id = bg_msg_get_id(msg);
     domain = bg_msg_get_arg_string(msg, 0);  // Module, which sent the message
     message = bg_msg_get_arg_string(msg, 1); // Message string

     switch(id)
       {
       case BG_LOG_DEBUG:
         // Got debug message
         break;
       case BG_LOG_INFO:
         // Got info message
         break;
       case BG_LOG_WARNING:
         // Got warning
         break;
       case BG_LOG_ERROR:
         // Got error
         break;
       }
     free(domain);
     free(message);
     bg_msg_queue_unlock_read(q);
     }

   }

main()
   {
   bg_msg_queue_t * log_queue;

   log_queue = bg_msg_queue_create();

   bg_log_set_dest(log_queue); // Tell libgmerlin to sent log messages to your 
queue

   /*
    *  Do something here, which triggers log messages
    *  .....
    */

   flush_log_queue(log_queue); // Catch messages

   }

Of course the log queue must be flushed regularly (i.e. within the
processing loop). In my GUI apps I use a gtk timeout for that.

It might be a bit confusing that the messages are proccessed
ansynchronously, but this is necessary because messages can come from
different threads.

The same messages queues are used throughout libgmerlin for inter-thread
communication. I can also serialize messages and send them through pipes or
sockets for inter-process communication (this is how my remote-control
works).

>>> I just need to learn the interfaces :)
>> Which options do you want your users to change?
> 
> just so you know, I'm building scripting bindings in javascript for
> gavl/gmerlin using mozilla's tracemonkey api. 
> 
> For one, I'd like them to be able to switch between mp4 and ogg theora.

That can be done by having 2 bg_cfg_sections.

>>From there, I'm not sure how to handle it.  Maybe I could return a
> javascript object with key value pairs for them to edit and re-submit to
> the encoder.  

If you also want to adjust parameters it gets more difficult because
you need to know where the parameters are stored (probably in some
subsection).

But if things like 3 quality levels are enough, I would simply have
one section for each.

>> [...]
>>> of course.  It seems like we were able to squash a few bugs here an
>>> there ..so cheers for that!
>> These should be fixed as well:
>>
>> AC3 in AVI with libquicktime (just did the right CVS commit)
> 
>       Hmm.  I just did a make distclean;cvs update;./configure;make;make
>       install in libquicktime, gmerlin, and gmerlin_encoders
> 
>       with Quictime encoder, using AVI/AC3/H264
> 
>               mplayer only plays the audio
>               gmerlin_play hangs and says:
>                       [GL] Warning: GLX version too old: requested >= 1.3 but 
> got 1.2
>                       [gmerlin_player] Info: Name: testvideo
>                       [h264 @ 0x202b570]no frame!
>                       [avdecoder.ffmpeg_video] Error: Could not get initial 
> frame
>                       [avdecoder.track] Error: Starting video decoder for 
> stream 1
>                       failed
>                       [player.input] Error: Starting input plugin failed
>                       ^C

H.264 in AVI doesn't work yet. I'll check if I find something about that.
There are different ways to pack H.264 into a container and I'm pretty sure that
AVI is different from mov/mp4.

> using ffmpeg encoder  AVI/AC3/MPEG4
> 
>       my encoding app hangs at "[encoder] Info: Created output file
>       testvideo.avi"
> 
>       with AVI/AC3/Divx
> 
>               same as above
> 
>       with AVI/AC3/Mjpeg
> 
>               it encodes, but gmerlin_play only shows a black screen
>               and then hangs at the end.
>               mplayer shows a grey screen. and then goes black and hangs at 
> the
>               end.
> 
>       with AVI/16pcm/Mpeg4
> 
>               encoding app hangs at "[encoder] Info: Created output file
>               testvideo.avi"
> 
>       with AVI/16pcm/Divx
>               same as above
> 
>       with AVI/16pcm/Mjpeg
> 
>       it encodes, but gmerlin_play only shows a black screen
>       and then hangs at the end.
>       mplayer shows a grey screen. and then goes black
>       and hangs at the
>       end.

Will investigate these.

Burkhard

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Gmerlin-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gmerlin-general

Reply via email to