Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (83)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

Sur d’autres sites (5033)

  • .m3u8 (HEVC, HLS) video won't play while other will

    6 août 2023, par user1207524

    I converted my video into HEVC codec with support for HLS using ffmpeg with the following command :

    


    ffmpeg -i originalName.mp4 -c:v libx265 -tag:v hvc1 -g 60 -hls_time 2 -hls_playlist_type vod -hls_segment_type fmp4 originalName-8000-fmp4-1080p.m3u8"


    


    Then I uploaded it onto my server and tried playing it. Navigating to http://memoryprinting.sk/am/videos/test2/1_IMG_1122-8000-fmp4-1080p.m3u8 where it is stored in Safari shows just broken player icon (Safari supports playing these), but opening it from the same path using VLC player works normally.

    


    I thought the issue might be on my server, but I tried uploading a .m3u8 video and segments that I downloaded from a different URL and this works fine even when opening it in Safari. (http://memoryprinting.sk/am/videos/test/v360p_fmp4.m3u8)

    


    I can't figure out where could be the problem. Checking my m3u8 file in VSCode, it has the same structure as the other one which works.

    


    Edit : Tried encoding to h264 instead of hevc in ffmpeg and this works. But HEVC itself can't be a problem since the video that is working is also 'hvc1' (same as my video) based on ffprobe.

    


  • Nextjs/React/JS How compress video file uploaded by user through input (client side preferred)

    1er novembre 2022, par vana22

    I have made a basic app where the user can upload a video file through an input.
As you can see in the code i also retrieve the duration and the size of the initial video.

    


    Now the question is, how i can compress the video file in the function "compressvid" so that the size of the video becomes massively smaller (at later stage i want to upload these videos to firebase firestore).
I'e read something about ffmpeg but wasn't able to figure out how to use it here.
I prefer it to be client side as the videos a client can upload are at max 30sec long.
If client side is not possible how would it work server side ?

    


    import Head from &#x27;next/head&#x27;&#xA;import styles from &#x27;../styles/Home.module.css&#x27;&#xA;import { useState, useEffect } from &#x27;react&#x27;&#xA;&#xA;export default function Home() {&#xA;&#xA;  const [videofile, setVideo] = useState("")&#xA;  const [viddur, setviddur] = useState("")&#xA;&#xA;&#xA;  useEffect(() => {&#xA;    // only run this if videofile exists&#xA;    if (videofile != "") {&#xA;      console.log("compress video now ")&#xA;      console.log(videofile.type)&#xA;&#xA;&#xA;      // get duration of video by creating a theoretical video component&#xA;      var video = document.createElement(&#x27;video&#x27;);&#xA;      video.preload = &#x27;metadata&#x27;;&#xA;      video.onloadedmetadata = function() {&#xA;        window.URL.revokeObjectURL(video.src);&#xA;        // here now can check if video is too long&#xA;        setviddur(video.duration)&#xA;      }&#xA;      video.src = URL.createObjectURL(videofile)&#xA;      &#xA;    }&#xA;  }, [videofile]);&#xA;&#xA;  const clickedvideo = () => {&#xA;    console.log("clicked video")&#xA;  }&#xA;&#xA;  const compressvid = () => {&#xA;    // here need to compress the video so that the size is smaller: preferred client-side; if that&#x27;s not possible howis it posssible server side or with a cheap api&#xA;  }&#xA;&#xA;  return (&#xA;    <div classname="{styles.container}">&#xA;      &#xA;        &#xA;        &#xA;        &#xA;      &#xA;&#xA;      <main classname="{styles.main}">&#xA;        <h1 classname="{styles.title}">&#xA;          Video compressor&#xA;        </h1>&#xA;        <p>Size of video before: {videofile.size}</p>&#xA;        <p>Duration of video: {viddur}</p>&#xA;        <p>Size of video after: { }</p>&#xA;        <input classname="{styles.videoinput}" type="file" accept="video/mp4,video/x-m4v,video/*" />> setVideo(e.target.files[0])}>&#xA;        <div>&#xA;          {(videofile != "") ? <video autoplay="autoplay" loop="loop" src="{URL.createObjectURL(videofile)}" width="300px" height="300px"></video> : null}&#xA;        </div>&#xA;      </main>&#xA;    </div>&#xA;  )&#xA;}&#xA;

    &#xA;

    I tried to compress a video uploaded by a user but didn't figure out how to solve it.

    &#xA;

  • Stopping rq worker doesn't stop underlying ffmpeg process

    23 mars 2020, par sqr

    I am fairly new to python and rq, and have come to a point I can’t solve by myself.

    I am using ffmpeg-python to encode livestreams, this is distributed in rq workers and displayed on a web app using flask, but since the livestreams can go on forever, I need some way to stop this process while it is still in execution. Opening the terminal where the rq worker is executing the task and pressing ’q’ (ffmpeg shortcut to quit) works, and marks the job as OK, but I need to be able to do this from my web app.

    I have tried getting the worker ID and sending it a SIGKILL, this stops the worker but the task continues running, which is something I don’t understand at all. It’s as if the actual ffmpeg process was being executed somewhere else and stopping the worker didn’t stop ffmpeg. Note that I am not using ffmpeg.run_async, I am using ffmpeg.run which as far as my limited knowledge goes, should not be executed asynchronously. While the streaming is being encoded the worker is marked as busy and has the Job ID properly assigned, so I really don’t understand why, when the worker is killed, the underlying process is still in execution.

    If instead of sending a SIGKILL I send a SIGTERM, the worker says it’s waiting for a warm exit and is never closed, as the ffmpeg process is still doing it’s thing.

    One of my ideas was trying to send a ’q’ keystroke to the worker (which I have no idea how to do even though i’ve been doing some research) or trying to switch from rq to celery, that supposedly supports the cancellation of tasks that are being executed.

    This is my routes file

    @app.route('/streamings', methods=['GET', 'POST'])
    @login_required
    def streamings():
    ...
       if form2.submit_stop.data and form2.validate():
           conn1 = Redis.from_url('redis://')
           queue = rq.Queue('tasks-q', connection=Redis.from_url('redis://'))
           workers = rq.Worker.all(queue=queue)

           for worker in workers:
               peine = worker.get_current_job_id()
               if peine == form2.fld1.data:
                   os.kill(worker.pid, signal.SIGKILL)

    and this is my tasks file

    def restream(origin, server, stream_key):
       stream_server = generate_url(server, stream_key)
       try:
           stream_map = None
           stream1 = ffmpeg.input(get_manifest(origin), re=None)
           stream2 = ffmpeg.input('mosca_66.png')
           stream_ol = ffmpeg.overlay(stream1, stream2, x='main_w-overlay_w-50', y='50')
           a1 = stream1.audio
           stream = ffmpeg.output(stream_ol, a1, stream_server, format='flv', vcodec='libx264', acodec='aac', preset='medium', g='120', crf='23', maxrate='4M', bufsize='5M', channel_layout='stereo')
           print(stream.get_args())
           ffmpeg.run(stream)
       except:
           set_complete()

    Any insight on possible solutions would be greatly appreciated.

    Thanks