A
A
Absolute1382020-06-11 16:08:43
HTML
Absolute138, 2020-06-11 16:08:43

Do I need decoding for modern video formats before inserting on the site?

I ask for advice.
I got a small site ads with real estate. And they asked to implement a feature so that people can upload videos of their objects when publishing an ad. Before that, I did not work with user-generated video content on sites. was focused on online stores, business sites, etc. Actually, I wrote down the function of sending a video file to the server and writing the value to the database. And now in the template I can display the path to the video file $video['path'].
Actually, the question is whether such a simple implementation will be enough for the vast majority of videos uploaded by users:

<?php
          $ext = explode('.', $video['path']);
          $ext = mb_strtolower(end($ext)); // получаем расширение видеофайла
          if($ext == 'mov'){ // если формат mov
             $ext = 'mp4';
          }
?>
   <video controls style="max-width:100%">
          <source src="/upload/<?php echo $video['path']; ?>" type="video/<?php echo $ext; ?>">
          Your browser does not support the video tag.
    </video>

In other words, those who are not with mp4, ogg, webm, mov - nafig helmet. Various obsolete flv, avi, 3gp and so on - are there many of them?
Does it make sense now to bother with decoding on the PHP-FFmpeg bundle? Will any .mov work here? Are there other modern popular formats that won't work like that?

PS: I tried to find at least some statistics on the most used and popular video formats in Google today, but I didn’t find anything sane.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2020-06-11
@iamd503

https://html5book.ru/html5-video/#part3

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question