Recherche avancée

Médias (1)

Mot : - Tags -/remix

Autres articles (51)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • 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 (8852)

  • lavc/qsvdec : Use coded_w/h for frame resolution when use system memory

    20 mai 2024, par Fei Wang
    lavc/qsvdec : Use coded_w/h for frame resolution when use system memory
    

    Fix output mismatch when decode clip with crop(conf_win_*offset in
    syntax) info by using system memory :

    $ ffmpeg -c:v hevc_qsv -i conf_win_offet.bit -y out.yuv

    Signed-off-by : Fei Wang <fei.w.wang@intel.com>

    • [DH] libavcodec/qsvdec.c
  • avcodec/vvcdec : inter, wait reference with a different resolution

    19 mai 2024, par Nuo Mi
    avcodec/vvcdec : inter, wait reference with a different resolution
    

    For RPR, the current frame may reference a frame with a different resolution.
    Therefore, we need to consider frame scaling when we wait for reference pixels.

    • [DH] libavcodec/vvc/dec.c
    • [DH] libavcodec/vvc/dec.h
    • [DH] libavcodec/vvc/refs.c
    • [DH] libavcodec/vvc/thread.c
  • Setting up multiple resolution value in Fast API for transcoding uploaded video files

    23 janvier 2024, par Sanji Vinsmoke

    I created an API for transcoding video files like adaptive bit rate of youtube. I used Fast API. Currently, I am trying to set resolution values for each file. But whenever I am adding multiple resolutions, I am recieving "422 unprocessible entity" error in the Swagger.

    &#xA;

    Here is my code :

    &#xA;

    async def transcode_video(input_path, output_folder, res, unique_id, total_files, pbar):&#xA; # Use asyncio for command execution with progress bar&#xA; output_path = os.path.join(output_folder, f"{res}p.m3u8")&#xA;&#xA; # Calculate the target size&#xA; target_size = calculate_target_size(input_path)&#xA;&#xA; cmd_duration = f"ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 {input_path}"&#xA; total_duration = float(subprocess.check_output(cmd_duration, shell=True, text=True).strip())&#xA;&#xA; cmd = (&#xA;     f"ffmpeg -i {input_path} -vf scale=-2:{res} -c:a aac -b:a 128k "&#xA;     f"-g 50 -hls_time 1 -hls_list_size 0 "&#xA;     f"-crf 23 -b:v 100k -fs {target_size} "&#xA;     f"-hls_segment_filename \"{output_path.replace(&#x27;.m3u8&#x27;, &#x27;_%03d.ts&#x27;)}\" "&#xA;     f"{output_path}"&#xA; )&#xA;&#xA; process = await asyncio.create_subprocess_shell(&#xA;     cmd,&#xA;     stdout=asyncio.subprocess.PIPE,&#xA;     stderr=asyncio.subprocess.PIPE&#xA; )&#xA;&#xA; while True:&#xA;     line = await process.stderr.readline()&#xA;     if not line:&#xA;         break&#xA;     line = line.decode().strip()&#xA;     if "time=" in line:&#xA;         # Extracting the time progress from FFmpeg output&#xA;         time_str = line.split("time=")[1].split()[0]&#xA;         current_time = sum(x * float(t) for x, t in zip([3600, 60, 1], time_str.split(":")))&#xA;         progress = (current_time / total_duration) * 100&#xA;         pbar.update(progress - pbar.n)&#xA;&#xA; # Wait for the transcoding process to complete&#xA; await process.wait()&#xA;&#xA; if process.returncode != 0:&#xA;     raise HTTPException(status_code=500, detail="Video transcoding failed.")&#xA; pbar.close()&#xA;&#xA; # Increment the total number of transcoded files&#xA; total_files[0] &#x2B;= 1&#xA;&#xA;@app.post("/transcode/")&#xA;async def transcode_video_endpoint(files: List[UploadFile] = File(...), resolutions: List[int] = None):&#xA; # Counters for transcoded videos&#xA; total_files = [0]&#xA;&#xA; # Iterate over each file&#xA; for file in files:&#xA;     # Check if the file is a valid video file based on its extension&#xA;     valid_video_extensions = {".mp4", ".avi", ".mkv", ".mov", ".wmv", ".flv"}&#xA;     if not any(file.filename.lower().endswith(ext) for ext in valid_video_extensions):&#xA;         print(f"Skipping non-video file: {file.filename}")&#xA;         continue&#xA;&#xA;     # Assign a unique ID for each file&#xA;     unique_id = str(uuid.uuid4())&#xA;&#xA;     # Log the filename and unique ID&#xA;     print(f"Processing file: {file.filename} with unique ID: {unique_id}")&#xA;&#xA;     # Create a folder for the unique ID&#xA;     unique_id_folder = os.path.join(OUTPUT_FOLDER, unique_id)&#xA;     Path(unique_id_folder).mkdir(parents=True, exist_ok=True)&#xA;&#xA;     # Save the uploaded file&#xA;     input_path = os.path.join(UPLOAD_FOLDER, file.filename)&#xA;     with open(input_path, "wb") as video_file:&#xA;         video_file.write(file.file.read())&#xA;&#xA;     # Check if the file is a valid video file using ffprobe&#xA;     try:&#xA;         subprocess.run(&#xA;             ["ffprobe", "-v", "error", "-select_streams", "v:0", "-show_entries", "stream=codec_type", "-of", "csv=p=0", input_path],&#xA;             check=True, capture_output=True&#xA;         )&#xA;     except subprocess.CalledProcessError:&#xA;         print(f"Skipping non-video file: {file.filename}")&#xA;         continue&#xA;&#xA;     # Determine the resolutions to transcode based on the provided or default resolution&#xA;     resolutions_to_transcode = [res for res in [240, 360, 480, 720] if resolutions is None or res in resolutions]&#xA;&#xA;     # If resolutions is not exactly 360, 480, 720, or 1080, transcode to the nearest lower resolution&#xA;     if resolutions is not None:&#xA;         resolutions_to_transcode = [get_closest_lower_resolution(res) for res in resolutions]&#xA;&#xA;     # Transcode the video into the specified resolutions&#xA;     for res in resolutions_to_transcode:&#xA;         output_folder = os.path.join(unique_id_folder, f"{res}p")&#xA;         Path(output_folder).mkdir(parents=True, exist_ok=True)&#xA;&#xA;         # Call the transcode_video function with tqdm progress bar&#xA;         with tqdm(total=100, desc=f"Transcoding {res}p", position=0, leave=True) as pbar:&#xA;             await transcode_video(input_path, output_folder, res, unique_id, total_files, pbar)&#xA;&#xA;     # Create index.m3u8 file after transcoding all resolutions&#xA;     create_index_m3u8(unique_id, resolutions_to_transcode)&#xA;&#xA; return JSONResponse(content={"message": f"{total_files[0]} videos transcoded."})&#xA;

    &#xA;

    If I provide one resolution it works fine. But if I provide a list of resolutions for all the uploaded videos I am getting error 422.

    &#xA;

    &#xA;Code    Details&#xA;422 &#xA;Error: Unprocessable Entity&#xA;&#xA;Response body&#xA;Download&#xA;{&#xA;  "detail": [&#xA;    {&#xA;      "loc": [&#xA;        "body",&#xA;        "resolutions",&#xA;        0&#xA;      ],&#xA;      "msg": "value is not a valid integer",&#xA;      "type": "type_error.integer"&#xA;    }&#xA;  ]&#xA;}&#xA;

    &#xA;

    I used python 3.8.18. Can you help me please ? I tried with list, object but always getting the error.

    &#xA;