
Recherche avancée
Autres articles (35)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
Demande de création d’un canal
12 mars 2010, parEn fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)
Sur d’autres sites (4826)
-
avcodec/snowenc : Fix used reference MV in fullpel iterative ME
10 mai 2015, par Michael Niedermayer -
Playing a custom avi data stream using QtMultimedia
26 décembre 2015, par sbabbiI need to play back a custom AVI file that contains a classic video stream, an audio stream but also a custom data stream.
The custom stream contains data that is visualized by some custom widgets ; those widgets only need that each custom frame is written in a buffer at the proper time.
Our application is based on Qt, and already uses
QMediaPlayer
/QVideoWidget
to play traditional videos, but the additional custom stream makes things more complicated, because AFAIKQMediaPlayer
only plays the video/audio and ignores everything else.I would like to avoid to reinvent the entire
qt-multimedia
, but I am not sure how to make the best out of the available Qt classes.
My ideas so far are :
-
Write a custom media player class that demuxes and decodes the video using
ffmpeg
, implements the timing, usesQAudioOutput
for playing the audio, produces a stream ofQVideoFrame
s to be played on the video and write the custom data to some buffer for visualization.The problem : In order to avoid writing the code to rescale/convert the video frames, I would like to reuse
QVideoWidget
, but it seems to work only with the "real"QMediaPlayer
. -
Demux the input file and feed
QMediaPlayer
with the AV streams.
Demux the input withffmpeg
(possibly leaving the decoding to the Qt backend), have oneQIODevice
to retrieve only the video/audio streams from the input file and another one to retrieve the data stream. Play the video/audio withQMediaPlayer
.+-------+
| QFile |
+---^---+
|
inherits
|
+--------------------+
| MyAviDemuxer |
| |
| holds a queue of |
| demuxed packets |
+--------------------+
| |
readDataPacket readVideoPacket
| |
+-------v--------+ +--------v-----------+ +-----------+
| MyCustomReader | | MyVideoAudioStream +--inherits--> QIODevice |
+----------------+ +--------+-----------+ +-----------+
|
setMedia
|
+-------v-------+
| QMediaPlayer |
+---------------+The problem : synchronize the timing of the data stream with
QMediaPlayer
, handle headers and metadata correctly.
I am slightly inclined to option 1, just because it gives me more control, but I am wondering if I missed an easier solution (even Windows-only).
-
-
Encrypted HLS works as live stream, doesn't work as VOD
22 avril 2015, par MisiurI’ve found some crude bash script for encoding and encrypting video file, into a HLS stream, and I’ve edited it slightly (I have no idea about bash) :
#!/bin/bash
set -e # Exit on errors
tsFile="$1"
if ! [ -f "$tsFile" -a -r "$tsFile" ]; then
echo "First argument is required" >&2
exit 2
fi
if [ -z "$3" ]; then
output="output"
else
output="$3"
fi
keyFile="$output.key"
keyInfoFile="$output.keyinfo"
playList="$output.m3u8"
if [ -z "$4" ]; then
separator='-'
else
separator="$4"
fi
splitFilePrefix="$output$separator"
if [ -d "$2" ]; then
outDir="$2"
else
mkdir "$2" || exit 1
outDir="$2"
fi
tempDir="$outDir/.$$_tmp"
keyFile="$outDir/$keyFile"
mkdir $tempDir
echo "$outdir/$keyFile\n$outdir/$keyFile" > "$outdir/$keyInfoFile"
ffmpeg -i "$tsFile" -hls_time 5 -hls_list_size 0 -hls_segment_filename "$tempDir/$splitFilePrefix%03d.ts" -strict -2 "$tempDir/$playList"
openssl rand 16 > $keyFile
encryptionKey=`cat $keyFile | hexdump -e '16/1 "%02x"'`
numberOfTsFiles=$(( `ls "$tempDir/$splitFilePrefix"*.ts | wc -l` -1 ))
for i in $(seq -f "%03g" 0 $numberOfTsFiles); do
initializationVector=`printf '%032x' $(( 10#$i))`
openssl aes-128-cbc -e -in "$tempDir/$splitFilePrefix"$i.ts \
-out "$outDir/$splitFilePrefix"$i.ts -nosalt -iv $initializationVector -K $encryptionKey
done
{
head -4 "$tempDir/$playList"
echo '#EXT-X-KEY:METHOD=AES-128,URI='"$keyFile"
egrep "$tempDir/$playList" -vie '#EXT-X-TARGETDURATION:' \
| tail -n +4
} > "$outDir/$playList"
#rm -r "$tempDir"This results in a something like this :
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-KEY:METHOD=AES-128,URI=output.key
#EXT-X-TARGETDURATION:11
#EXTINF:10.176833,
output-000.ts
#EXTINF:8.341667,
output-001.ts
#EXTINF:8.341667,
output-002.ts
#EXTINF:3.136467,
output-003.ts
#EXT-X-ENDLISTThis almost works. However I need an VOD, not a live stream. So, I added line :
#EXT-X-PLAYLIST-TYPE:VOD
And now it doesn’t work with encrypted segments, only with unencrypted ones. I thought all segments are crypted separately ? Also, even with unencrypted files, the info about total length isn’t present. How can I fix that ?