Hi. Still working on my shared memory module.
The module worked nicely with the sdl consumer, but had some issues when I
tried to pass the frames to an avformat consumer.
First it was throwing a "bitrate tolerance too low for bitrate" error, and
debugging that, I got to this change:
https://github.com/inaes-tic/mlt/commit/005f3e878d54623a71f9dd3b43dc1bc238b77af8
That change on the producer breaks the sdl consumer, it starts skipping
frames if I run just
$ melt -producer posixshm
then a lot of frames get skipped. I'm writing the data on the shared memory
as on-cue as possible every 1/fps, and returning from get_frame as soon as
the memory gets written with a new frame. Moving the blocking call to
get_image segfaults I think when there's a call to get_audio where the data
hasn't been set up yet, but if the problem may be in blocking get_frame
instead of get_image, I think this can be solved
Besides that, and back to the avformat consumer, and the commit I linked to
above, I was loading the frame_rate_den and frame_rate_num values crossed
around from the shared mem. That fixed that, and now I get quite a good
framerate from avformat. My test setup is like this:
in three different consoles, I run:
$ melt test.mp4 -consumer posixshm
$ ffplay -fflags nobuffeudp://localhost:1234
and I play around with the streamer's parameters, but basically, it's
$ melt -producer posixshm -consumer
avformat:udp://localhost:1234?pkt_size=1316\&reuse=1 terminate_on_pause=0
f=mpegts vcodec=mpeg4 vb=3000k ab=128k
(test.mp4 is a 1920x800, 2h long clip)
so when I say "quite good framerate" I mean what I see from ffplay.
It's still nowhere near what I get if I stream straight from the file,
instead of from my producer. I see a number of what I think are frames
skipped by avformat
Not only that, but if I set up any parameters that make the avformat
consumer change the profile, so it doesn't get reloaded by melt with my
producer-provided parameters, the avformat output is way below realtime (if
for example I add s=320x240 to the parameters), I see about 5fps in a 30fps
clip. If I set real_time=1, then avformat stops running slowly, and starts
skipping frames. I seem to get the best result with real_time=0 but it's
far from ideal, and the reported frames go way faster.
Funny thing: if I hit pause in melt (5) on the streamer, audio stops, but
video keeps advancing.
There were a couple of issues I'd had because I didn't set up the right
metadata on the producer_init function, so I was thinking this might have
something to do with that? is there anywhere I can get a full list of the
metadata I absolutely need to fill in in order for this to work correctly?
Is there a way of telling avformat that the input is a stream, and that it
should output the frames it gets inmediatly, not skipping them if in any
case?
Thanks a lot
Tomas
--
"The whole of Japan is pure invention. There is no such country, there are
no such people" --Oscar Wilde
|_|0|_|
|_|_|0|
|0|0|0|
(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel