Recherche avancée

Médias (91)

Autres articles (50)

  • Pas question de marché, de cloud etc...

    10 avril 2011

    Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
    sur le web 2.0 et dans les entreprises qui en vivent.
    Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
    Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
    le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
    Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (7545)

  • Launch command from controller avoid loading page

    28 juin 2019, par JoakDA

    When I launch a command from a Symfony controller, the command is executed but the GET request does not finish.

    My command launchs a node.js script that receive rtsp frames transcoded from ffmpeg and broadcast it to a websocket.

    This is a Debian 9 server, running Symfony 4, PHP 7.3.5 and Apache2.

    This is my controller show action that calls the command :

       /**
        * Render view to show device details.
        * @param Request $request
        * @param $deviceid
        * @return Response
        * @Route("devices/show/{deviceid}", name="device_show", methods={"GET"})
        * @IsGranted("ROLE_OPERATOR")
        */
       public function showAction(Request $request, $deviceid)
       {
       try{
           //Find device to show from system
           $deviceToShow = $this->repository->find($deviceid);

           if ($deviceToShow) {
               $this->logger->debug('Show device: . Device has been found. Delete it... Data: ' . $deviceToShow->__toString());

               //Launch video streaming commands
               $command = new VideoServerCommand($this->entityManager, $this->logger, $this->getParameter('kernel.project_dir'));
               $input = new ArrayInput(array(
                   'secret' => str_replace(' ', '', $deviceToShow->getName()),
                   'http_port' => 8002,
                   'ws_port' => 8005
               ));
               $output = new BufferedOutput();
               $resultCode  = $command->run($input, $output);

               $content = $output->fetch();

               if ($resultCode === 0){
                   $this->logger->info('Call Video Server Command: Ok. Video Server started successfully. Console output: ' . $content);
               }else{
                   $this->logger->error('Call Video Server Command: Ko. Could not start video server. Console output: ' . $content);
               }

           }else{
               $message = $this->translator->trans('Device with identifier %deviceid% was not found.',
                   ['%deviceid%' => $deviceid]);

               $this->addFlash('error', $message);

               $this->logger->error('Show device: Ko. Device with identifier ' . $deviceid . ' was not found.');
           }
       }catch (Exception $exception) {
           $message = $this->translator->trans('Error while executing action. Error detail: %detail%.',
               ['%detail%' => $exception->getMessage()]);

           $this->addFlash(
               'error', $message
           );

           $this->logger->critical('Show device: Ko. Exception catched. Error detail: ' . $exception->getMessage());
       }

       $host = explode(':', $request->getUri());

       return $this->render('device/show.html.twig', array(
           'baseurl' => $host[1],
           'secret' => str_replace(' ', '', $deviceToShow->getName()),
           'device' => $deviceToShow,
       ));
       }

    And this is my command code that runs the node.js script

    protected function execute(InputInterface $input, OutputInterface $output)
       {
           try {
               $this->logger->info('Start web socket: Setup websocket server...');
               $this->io = new SymfonyStyle($input, $output);
               $now = new \DateTime();
               $this->io->title('Start websocket server ' . $now->format('d-m-Y G:i:s') . '...');

               //Get input parameters
               $secret = $input->getArgument('secret');
               $tcpPort = $input->getArgument('http_port');
               $wsPort = $input->getArgument('ws_port');

               $output->writeln([
                   'Video Server',// A line
                   '============',// Another line
                   'Starting Video Reception Socket...',// Empty line
               ]);

               //Call node websocket-relay.js
               $command = 'node ' . $this->path . '/assets/js/websocket-relay.js ' . $secret . ' ' . $tcpPort . ' ' . $wsPort;
               //Only want to execute for 60 seconds
               $nodeVideoRelay = new Process(exec($command));
               $nodeVideoRelay->setTimeout(60);
               $nodeVideoRelay->setIdleTimeout(60);

               try {
                   $nodeVideoRelay->run();

                   $this->logger->info('Start video streaming: OK. Video streaming successfully started...');
                   $this->io->success('Start video streaming: OK. Video streaming successfully started...');
                   $this->io->writeln($nodeVideoRelay->getOutput());
               } catch (ProcessTimedOutException $timedOutException) {
                   $nodeVideoRelay->stop(3, SIGINT);
                   $this->io->success('Start video streaming: Ok. Streaming finished.');
               }
               //}
           } catch (Exception $exception) {
               $this->logger->critical('Start video streaming: Ko. Exception catched. Error detail: ' . $exception->getMessage());
               $this->io->error('Start video streaming: Ko. Exception catched. Error detail: ' . $exception->getMessage());
           }
       }

    And the "websocket-relay.js" is an script got from https://github.com/phoboslab/jsmpeg/blob/master/websocket-relay.js

    The result is that the page is not loading. I have another command that process the RTSP stream using ffmpeg and send the date to a websocket.

    On the page that returns my controller action, it appears a canvas where the video will be rendered.

    I want to render the page as soon as possible and that the node.js script runs on background without blocking the main process.

    Thank you for helping me.

  • FFMPEG. Video to image sequences, duration changed

    17 avril 2020, par Robert Johnson

    The duration of the video changes from 7 minutes and 59 seconds to 7 minutes and 55 seconds.
I'm not sure what the issue is. But it's def eating up frames but i'm not sure what the issue is.

    



    My command :

    



    "ffmpeg -loglevel verbose -i '/secrets/secret.mkv' -vf fps=23.976 -qscale:v 3 -vf scale=720:540 '/secrets/lol5/SecretJpgs%05d.png' "

    



    And well that's about it.
I would really appreciate it, if someone was willing to help me out with this.
Would mean a lot !!!
Edit : I Understand there are mistakes with my command, still doesn't explain why the duration is changed. Check the duration : and then check the time of the output, 7 mins and 55 secs. I clearly lost something somewhere. To make sure this wasn't an error i went back and converted the image sequence to video and it was 7 mins and 55 secs, unlike the source. The command was perfectly fine and i even set the fps twice using different commands , but it was something else. Please i would really appreciate it , if any one of you could help me out.

    



    ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
  configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
[h264 @ 0x56089f88a500] Reinit context to 1440x1088, pix_fmt: yuv420p
Input #0, matroska,webm, from '/secret/secrets/My secrets/Secret.mkv':
  Metadata:
    ENCODER         : Lavf57.71.100
  Duration: 00:07:59.08, start: 3.401000, bitrate: 5257 kb/s
    Chapter #0:0: start 0.000000, end 113.594000
    Metadata:
      title           : 00:02:23.643
    Chapter #0:1: start 113.594000, end 479.000000
    Metadata:
      title           : 00:09:54.594
    Stream #0:0(eng): Video: h264 (High), 1 reference frame, yuv420p(progressive, left), 1440x1080 (1440x1088) [SAR 1:1 DAR 4:3], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS             : 5789491
      BPS-eng         : 5789491
      DURATION-eng    : 00:23:37.375000000
      NUMBER_OF_FRAMES: 33983
      NUMBER_OF_FRAMES-eng: 33983
      NUMBER_OF_BYTES : 1025735076
      NUMBER_OF_BYTES-eng: 1025735076
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-02-16 22:40:33
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-02-16 22:40:33
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      DURATION        : 00:07:59.083000000
    Stream #0:1(eng): Subtitle: ass (default) (forced)
    Metadata:
      title           : English full
      BPS             : 35
      BPS-eng         : 35
      DURATION-eng    : 00:23:34.413000000
      NUMBER_OF_FRAMES: 248
      NUMBER_OF_FRAMES-eng: 248
      NUMBER_OF_BYTES : 6265
      NUMBER_OF_BYTES-eng: 6265
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-02-16 22:40:33
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-02-16 22:40:33
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      ENCODER         : Lavc57.89.100 ssa
      DURATION        : 00:07:42.860000000
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> png (native))
Press [q] to stop, [?] for help
[h264 @ 0x56089f88cd00] Reinit context to 1440x1088, pix_fmt: yuv420p
[Parsed_scale_0 @ 0x56089f843ae0] w:720 h:540 flags:'bicubic' interl:0
[graph 0 input from stream 0:0 @ 0x56089f843b80] w:1440 h:1080 pixfmt:yuv420p tb:1/1000 fr:24000/1001 sar:1/1 sws_param:flags=2
[Parsed_scale_0 @ 0x56089f843ae0] w:1440 h:1080 fmt:yuv420p sar:1/1 -> w:720 h:540 fmt:rgb24 sar:1/1 flags:0x4
Output #0, image2, to '/secret/lol5/SecretJpgs%05d.png':
  Metadata:
    encoder         : Lavf57.83.100
    Chapter #0:0: start 0.000000, end 110.193000
    Metadata:
      title           : 00:02:23.643
    Chapter #0:1: start 110.193000, end 475.599000
    Metadata:
      title           : 00:09:54.594
    Stream #0:0(eng): Video: png, 1 reference frame, rgb24(left), 720x540 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
    Metadata:
      BPS             : 5789491
      BPS-eng         : 5789491
      DURATION-eng    : 00:23:37.375000000
      NUMBER_OF_FRAMES: 33983
      NUMBER_OF_FRAMES-eng: 33983
      NUMBER_OF_BYTES : 1025735076
      NUMBER_OF_BYTES-eng: 1025735076
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-02-16 22:40:33
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-02-16 22:40:33
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      DURATION        : 00:07:59.083000000
      encoder         : Lavc57.107.100 png
No more output streams to write to, finishing.
frame=11405 fps= 20 q=-0.0 Lsize=N/A time=00:07:55.68 bitrate=N/A speed=0.823x    
video:4711858kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (/secret/secrets/My secrets/Secret.mkv):
  Input stream #0:0 (video): 11405 packets read (314757039 bytes); 11405 frames decoded; 
  Input stream #0:1 (subtitle): 0 packets read (0 bytes); 
  Total: 11405 packets (314757039 bytes) demuxed
Output file #0 (/secret/lol5/SecretJpgs%05d.png):
  Output stream #0:0 (video): 11405 frames encoded; 11405 packets muxed (4824942145 bytes); 
  Total: 11405 packets (4824942145 bytes) muxed


    


  • Reddit api only giving video and not its audio

    25 mars 2023, par Rudra Sharma

    I am using Reddit API to play videos on my app but the audio is not playing with the video.

    


    This is my code. I am using chewie package and I have no idea if the problem is in the player or Reddit Api. Also I am new to flutter. The code plays reddit videos on my app on chewie video player.

    


      Future<void> _loadVideos() async {&#xA;    try {&#xA;      final videoUrls =&#xA;          await RedditApi.getVideoUrlsFromSubreddit(&#x27;IndianDankMemes&#x27;);&#xA;&#xA;      setState(() {&#xA;        _videoUrls.addAll(videoUrls);&#xA;      });&#xA;    } catch (e) {&#xA;      print(e);&#xA;    }&#xA;  }&#xA;&#xA;  Widget _buildVideosList() {&#xA;    return ListView.builder(&#xA;      itemCount: _videoUrls.length,&#xA;      itemBuilder: (context, index) {&#xA;        return Padding(&#xA;          padding: const EdgeInsets.all(8.0),&#xA;          child: Chewie(&#xA;            controller: ChewieController(&#xA;              videoPlayerController: VideoPlayerController.network(&#xA;                _videoUrls[index],&#xA;              ),&#xA;              aspectRatio: 9 / 16,&#xA;              autoPlay: true,&#xA;              looping: true,&#xA;              autoInitialize: true,&#xA;            ),&#xA;          ),&#xA;        );&#xA;      },&#xA;    );&#xA;  }&#xA;}&#xA;&#xA;class RedditApi {&#xA;  static const String BASE_URL = &#x27;https://www.reddit.com&#x27;;&#xA;  static const String CLIENT_ID = &#x27;my client id&#x27;;&#xA;  static const String CLIENT_SECRET = &#x27;my client secret&#x27;;&#xA;&#xA;  static Future> getVideoUrlsFromSubreddit(&#xA;      String subredditName) async {&#xA;    final response = await http.get(&#xA;        Uri.parse(&#x27;$BASE_URL/r/$subredditName/top.json?limit=10&#x27;),&#xA;        headers: {&#x27;Authorization&#x27;: &#x27;Client-ID $CLIENT_ID&#x27;});&#xA;&#xA;    if (response.statusCode == 200) {&#xA;      final jsonData = jsonDecode(response.body);&#xA;      final postsData = jsonData[&#x27;data&#x27;][&#x27;children&#x27;];&#xA;&#xA;      final videoUrls = <string>[];&#xA;&#xA;      for (var postData in postsData) {&#xA;        if (postData[&#x27;data&#x27;][&#x27;is_video&#x27;]) {&#xA;          videoUrls.add(postData[&#x27;data&#x27;][&#x27;media&#x27;][&#x27;reddit_video&#x27;]&#xA;              [&#x27;fallback_url&#x27;]);&#xA;        }&#xA;      }&#xA;&#xA;      return videoUrls;&#xA;    } else {&#xA;      throw Exception("Failed to load videos from subreddit");&#xA;    }&#xA;  }&#xA;}```&#xA;&#xA;If you are suggesting for ffmpeg please give me code as well as I said I am new to flutter. &#xA;&#xA;I have checked my client id and client secret is correct as well. Also if there is any other package I can add to make the task easy.&#xA;&#xA;</string></void>

    &#xA;