video issue -- thinking out loud and could do with help please

classic Classic list List threaded Threaded
6 messages Options
Mike Scott-2 Mike Scott-2
Reply | Threaded
Open this post in threaded view
|

video issue -- thinking out loud and could do with help please

OK. I'm well out of my depth, but this problem has been around too long
unfixed and it needs fixing. If I 'think out loud' here, maybe others
could chip in? Sorry this is a bit lengthy.

The problem: a video on an Impress slide starts and finishes with an
inappropriate frame displayed. I've made a series of test videos, the
frames simply containing the frame number from 0....N-1, and in a
selection of formats (.mp4, .flv and ".avi") using avconv. I then embed
that video into a slide using Insert|Audio or Video.

A placeholder frame from the video is displayed during editing. This is
a frame from within the video, but it isn't always the same one. It
depends on the length and format and frame-rate of the video. So, for
example, using 15fps, a 50-frame flv video shows the frame #24 (the 25th
frame, starting at #0), A 35-frame video shows #12, and a 25-framer
shows #0. a long mp4 shows #30, a 10-frame mp4 shows #5, with a
selection between. An avi just shows a question mark, presumably because
something can't seek into the video (supposition!).

For comparison, a 1500-frame clip at 15fps starts on frame #30; at
25fps, it starts on frame #75.

Much the same also applies to LO6's property page video preview - with
the addition that when the seek slider is tweaked, the placeholder is
also shown while the slider is being moved (it usually settles down to
show a reasonable frame, not always.)


****
The big deal-breaker is that this placeholder frame is shown during the
slide show when the slide appears and before the video plays (a long
time if there's a slow transition), and also when the video has
finished. This means at the very least an annoying flicker at the start,
and a usually totally inappropriate ending.
****


Versions don't seem important - it's been there at least since LO3, and
is still in LO6. (And, if I recall, even since OOo) FWIW I'm using 5.1.6.2

I'm using linux Mint; I can't check now, but from memory the same sort
of issue used to arise on Windows. So presumably the issue lies
somewhere in the LO source code, and not for example the gstreamer library.

So, I've been looking particularly at the avmedia directory; I have
however failed miserably to find anything at all that might relate to
the above observations. (Not helped by my decidedly dated experience of
C++ :-{ ). If anyone has any experience/knowledge/insights into
whereabouts to look, that would be great.

Sorry that's so long, but I think the symptoms need documenting
somewhere. Any thoughts at all would be most welcome - thanks.



--
Mike Scott (unet2 <at> [deletethis] scottsonline.org.uk)
Harlow Essex England
"The only way is Brexit" -- anon.

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Alex Thurgood Alex Thurgood
Reply | Threaded
Open this post in threaded view
|

Re: video issue -- thinking out loud and could do with help please

Le 09/11/2017 à 10:02, Mike Scott a écrit :

Scott,

You might have better luck posting your question to the developer
mailing list, or directly on the dev IRC channel.

Alex


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Cley Faye Cley Faye
Reply | Threaded
Open this post in threaded view
|

Re: video issue -- thinking out loud and could do with help please

In reply to this post by Mike Scott-2
2017-11-09 10:02 GMT+01:00 Mike Scott <[hidden email]>:

> OK. I'm well out of my depth, but this problem has been around too long
> unfixed and it needs fixing. If I 'think out loud' here, maybe others could
> chip in? Sorry this is a bit lengthy.
>
> The problem: a video on an Impress slide starts and finishes with an
> inappropriate frame displayed. I've made a series of test videos, the
> frames simply containing the frame number from 0....N-1, and in a selection
> of formats (.mp4, .flv and ".avi") using avconv. I then embed that video
> into a slide using Insert|Audio or Video.
>
>

> A placeholder frame from the video is displayed during editing. This is a
> frame from within the video, but it isn't always the same one.
>


> The big deal-breaker is that this placeholder frame is shown during the
> slide show when the slide appears and before the video plays (a long time
> if there's a slow transition), and also when the video has finished. This
> means at the very least an annoying flicker at the start, and a usually
> totally inappropriate ending.
>


> Sorry that's so long, but I think the symptoms need documenting somewhere.
> Any thoughts at all would be most welcome - thanks.


​Some thoughts about this.
Inserting video is finicky. At least your problem isn't that it randomly
stop working sometimes or that some formats are unsupported. These two
issues alone pushes a lot of people to simply have their video file at hand
during presentation, and switch to that instead of embeding it, which in
turns means that less people embed video, so issues are harder to diagnose,
etc.

About the thumbnail: on most of my (not so thorough) tests, LibreOffice
always showed the first frame as the preview, so it was not an issue. My
version is 5.3.1.2, but I'm afraid the preview picture is more a matter of
OS and media package than LibreOffice itself.
An "immediate" solution would be to surround your slides with video, with
slides with static images and no transition.

Here's what I did:
- Create a presentation with three slides: dummy1, video, dummy2
- Have long transitions on them. This shows that going from the video slide
to the dummy2 slide, the video preview image (in my case the first image of
the video) shows during the transition, which is not good
- Add a slide after the video with no transition. Place a capture of the
video's last frame at the exact same place the video should be (using
placement properties it's quite easy, even if tedious)

This way, when I move to the next slide after the video, the transition
looks smooth. I suppose the same thing could be done before the slide to
show the correct first frame in every case. One last issue I found there is
that the video flicker slightly when it starts playing; again, this is
probably OS/Library dependant.

This is obviously not an ideal solution. Ideally, you could specify on
which frame/timestamp the video should initially be, or simply just always
display the first frame one entering, and the current frame on exiting the
slide. Maybe there's even a suggestion about this, but obviously it' not
high priority since it's been around for so long.

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Mike Scott-2 Mike Scott-2
Reply | Threaded
Open this post in threaded view
|

Re: video issue -- thinking out loud and could do with help please

In reply to this post by Alex Thurgood
On 09/11/17 10:12, Alexander Thurgood wrote:

> Le 09/11/2017 à 10:02, Mike Scott a écrit :
>
> Scott,
>
> You might have better luck posting your question to the developer
> mailing list, or directly on the dev IRC channel.
>
> Alex
>
>

Maybe I'll go there, as I seem to have found a workable answer. Not that
I understand fully why it works; nor is it a complete and proper solution.

It's all down to "magic numbers". Rule two of code writing - never,
ever, embed literal numbers in the depths of your code.

Well, there's a file mediawindow.cxx that has a grabFrame method that (I
assume) is what's called by whatever displays the static placeholder.

This has embedded within it a so-called default frame - which is at 3.0
seconds or half the media length. With no way that the caller can
request anything else.

So, on the basis that showing the first frame is better than a mid-media
frame (make the video fade from/to black for example), I simply set the
magic constant to 0 and recompiled.

Bingo.

The slide fades in to show the first frame, and the video starts from
there. Exactly what the doctor ordered. What I don't understand is that
when the video finishes, the last frame is now displayed. That too is
exactly what's needed -- but I haven't a clue why: I expected it to jump
back to the first.


I think the code is badly structured - the grabFrame method has no way
of specifying an offset. It should have, and whatever runs the slide
displaying should pick the first or last as appropriate.



Is it really so simple? And do the dev's lurk here at all, or do I need
to stick this on the dev list??




--
Mike Scott (unet2 <at> [deletethis] scottsonline.org.uk)
Harlow Essex England
"The only way is Brexit" -- anon.

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Alex Thurgood Alex Thurgood
Reply | Threaded
Open this post in threaded view
|

Re: video issue -- thinking out loud and could do with help please

Le 09/11/2017 à 15:36, Mike Scott a écrit :

>
>
> I think the code is badly structured - the grabFrame method has no way
> of specifying an offset. It should have, and whatever runs the slide
> displaying should pick the first or last as appropriate.
>
>
>
> Is it really so simple? And do the dev's lurk here at all, or do I need
> to stick this on the dev list??
>


Contributions gratefully received :-) It may be that no one ever really
looked at the problem or found the time to go back to that part of the code.

Best bet would be to introduce yourself on the dev list. They will ask
you to contribute the code via gerrit, the code submission tool that the
project uses and send in a mail about your contributions being released
under the relevant licenses the project uses. It will undergo a review
and if deemed acceptable and advantageous, which it seems to be from
what you relate, get accepted into the master source branch. If you're
up for introducing extra functionality to let the user choose where they
want to pick the frame from then even better :-)


Alex


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Mike Scott-2 Mike Scott-2
Reply | Threaded
Open this post in threaded view
|

(resent) Re: [libreoffice-users] Re: video issue -- thinking out loud and could do with help please

On 09/11/17 17:34, Alexander Thurgood wrote:

> Le 09/11/2017 à 15:36, Mike Scott a écrit :
>
>>
>>
>> I think the code is badly structured - the grabFrame method has no way
>> of specifying an offset. It should have, and whatever runs the slide
>> displaying should pick the first or last as appropriate.
>>
>>
>>
>> Is it really so simple? And do the dev's lurk here at all, or do I need
>> to stick this on the dev list??
>>
>
>
> Contributions gratefully received :-) It may be that no one ever really
> looked at the problem or found the time to go back to that part of the code.
>
> Best bet would be to introduce yourself on the dev list. They will ask

OK; I've subscribed; I'd better just lurk for a bit.

> you to contribute the code via gerrit, the code submission tool that the

gerrit?! something else to learn then :-{

> project uses and send in a mail about your contributions being released
> under the relevant licenses the project uses. It will undergo a review
> and if deemed acceptable and advantageous, which it seems to be from

I have a sudden picture in my mind of a single-character change to the
source generating vast swathes of review, comment, regression testing,
etc etc. Hmmm.

> what you relate, get accepted into the master source branch. If you're
> up for introducing extra functionality to let the user choose where they
> want to pick the frame from then even better :-)

I'd love to - but I'm so far out of date with code standards that I
doubt it'd be practicable. The immediate problem is
fixed^Wworked-around, and maybe the pointer to the trouble area will
inspire someone more capable to do a proper job.


Oh, and thanks for the comments. A little encouragement goes a long way!

Mike.


--
Mike Scott
Harlow, Essex, England

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted