Recherche avancée

Médias (1)

Mot : - Tags -/karaoke

Autres articles (52)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

  • 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

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (7965)

  • ffmpeg - Build HLS stream with all tracks of the input source

    25 juillet 2021, par Kaydee Dunlop

    I would like to create HLS streams for videos. I'm working since more than 2 days now to find a solution that might work but no luck till now to get all tracks of the input inside my HLS output.

    


    What I want in the end is a small script that can merge all tracks form a mp4 imput together and create a proper master.m3u8 playlist referencing all other m3u8 playlists of my m4s, webvtt and audio snippets. Currently I don't have adaptive streaming implemented. To save bandwidth I only want to have one video stream output at a max resolution of 1080p @ 3 Mbit/s.

    


    This is my current state of work, please feel free to to use it :

    


    #!/usr/bin/env bash
LC_NUMERIC="en_US.UTF-8"
START_TIME=$SECONDS
set -e

echo "-----START GENERATING HLS STREAM-----"
# Usage create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]
[[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1

# comment/add lines here to control which renditions will be created
renditions=(
# resolution  bitrate  audio-rate
  "1920x1080  3000k    128k"
)

segment_target_duration=20      # try to create a new segment every 10 seconds
max_bitrate_ratio=1.07          # maximum accepted bitrate fluctuations
rate_monitor_buffer_ratio=1.5   # maximum buffer size between bitrate conformance checks

#########################################################################

source="${1}"
target="${2}"
if [[ ! "${target}" ]]; then
  target="${source##*/}" # leave only last component of path
  target="${target%.*}"  # strip extension
fi
mkdir -p ${target}

# ----CUSTOM----
sourceResolution="$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 ${source})"
# echo ${sourceResolution}
arrIN=(${sourceResolution//x/ })
sourceWidth="${arrIN[0]}"
sourceHeight="${arrIN[1]}"

echo ${sourceWidth}
echo ${sourceHeight}

sourceAudioBitRate="$(ffprobe -v error -select_streams a:0 -show_entries stream=bit_rate -of csv=s=x:p=0 ${source})"
sourceAudioBitRateFormatted=$((sourceAudioBitRate / 1000))
# ----END CUSTOM----

key_frames_interval="$(echo `ffprobe ${source} 2>&1 | grep -oE '[[:digit:]]+(.[[:digit:]]+)? fps' | grep -oE '[[:digit:]]+(.[[:digit:]]+)?'`*2 | bc || echo '')"
key_frames_interval=${key_frames_interval:-50}
key_frames_interval=$(echo `printf "%.1f\n" $(bc -l <<<"$key_frames_interval/10")`*10 | bc) # round
key_frames_interval=${key_frames_interval%.*} # truncate to integer

# static parameters that are similar for all renditions
static_params="-c:s webvtt -c:a aac -ar 48000 -c:v copy -sc_threshold 0"
static_params+=" -g ${key_frames_interval} -keyint_min ${key_frames_interval} -hls_time ${segment_target_duration}"
static_params+=" -hls_playlist_type vod -hls_segment_type fmp4"
static_params+=" -var_stream_map v:0,a:0,s:0"

# misc params
misc_params="-hide_banner -y"

master_playlist="#EXTM3U
#EXT-X-VERSION:3
"
cmd=""
resolutionValid=0
prevHeight=0
for rendition in "${renditions[@]}"; do
  # drop extraneous spaces
  rendition="${rendition/[[:space:]]+/ }"

  # rendition fields
  resolution="$(echo ${rendition} | cut -d ' ' -f 1)"
  bitrate="$(echo ${rendition} | cut -d ' ' -f 2)"
  audiorate="$(echo ${rendition} | cut -d ' ' -f 3)"

  audioBitRateFormatted=${audiorate%?} # remove "k" at the last index

  # take highest possible audio bit rate
  if [ $audioBitRateFormatted -gt $sourceAudioBitRateFormatted ]; then
      audiorate=${sourceAudioBitRateFormatted}k
  fi

  # calculated fields
  width="$(echo ${resolution} | grep -oE '^[[:digit:]]+')"
  height="$(echo ${resolution} | grep -oE '[[:digit:]]+$')"
  maxrate="$(echo "`echo ${bitrate} | grep -oE '[[:digit:]]+'`*${max_bitrate_ratio}" | bc)"
  bufsize="$(echo "`echo ${bitrate} | grep -oE '[[:digit:]]+'`*${rate_monitor_buffer_ratio}" | bc)"
  bandwidth="$(echo ${bitrate} | grep -oE '[[:digit:]]+')000"
  name="stream"
  
  widthParam=0
  heightParam=0

  if [ $(((width / sourceWidth) * sourceHeight)) -gt $height ]; then
    widthParam=-2
    heightParam=$height
  else
    widthParam=$width
    heightParam=-2
  fi
  
  #cmd+=" ${static_params} -vf scale=w=${widthParam}:h=${heightParam}"
  cmd+=" -b:v ${bitrate} -maxrate ${maxrate%.*}k -bufsize ${bufsize%.*}k -b:a ${audiorate}"
  cmd+=" -hls_segment_filename ${target}/${name}_%03d.m4s ${target}/${name}.m3u8"
  
  # add rendition entry in the master playlist
  master_playlist+="#EXT-X-STREAM-INF:BANDWIDTH=${bandwidth},RESOLUTION=${resolution}\n${name}.m3u8\n"

  resolutionValid=1
  prevHeight=${height}
done

if [ $resolutionValid -eq 1 ]; then
  # start conversion
  echo -e "Executing command:\nffmpeg ${misc_params} -i ${source} ${cmd}\n"
  ffmpeg ${misc_params} -i ${source} ${cmd}
  # create master playlist file
  echo -e "${master_playlist}" > ${target}/playlist.m3u8
  echo "Done - encoded HLS is at ${target}/"
else
  echo "Video source is too small"
  exit 1
fi

ELAPSED_TIME=$(($SECONDS - $START_TIME))

echo "Elapsed time: ${ELAPSED_TIME}"
echo "-----FINISH GENERATING HLS STREAM-----"


    


  • Trigger exec_pull on http connection

    29 octobre 2019, par M. Cole

    Is it possible to trigger exec_pull on http connection ? For example, I have the following Nginx configuration :

    server {

    listen 80;

    location /hls {

     types {
       application/vnd.apple.mpegurl m3u8;
       video/mp2t ts;
     }

                     root /mnt;
                     add_header Cache-Control no-cache;
                     index index.m3u8 index.ts;
                     add_header Access-Control-Allow-Origin *;
               }
           }

    }

    rtmp {

       server {
           listen 1935;
           allow play all;

    application hls {

    live on;
    exec_options on;

    exec_pull /usr/bin/ffmpeg -re -i http://example.com:333/293.m3u8 -c copy -f flv rtmp://localhost:1935/hls/$name;
    }

    application hls {

       live on;
       hls on;
       hls_path /mnt/hls;
       hls_fragment 3s;
    }

        }
     }

    I would like to have an exec_pull triggered on HLS http request.
    For example If I request http://my-serverip.com/hls/293.m3u8 then it should start ffmpeg to start creating hls files.

    I’ve been working on this for 5-6 days and could not figure out how to trigger exec_pull on http requests.

  • To get OpenCV VideoWriter work across platforms consistently for MP4 container with H264 encoding

    28 mars 2019, par Moh

    I am trying to get OpenCV VideoWriter work across platform consistently for MP4 container with H246 encoding.

    Target platforms in order of importance - Ubuntu, Raspbian, OSX

    Basically, my shortcoming at this point is not understanding the relationship of FourCC code (as a parameter to OpenCV VideoWriter) to the FFMPEG backend and its requirements. I am interested to understand the game in play rather than discussing a piece of code.

    What I want to know is when I specify ’X264’ as FourCC code trying to write an x.MP4 file (FFMPEG backend) and the request is marshalled to FFMPEG what requirements/dependencies need to be satisfied by the OS for it to success.

    So far I have got my python stack writing MP4 video files across Raspbian/Ubuntu/OSX, with a hack.

    On my Raspbian stretch installation, I use 0x00000021 as the fourCC code.
    On Ubuntu (VM on OSX) and on OSX, AVC1 works.

    Days of Googling only delivered those hacks, not a good understanding of the problem.

    The x264 as FourCC code leads to one of - failure, non-portable video file + annoying FFMPEG warning.

    I am trying to get to the bottom of it.

    The code,

       #self.__fourCC = cv2.VideoWriter_fourcc('x', '2', '6', '4')
       self.__fourCC = cv2.VideoWriter_fourcc('a', 'v', 'c', '1')
       if PlatformUtils.isRunningOnRaspberryPi():
           self.__fourCC = 0x00000021

    I have control over the version both OpenCV and FFMPEG (if required GStreamer too). I can and have built them for Ubuntu/Raspbian.