
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (39)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
HTML5 audio and video support
13 avril 2011, parMediaSPIP 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 (...)
Sur d’autres sites (5714)
-
ffmpeg concatenation audio out of sync
24 août 2014, par av8rSo I am attempted to concat clips from a camcorder with anintro and ending clip. All my videos have two streams Video and Audio 0:0 and 0:1 and all the streams are h264 for video and AAC for audio. The into and ending clips were created from a single jpeg image and the audio tracks are silent. The concat portion of my script was created by burke and is the MultiMedia concat script (mcat). If I concat the camcorder clips with my script they come out okay, just slightly off but really not very noticeable when I add the intro and ending clips with the camera clips the final output video is horribly out of sync. The audio/video sync is progressive and as such becomes worse and the video runs. I am not sure what I am doing wrong or what is going wrong to fix this issue. Any help would be much appreciated. Below is the script.
#!/bin/bash
CD="/Applications/CocoaDialog.app/Contents/MacOS/CocoaDialog"
catnum=$($CD standard-inputbox --no-newline \
--title "Video Controls" \
--informative-text "Please enter the catalog number for this sermon.")
[[ $(head -n1 <<< "$catnum") == "2" ]]
catnum=$(tail -n1 <<<"$catnum")
output="$catnum.MP4"
psp_dir="psp/$catnum/"
qhd_dir="qhd/$catnum/"
psp_ts="$psp_dir$catnum-%04d.ts"
qhd_ts="$qhd_dir$catnum-%04d.ts"
EXTRA_OPTIONS='-vcodec libx264 -x264opts opencl -crf 23 -preset faster -acodec libfdk_aac -ac 2 -ar 44100 -ab 128k'
#qhd='-c:v vp9 -map 0 -f segments -segment_time 10 -segment_list $last.m3u8 - segment_format mpegts -s 960x540 -minrate 200k -maxrate 650k -c:a libfdk_aac -strict experimental -ac 1 -ar 22050 -ab 64k'
#psp='-c:v vp9 -map 0 -f segments -segment_time 10 -segment_list $last.m3u8 -segment_format mpegts -s 480x272 -minrate 200k -maxrate 650k -c:a libfdk_aac -strict experimental -ac 1 -ar 22050 -ab 64k'
# OLD Extra_options -vcodec libx264 -crf 23 -preset medium -acodec aac -strict experimental -ac 2 -ar 44100 -ab 128k
TMP=/tmp
files=input/*.MP4
fade_temp=processing/fade_tmp.mp4
fade_temp1=processing/fade_tmp1.mp4
intro='intro.mp4 '
ending='ending.mp4'
rm -f $TMP/mcs_*
rm -f /tmp/hpipe
# mkfifo /tmp/hpipe
fade() {
first=${@:1:1}
second=${@:2:1}
last=${@:$#:1}
sec=$(/usr/local/bin/ffmpeg -i $last 2>&1 | grep "Duration"| cut -d ' ' -f 4 | sed s/,// |awk '{ split($1, A, ":"); print 3600*A[1] + 60*A[2] + A[3] - 1 }')
#sec=`bc <<< $finvidsec-1`
echo "$first and $last"
echo "*** The Time of the Last clip in sec:$sec ***"
ffmpeg -y -i $first -c:v libx264 -x264opts opencl -af "afade=t=in:ss=0:d=1" -vf "fade=in:st=0:d=1:color=white" -pix_fmt yuv420p $fade_temp 2>/dev/null null
ffmpeg -y -i $last -c:v libx264 -x264opts opencl -af "afade=t=out:st=$sec:d=1" -vf "fade=t=out:st=$sec:d=1:color=white" -pix_fmt yuv420p $fade_temp1 2>/dev/null null
mv -f $fade_temp $first
mv -f $fade_temp1 $last
}
concat() {
first=${@:1:1}
second=${@:2:1}
last=${@:$#:1}
len=$(($#-2))
inputs=${@:2:$len}
mkfifo $TMP/mcs_a1 $TMP/mcs_v1
fps=$(ffmpeg -i $first 2>&1 | awk '/fps/{for(f=1;f<=NF;f++){if($f~/^fps,*$/){print $(f-1)}}}')
ffmpeg -y -i $first -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 $TMP/mcs_a1 2>/dev/null null &
ffmpeg -y -r $fps -i $first -an -f yuv4mpegpipe -vcodec rawvideo -r 29.97 $TMP/mcs_v1 2>/dev/null null &
all_a=$TMP/mcs_a1
all_v=$TMP/mcs_v1
i=2
for f in $inputs
do
mkfifo $TMP/mcs_a$i $TMP/mcs_v$i
fps=$(ffmpeg -i $f 2>&1 |awk '/fps/{for(f=1;f<=NF;f++){if($f~/^fps,*$/){print $(f-1)}}}')
ffmpeg -y -i $f -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 $TMP/mcs_a$i 2>/dev/null null &
{ ffmpeg -y -r $fps -i $f -an -f yuv4mpegpipe -vcodec rawvideo -r 29.97 - 2>/dev/null null | tail -n +2 > $TMP/mcs_v$i ; } &
all_a="$all_a $TMP/mcs_a$i"
all_v="$all_v $TMP/mcs_v$i"
let i++
done
mkfifo $TMP/mcs_a_all
mkfifo $TMP/mcs_v_all
cat $all_a > $TMP/mcs_a_all &
cat $all_v > $TMP/mcs_v_all &
ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i $TMP/mcs_a_all \
-f yuv4mpegpipe -vcodec rawvideo -i $TMP/mcs_v_all \
$EXTRA_OPTIONS \
$last
rm -f $TMP/mcs_*
#sec=$(/usr/local/bin/ffmpeg -i $last 2>&1 | grep "Duration"| cut -d ' ' -f 4 | sed s/,// |awk '{ split($1, A, ":"); print 3600*A[1] + 60*A[2] + A[3] - 0.5 }')
}
hls() {
first=${@:1:1}
mkdir $psp_dir $qhd_dir
ffmpeg -i $first -f ssegment -bsf h264_mp4toannexb -map 0 -segment_time 10 - segment_list $psp_dir$catnum.m3u8 -segment_format mpegts \
-c:v libx264 -s 480x272 -profile:v baseline -level 3.1 -r 29.97 -g 29.97 \
-keyint_min 90 -x264opts "keyint=90:min-keyint=90:no-scenecut" \
-bufsize 650 -minrate 1 -maxrate 650 \
-c:a libfdk_aac -ar 22050 -ac 1 -ab 32k $psp_ts \
-f ssegment -bsf h264_mp4toannexb -map 0 -segment_time 10 -segment_list $qhd_dir$catnum.m3u8 -segment_format mpegts \
-c:v libx264 -s 960x540 -profile:v baseline -level 3.1 -r 29.97 -g 29.97 \
-keyint_min 90 -x264opts "keyint=90:min-keyint=90:no-scenecut" \
-bufsize 950 -minrate 1 -maxrate 950 \
-c:a libfdk_aac -ar 22050 -ac 1 -ab 32k $qhd_ts
}
fade $files
concat $intro $files $ending $output
hls $output -
How to create a custom theme in Piwik – Introducing the Piwik Platform
23 août 2014, par Thomas Steur — DevelopmentThis is the start of a new blog series where we introduce the capabilities of the Piwik platform. You’ll learn how to write custom plugins & themes, how to use our HTTP APIs and more.
We have been greatly simplifying our APIs over the last year focusing primarily on one design principle :
The complexity of our API should never exceed the complexity of your use case.
In other words, if you have a simple use for our API, we want it to be simple for you to accomplish it. If you have a complex, big, hairy, change-the-world idea, then maybe we can’t make it simple for you to accomplish it, but we want it to be possible.
Over the next weeks and months you will learn what exactly we mean by this and how we accomplished it.
FYI, don’t worry if you’re currently using our APIs, we keep them backwards compatible and we announce breaking changes in our platform changelog.
Getting started
In this series of posts, we assume that you have already set up your development environment. If not, visit the Piwik Developer Zone where you’ll find the tutorial Setting up Piwik.
To summarize the things you have to do to get setup :
- Install Piwik (for instance via git).
- Activate the developer mode :
./console development:enable --full
. - And if you want, generate some test data :
./console visitorgenerator:generate-visits --idsite=1 --limit-fake-visits=600
. This can take a while and requires the VisitorGenerator plugin from the Marketplace.
Let’s start creating our own theme
We start by using the Piwik Console to create a blank theme :
./console generate:theme
The command will ask you to enter a name, description and version number for your theme. I will simply use “CustomTheme” as the name of the theme. There should now be a folder
plugins/CustomTheme
which contains some files to get you started easily.Before we modify our theme, we have to activate it by visiting the Settings => Themes admin page in our Piwik installation, or alternatively by running the command
./console core:plugin activate YourCustomTheme
. If the theme is not activated, we won’t see any changes.Theme Contents
The most important files in our theme are
plugins/CustomTheme/stylesheets/theme.less
,plugins/CustomTheme/stylesheets/_colors.less
andplugins/CustomTheme/stylesheets/_variables.less
:theme.less
is the file that will be included when your theme is activated. In this file you would include other stylesheet files and overwrite CSS styles._colors.less
contains many less variables allowing you to easily change the colors Piwik uses._variables.less
contains currently only one variable to change the font family. More variables will be added in the future. Note : This is a new feature and the file will be only there in case you have installed Piwik using Git or at least Piwik 2.6.0.
Changing the font family
To change the font family simply overwrite the variable
@theme-fontFamily-base: Verdana, sans-serif;
in_variables.less
. That’s it.Changing colors
To change a color, uncomment the less variables of the colors you want to change in
_colors.less
. I will shortly explain some of them. Usually changing only these colors will be enough to adjust Piwik’s look to your corporate design or to create a look that pleases you :@theme-color-brand: #d4291f; // The Piwik red which is for instance used in the menu, it also defines the color of buttons, the little arrows and more
@theme-color-brand-contrast: #ffffff; // Contrast color to the Piwik red. Usually you need to change it only in case you define a light brand color. For instance to change the text color of buttons
@theme-color-link: #1e93d1; // The link color which is usually a light blue
@theme-color-widget-title-text: #0d0d0d; // The text and background color of the header of a widget (Dashboard)
@theme-color-widget-title-background: #f2f2f2;
@theme-color-menu-contrast-text: #666666; // The text color of a menu item in the reporting sub menu and the admin menu
@theme-color-menu-contrast-textActive: #0d0d0d; // The text color of an active menu item
@theme-color-menu-contrast-background: #f2f2f2; // The background color of a menu item
@graph-colors-data-series[1-8]: #000000; // The different colors used in graphsMaking the change visible
To make a color or font change actually visible when you reload a page in Piwik you will have to delete the compiled CSS file after each change like this :
rm tmp/assets/asset_manager_global_css.css
Publishing your Theme on the Marketplace
In case you want to share your theme with other Piwik users you can do this by pushing your theme to GitHub and creating a tag. Easy as that. Read more about how to distribute a theme.
Advanced features
Isn’t it easy to create a custom theme ? All we had to do is to change some less variables. We never even created a file ! Of course, based on our API design principle, you can accomplish more if you want. For instance, you can change icons, CSS stylesheets, templates and more.
For further customising your Piwik, you can even change the logo and favicon in the Settings => General settings page.
Would you like to know more about theming ? Go to our Theme guide in the Piwik Developer Zone.
If you have any feedback regarding our APIs or our guides in the Developer Zone feel free to send it to us.
PS : see also this related FAQ : How do I White Label Piwik ?
-
PHP file that outputs a video does not play
2 septembre 2014, par Rob Avery IVSo, I created a php file that has the following code (abridged version) :
<?php
//Full version of file does a lot of database stuff
//Get $path of file
header('Content-type: video/mp4');
header('Content-Length: '.filesize($path)); // provide file size
$contents = file_get_contents($path);
echo $contents;I use this php to obtain the video content, so I don’t have to hardcode the video path into the HTML and so I can keep the videos outside public_html. I have tested this before, and it works with other video files.
Here is a timeline of where this file has been and what I’m trying to do :
- File is uploaded
- File is converted to mp4 using ffmpeg-php
- Stream it (similar to youtube) using the php code above
The file uploads and converts fine (I tested this by downloading the video file locally after it has been converted and I was able to play the video). I use the following ffmpeg command to convert ALL videos to mp4 :
"ffmpeg -i '".$srcFile."' -vcodec h264 -acodec aac -strict -2 -f mp4 '".$destFile."'";
My only problems is with step 3. When I use the above php file to output the video, it doesn’t work sometimes (Right now, it only works with a few videos). Every file I’m outputting is converted the same way with the above ffmpeg command.
How do I make it so I am able to convert all (or at least most) video files to be able to stream them ?