topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 15, 2024, 2:05 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Can we embed short MP4 animation inline in post?  (Read 9046 times)

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Can we embed short MP4 animation inline in post?
« on: October 26, 2020, 09:08 AM »
This post is to test if we can embed a short MP4 animation inline in DC forum posts. Here goes:

edit:

We can attach the .mp4 to the bottom of the post, but it then downloads rather than shows in the browser.

Attempts at embedding that did not work with an .mp4 file attachment
[attachment=1]
[attachthumb=1]
[attachimg=1]

Also not working: embed animation from imgur server
[img]https://i.imgur.com/0SE2wDQ.mp4[/img]

 test
« Last Edit: October 27, 2020, 09:22 AM by Nod5 »

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,190
    • View Profile
    • Donate to Member
Re: Can we embed short MP4 animation inline in post?
« Reply #1 on: October 26, 2020, 09:16 AM »
Can you convert it into a gif?  I'm pretty sure that those work.

KynloStephen66515

  • Animated Giffer in Chief
  • Honorary Member
  • Joined in 2010
  • **
  • Posts: 3,761
    • View Profile
    • Donate to Member
Re: Can we embed short MP4 animation inline in post?
« Reply #2 on: October 26, 2020, 09:23 AM »
If you don't need audio - convert to GIF

Use these guys for that: https://cloudconvert.com/mp4-to-gif (I use them all the time)

If it has audio then upload it to YouTube then embed that here - you can set the video to unlisted on the upload options then it will only be viewable here and by anybody with a link :)

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Can we embed short MP4 animation inline in post?
« Reply #3 on: October 26, 2020, 09:27 AM »
Testing GIFs.

Source imgur mp4 is attached to my first post above (44 kB)

Imgur mp4 passed through https://imgur.com/vidgif  (107 kB)
imgur.gifCan we embed short MP4 animation inline in post?

Imgur mp4 passed through https://cloudconvert.com/mp4-to-gif (166 kB)
cloudconvert.gifCan we embed short MP4 animation inline in post?

Edit: yes that worked.

If you don't need audio - convert to GIF

I don't need audio, but mp4 file animations tend to have better quality and smaller filesize.

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,778
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Can we embed short MP4 animation inline in post?
« Reply #4 on: October 26, 2020, 09:49 AM »
I don't need audio, but mp4 file animations tend to have better quality and smaller filesize.

It's a mystery I'll never understand, but for some reason the internet seems to always converge on using the least efficient means possible of transmitting information.

Images of just words, when plain (or rich) text would be better. Resulting in lower quality and much larger filesize.
GIFs instead of proper video files. Resulting in lower quality and much larger filesize.
What's one of the best places to find and hear nearly any song in the world for free? It's at YouTube in video format. Resulting in a much larger filesize than necessary.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Can we embed short MP4 animation inline in post?
« Reply #5 on: October 26, 2020, 12:03 PM »
It's a mystery I'll never understand, but for some reason the internet seems to always converge on using the least efficient means possible of transmitting information.
I don't get it - please post a 4K video livestream explainer of what you mean?!  :P

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,939
    • View Profile
    • Donate to Member
Re: Can we embed short MP4 animation inline in post?
« Reply #6 on: October 26, 2020, 12:19 PM »
It's a mystery I'll never understand, but for some reason the internet seems to always converge on using the least efficient means possible of transmitting information.

Is that not the result of people, who never have been subjected to limitations in their media, not having a clue about efficiency? Or just won't do that "word learning"-thing most people have been subjected to...

Those video gif's...should be considered barely better than animated hieroglyphics. Just as useful too.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,190
    • View Profile
    • Donate to Member
Re: Can we embed short MP4 animation inline in post?
« Reply #7 on: October 26, 2020, 12:34 PM »
I don't need audio, but mp4 file animations tend to have better quality and smaller filesize.


Just trying to give you a workaround.  There might be a way to embed a gif hosted elsewhere, but the embed that we're using here for images does not (as it is an image embed)

As another workaround, you could upload it to youtube and use the youtube embed here.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Can we embed short MP4 animation inline in post?
« Reply #8 on: October 27, 2020, 09:25 AM »
Found this at SMF on embedding MP4. But don't know what changes to DC would be needed to get something like that working.
https://www.simplema...sg3843100#msg3843100

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,190
    • View Profile
    • Donate to Member
Re: Can we embed short MP4 animation inline in post?
« Reply #9 on: October 27, 2020, 10:32 AM »
Found this at SMF on embedding MP4. But don't know what changes to DC would be needed to get something like that working.
https://www.simplema...sg3843100#msg3843100

I think he explicitly has html embeds turned off, and for good reason.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Can we embed short MP4 animation inline in post?
« Reply #10 on: October 27, 2020, 11:49 AM »
I think he explicitly has html embeds turned off, and for good reason.
I Agree that makes sense, but I thought the link also said BBCode for local video could be specifically enabled, without allowing any and all html embeds. But I maybe misinterpreted that.

Anyway embedded mp4 animations isn't very important, I mostly wanted to check if worked already. Nice to have feature if easy to enable and no strong reasons against.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,190
    • View Profile
    • Donate to Member
Re: Can we embed short MP4 animation inline in post?
« Reply #11 on: October 27, 2020, 12:30 PM »
.. but I thought the link also said BBCode for local video could be specifically enabled, without allowing any and all html embeds.

What they were saying is that you could write a mod to wrap that.

Also, if don't want to use the  tags, then you can add a new BBCode to use it for the local video files, something like this [video]/path/to/the/video.mp4[/video] and then it will show in the post like the code I added before.
That looks super easy to code, I may give that a try Saturday, schedule super booked til then. That is if no one beats me to it.

Emphasis mine.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Can we embed short MP4 animation inline in post?
« Reply #12 on: October 27, 2020, 02:24 PM »
Thanks. Looks like someone did code it, here https://custom.simpl...s/index.php?mod=4131 . But that allows many different audio and video files. Might be possible to lock down? I guess a big downside with any local video embed is if people start uploading big files that autoplay and slow down page loads. On the other hand small, short and silent MP4 screencap clips can be a useful way to quickly show a feature or describe a bug.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,190
    • View Profile
    • Donate to Member
Re: Can we embed short MP4 animation inline in post?
« Reply #13 on: October 27, 2020, 09:10 PM »
He's already limited the size of attachments, so I don't think that size is going to be an issue.  And if you can't set it to autoplay- just that it allows attachments to be embedded and played, doesn't seem like it's too big of a deal if it can be locked down to limit types.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Can we embed short MP4 animation inline in post?
« Reply #14 on: November 20, 2020, 08:37 AM »
Follow up post to the above GIF tests. This FFmpeg oneliner has nice results
ffmpeg -y -i file.mp4 -filter_complex "[0:v]fps=10,split[v0][v1];[v0]palettegen[plt];[v1][plt]paletteuse" file.gif
ffmpeg.gifCan we embed short MP4 animation inline in post? (212 kB)
To my eyes it looks less grainy than the earlier GIFs from imgur and cloudconvert, at a pretty small filesize cost.

Found here https://stackoverflow.com/a/60041579 , and the doc page is https://ffmpeg.org/f...rs.html#palettegen-1

We can also shave off a few extra kB by going down to fps=5 with similar output quality.
« Last Edit: November 20, 2020, 08:45 AM by Nod5 »