
Recherche avancée
Autres articles (39)
-
Personnaliser les catégories
21 juin 2013, parFormulaire 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 (...) -
Publier sur MédiaSpip
13 juin 2013Puis-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 -
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 (...)
Sur d’autres sites (8096)
-
Choppy Audio while playing Video from StreamingAssets in Unity's VideoPlayer
8 novembre 2017, par Saad AneesI have been trying to load video that I recorded from AVPro Movie Capture (Free Version). The video file was in GB so I converted it using ffmpeg command
-y -i RawVideo.avi -qscale 7 FinalVideo.avi
and saved it toStreamingAssets
. I got the desired result. Now I want to play that converted video file in video player for preview. But the problem is when video is played from URL the audio is very choppy. I played it in windows player and VLC and it was fine. The problem occurs only in Unity’sVideoPlayer
.PreviewVideo Class :
public class PreviewVideo : MonoBehaviour
{
public GameObject VideoSelection;
public GameObject RecordingCanvas;
public GameObject FacebookCanvas;
public GameObject Home;
public Sprite pauseImage;
public Sprite playImage;
public VideoPlayer videoPlayer;
public GameObject EmailCanvas;
// Use this for initialization
void Start ()
{
}
public void Referesh()
{
videoPlayer.gameObject.GetComponent<spriterenderer> ().sprite = Resources.Load<sprite> ("Thumbnails/" + StaticVariables.VideoToPlay);
videoPlayer.url = Application.streamingAssetsPath + "/FinalVideo.avi";
}
public void PlayVideo()
{
if (!videoPlayer.isPlaying) {
videoPlayer.Play ();
}
}
public void Back ()
{
this.gameObject.SetActive (false);
VideoSelection.SetActive (true);
}
public void HomeBtn ()
{
SceneManager.LoadScene (0);
}
public void SendEmailDialogue()
{
EmailCanvas.SetActive (true);
this.gameObject.SetActive (false);
}
public void FacebookShare()
{
FacebookCanvas.SetActive (true);
}
}
</sprite></spriterenderer>Refresh()
is called from RecordingCanvas class :public class RecordingCanvas : MonoBehaviour {
public GameObject VideoSelection;
public GameObject PreviewVideo;
public GameObject Home;
public GameObject canvas;
public RawImage rawImage;
public GameObject videoThumbnail;
float _seconds;
bool canStart = false;
public SpriteRenderer NumSprite;
public VideoPlayer videoPlayer;
WebCamTexture webcamTexture;
Process process;
void Start ()
{
Refresh ();
}
public void Refresh()
{
_seconds = 0;
NumSprite.gameObject.SetActive(true);
webcamTexture = new WebCamTexture (1280, 720);
webcamTexture.Stop ();
rawImage.texture = webcamTexture;
rawImage.material.mainTexture = webcamTexture;
webcamTexture.Play ();
videoPlayer.loopPointReached += VideoEndReached;
videoPlayer.gameObject.GetComponent<spriterenderer> ().sprite = Resources.Load<sprite> ("Thumbnails/" + StaticVariables.VideoToPlay);
videoThumbnail.GetComponent<spriterenderer> ().sprite = Resources.Load<sprite> ("Thumbnails/" + StaticVariables.VideoToPlay);
videoPlayer.clip = Resources.Load<videoclip> ("Videos/" + StaticVariables.VideoToPlay);
}
void Update()
{
_seconds += Time.deltaTime;
print ((int)_seconds);
if (_seconds < 1) {
NumSprite.sprite = Resources.Load<sprite> ("Numbers/3");
}
else if(_seconds <2)
NumSprite.sprite = Resources.Load<sprite>("Numbers/2");
else if(_seconds <3)
NumSprite.sprite = Resources.Load<sprite>("Numbers/1");
if (_seconds >= 3 && _seconds <=4 ) {
canStart = true;
}
if (canStart) {
NumSprite.gameObject.SetActive(false);
canStart = false;
FindObjectOfType<capturegui> ().StartCapture();
videoPlayer.Play ();
videoThumbnail.SetActive (false);
}
}
IEnumerator StartConversion()
{
yield return new WaitForSeconds (1.5f);
process = new Process();
if (File.Exists (Application.streamingAssetsPath + "/FinalVideo.avi"))
File.Delete(Application.streamingAssetsPath + "/FinalVideo.avi");
process.StartInfo.WorkingDirectory = Application.streamingAssetsPath;
process.StartInfo.FileName = Application.streamingAssetsPath + "/ffmpeg.exe";
process.StartInfo.Arguments = " -y -i " + StaticVariables.RawVideo + ".avi " + "-qscale 7 " + StaticVariables.FinalVideo + ".avi";
process.StartInfo.CreateNoWindow = false;
process.EnableRaisingEvents = true;
process.Exited += new EventHandler(Process_Exited);
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.Start();
process.WaitForExit ();
canvas.SetActive (false);
PreviewVideo.SetActive (true);
FindObjectOfType<previewvideo> ().Referesh ();
File.Copy (Application.streamingAssetsPath + "/FinalVideo.avi", @"C:\xampp\htdocs\facebook\images\FinalVideo.avi", true);
this.gameObject.SetActive (false);
}
void Process_Exited(object sender, EventArgs e)
{
process.Dispose ();
}
void VideoEndReached(UnityEngine.Video.VideoPlayer vp)
{
videoPlayer.Stop ();
FindObjectOfType<capturegui> ().StopCapture();
webcamTexture.Stop ();
canvas.SetActive (true);
StartCoroutine(StartConversion ());
}
}
</capturegui></previewvideo></capturegui></sprite></sprite></sprite></videoclip></sprite></spriterenderer></sprite></spriterenderer>I am using Unity version 2017.1.1p4 personal edition. Windows 10 with high end PC. I am making this app for standalone PC.
I am stuck here. Can’t proceed further. Please help me with this issue.
-
FFmpeg stream giving me "Alsa" errors
14 mars 2019, par Sherman B.Of late I have been trying different ways of telling my Raspberry Pi to send video to YouTube live stream. One of the things I wanted to be able to do is boot the Pi up, and it automatically starts the live stream on its own. The advantages to this are huge (won’t have to tote around keyboard/mouse to start the stream, or have to ssh into the Pi to start the stream).
Now what I did to accomplish this was to make a Python program that pipes the stream from my encoder(FFmpeg) directly to the stream. My goal was to make the program work, and then, set it to run automatically. But every time I run the file in my terminal this is my result :
Traceback (most recent call last):
File "stream.py", line 22, in <module>
stream.stdin.close()
NameError: name 'stream' is not defined
[h264 @ 0x19ed450] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
pi@raspberrypi:~ $ Input #0, h264, from 'pipe:':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264, none, 25 tbr, 1200k tbn, 50 tbc
Unknown input format: 'alsa'
</module>Now I think I can fix I can fix some of those errors, but the biggest thing that worries me there is : the fact that "alsa" is unknown. I installed "libsasound" which is supposed to make Alsa usable, but that clearly did not help.
I am using Python 3.
This is my syntax for this program :
import subprocess
import picamera
import time
YOUTUBE="rtmp://a.rtmp.youtube.com/live2/"
KEY = ("MY PERSONAL ENCODER KEY")
stream_cmd = 'ffmpeg -f h264 -r 25 -i - -itsoffset 5.5 -fflags nobuffer -f alsa -ac 1 -i hw:1,0 -vcodec copy -acodec aac -ac 1 -ar 8000 -ab 32k -map 0:0 -map 1:0 -strict experimental -f flv ' + YOUTUBE + KEY
stream_pipe = subprocess.Popen(stream_cmd, shell=True, stdin=subprocess.PIPE)
camera = picamera.PiCamera(resolution=(640, 480), framerate=25)
try:
now = time.strftime("%Y-%m-%d-%H:%M:%S")
camera.framerate = 25
camera.vflip = True
camera.hflip = True
camera.start_recording(stream.stdin, format='h264', bitrate = 2000000)
while True:
camera.wait_recording(1)
except KeyboardInterrupt:
camera.stop_recording()
finally:
camera.close()
stream.stdin.close()
stream.wait()
print("Camera safely shut down")
print("Good bye")Now maybe I am missing something simple here, but I don’t know what. I have tried many ideas (e.g. replacing Alsa with some other input, naming the "stream" function.) I have no idea.
-
ffmpeg x264 encoding cpu usage
4 décembre 2016, par Amin FazlaliI want to convert a mkv formatted video to mp4, using the ffmpeg application.
and for that I ran below command in terminal :ffmpeg -y -i c38a4990774b3c23.mkv -c:v libx264 -c:a aac -r 25 -strict -2 -map_metadata -1 -movflags faststart -vf "crop=1920:800:0:4, scale=iw*min(426/iw\,240/ih):ih*min(426/iw\,240/ih), pad=426:240:(426-iw*min(426/iw\,240/ih))/2:(240-ih*min(426/iw\,240/ih))/2, setsar=sar=1" output.mp4
I have compiled ffmpeg with —enable-pthread configuration
when I run this command on my personal PC with a 3.2GHz quad core cpu, it uses 60% of overall cpu process and encode video with 150fps ; but when I run this command on a production server with 8 2.4GHz dual core cpu (16 core) it only uses up to 20% of overall cpu process and encode video with 97fps.
I have also tried ramdisk but I got no performance improvement.