Quantcast
Channel: MediaSPIP
Viewing all 118079 articles
Browse latest View live

Rescaling and slowing down a movie at the same time with ffmpeg

$
0
0

I would like with ffmpeg to slow down a movie I am creating using the flag:

-filter:v "setpts=2.0*PTS"

However the height of my still images is not divisible by 2, so to avoid the error: height not divisible by 2 (1238x833), I am using the flag:

-vf scale="trunc(iw/2)*2:trunc(ih/2)*2"

(I also tried -vf scale=1238:-2).

When I do this the film is generated but it isn't slowed down, like if the -filter:v "setpts=2.0*PTS" wasn't there.

Is there something particular to do in order to have both option working at the same time?

Here is the complete command I am using:

ffmpeg -an -i ./movie/cphmd1.%05d.ppm -vcodec libx264 -pix_fmt yuv420p -b:v 5000k -r 24 -crf 18 -filter:v "setpts=2.0*PTS" -vf scale="trunc(iw/2)*2:trunc(ih/2)*2" -preset slow -f mp4 cphmd1_slower.mp4

Many thanks in advance!


Documentation #3880 (Nouveau): SPIP 3.0..., PHP7 et MySQL

$
0
0

Bonjour,

L'installation de SPIP version 3.0… sur un serveur utilisant les outils PHP7 et MySQL… ne peut aboutir. SPIP indique lors de l'étape 1 « SPIP exige l'extension php : MYSQL | PostgreSQL | SQLite »
Le message apporte déjà des informations précieuses même si il reste insuffisant.
En revanche lors d'une migration de cette même version 3.0… de SPIP sur un serveur travaillant avec les mêmes outils (en l'occurence le cas qui me concerne), le message est plutôt austère :
« Site en travaux. Attention : un problème technique… »

J'ai cherché un bon moment pour enfin comprendre que PHP7 n'acceptait plus l'extension mysql, mais uniquement celles de mysqli ou PDO et que SPIP 3.0… de son côté ne reconnait que l'extension mysql.
La documentation concernant SPIP3.0 (http://www.spip.net/fr_article5427.html) n'informe à aucun moment sur les caractéristiques de fonctionnement à minima.
A l'inverse ces informations sont bien décrites pour la version SPIP 3.1… sur http://www.spip.net/fr_article5713.html

En conclusion il serait intéressant, en plus d'effectuer une mise à jour de la documentation, d'afficher une message d'avertissement personnalisé, dans ce cas de figure précis, du type « Votre version de PHP ne permet pas d'installer la version SPIP 3.0… ».

Bien à vous.

Decoding a h264 (High) stream with OpenCV's ffmpeg on Ubuntu

$
0
0

I am working with a video stream (no audio) from an ip camera on Ubuntu 14.04. Also i am a beginner with Ubuntu and everything on it. Everything was going great with a camera that has these parameters (from FFMPEG):

Input #0, rtsp, from 'rtsp://*private*:8900/live.sdp': 0B f=0/0 Metadata: title : RTSP server Stream #0:0: Video: h264 (Main), yuv420p(progressive), 352x192, 29.97 tbr, 90k tbn, 180k tbc

But then i changed to a newer camera, which has these parameters:

Input #0, rtsp, from 'rtsp://*private*/media/video2':0B f=0/0 Metadata: title : VCP IPC Realtime stream Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1280x720, 25 fps, 25 tbr, 90k tbn, 50 tbc

My C++ program uses OpenCV3 to process the stream. By default OpenCV uses ffmpeg to decode and display the stream with function VideoCapture.

VideoCapture vc;
vc.open(input_stream);
while ((vc >> frame), !frame.empty()) { *do work*
}

With the new camera stream i get errors like these (from ffmpeg):

[h264 @ 0x7c6980] cabac decode of qscale diff failed at 41 38
[h264 @ 0x7c6980] error while decoding MB 41 38, bytestream (3572)
[h264 @ 0x7c6980] left block unavailable for requested intra mode at 0 44
[h264 @ 0x7c6980] error while decoding MB 0 44, bytestream (4933)
[h264 @ 0x7bc2c0] SEI type 25 truncated at 208
[h264 @ 0x7bfaa0] SEI type 25 truncated at 206
[h264 @ 0x7c6980] left block unavailable for requested intra mode at 0 18
[h264 @ 0x7c6980] error while decoding MB 0 18, bytestream (14717)

The image sometimes is glitched, sometimes completely frozen. After a few seconds to a few minutes the stream freezes completely without an error. However on vlc it plays perfectly. I installed the newest version (3.2.2) of ffmpeg player with

./configure --enable-gpl --enable-libx264

Now playing directly with ffplay (instead of launching from source code with OpenCV function VideoCapture), the stream plays better, doesn't freeze, but sometimes still displays warnings:

[NULL @ 0x7f834c008c00] SEI type 25 size 896 truncated at 320=1/1 [h264 @ 0x7f834c0d5d20] SEI type 25 size 896 truncated at 319=1/1 [rtsp @ 0x7f834c0008c0] max delay reached. need to consume packet [rtsp @ 0x7f834c0008c0] RTP: missed 1 packets
[h264 @ 0x7f834c094740] concealing 675 DC, 675 AC, 675 MV errors in P frame
[NULL @ 0x7f834c008c00] SEI type 25 size 896 truncated at 320=1/1 

Changing the camera hardware is not an option. The camera can be set to encode to h265 or mjpeg. When encoding to mjpeg it can output 5 fps, which is not enough. Decoding to a static video is not an option either, because i need to display real time results about the stream. Here is a list of API backends that can be used in function VideoCapture. Maybe i should swithc to some other decoder and player? From my research i conclude that i have these options:

  • Somehow get OpenCV to use the ffmpeg player from another directory, where it is compiled with libx264

  • Somehow get OpenCV to use libVlc instead of ffmpeg

One example of switching to vlc is here, but i don't understand it well enough to say if that is what i need. Or maybe i should be parsing the stream in code? I don't rule out that this could be some basic problem due to a lack of dependencies, because, as i said, i'm a beginner with Ubuntu.

  • Use vlc to preprocess the stream, as suggested here.

This is probably slow, which again is bad for real time results.
Any suggestions and coments will be appreciated.

-- Here, here

avfilter/vf_psnr: add gray10 and gray12 support

$
0
0
avfilter/vf_psnr: add gray10 and gray12 support Signed-off-by: Paul B Mahol 
  • [DH] libavfilter/vf_psnr.c

avformat/img2dec: Remove dead code from psd_probe()

$
0
0
avformat/img2dec: Remove dead code from psd_probe() Fixes CID1397124 Signed-off-by: Michael Niedermayer 
  • [DH] libavformat/img2dec.c

Cannot decrypt HLS aes-128 video stream with ffmpeg

$
0
0

im trying to download and decrypt some video file. i have the keyfile and the manifest file but ffmpeg shows up this error:

Error when loading first segment 'http://212......m3u8: Invalid data found when processing input

here are the 2 files (key and manifest.m3u8) http://www.mediafire.com/file/q1t2bwijys9kzt3/manifest.m3u8http://www.mediafire.com/file/bsn9am2s89cqm4v/file.key

thanks!

-- http://212......m3u8, http://www.mediafire.com/file/q1t2bwijys9kzt3/manifest.m3u8, http://www.mediafire.com/file/bsn9am2s89cqm4v/file.key

avformat/mpegenc: Check for av_mallocz() failure

$
0
0
avformat/mpegenc: Check for av_mallocz() failure Fixes CID1257787 Signed-off-by: Michael Niedermayer 
  • [DH] libavformat/mpegenc.c

aac encoding with ffmpeg result in super short file

$
0
0

So I'm having problem with AAC encoding. I'm trying to encode some synthetic sound waves, but it does not work as expected. The file I get gives just a super short sound when played in VLC. When I play is in ffplay is plays like I expect, but it says "duration: 00:00:00.05" which I suppose says 5 ms. But I encode a lot more than that, and it played more. So VLC plays a super short sound, ffplay plays a longer file (the expected length), but displays it with super short duration, what's going on?

Source: http://pastebin.com/M5MKkEL3

One of the things that looks wrong to me is this: If you look for the variable "audio_time", if you breakpoint it and read it every encode frame, you will get this:

..
Encode frame 8: 0.00010416666666666666
Encode frame 9: 0.00012500000000000000
(and so on)

The diff is: ~0.00002085, which is a 1/1000 of a the diff I expected from ~47 samples frames per second, which is what the encoder wants with 48k sample rate (48k / 1024 = ~47).

So why do I get a thousand of the expected data encoded?

Feel free to point anything suspicious out!

Thanks in advance!

-- http://pastebin.com/M5MKkEL3

Facebook LIVE with ffmpeg error - av_interleaved_write_frame(): Connection reset by peer

$
0
0

I'm trying to stream to Facebook a Live Video from an Amazon EC2 instance (c4.xlarge). I installed ffmpeg and stream with a command like the following

ffmpeg -re -f concat -i /home/ec2-user/playlist.txt -f lavfi -re -i anullsrc=channel_layout=stereo:sample_rate=44100 -s 854x480 -c:a aac -strict -2 -ar 44100 -vcodec libx264 -f flv "{rtmp_link}"

Everything works fine. I had LIVE videos that worked for up to 2 days in a row. Sometimes, without a reason, I got one of these videos interrupted with this error message:

 av_interleaved_write_frame(): Connection reset by peer

I haven't been able to figure out a reason for this error yet. The funny thing is that maybe I have 3 streaming going on in the same machine at the same time, and just one of them get stopped by this message. Other times this error happens where there's just one streaming on the EC2 instance.

Any ideas about how to find a solution?

EDIT

We have installed a newer version of FFMPEG and the error now is more detailed. We have this message

 RTMP send error 104

I haven't found a lot about this issue online. Does someone know what error 104 means?

Anomalie #3881 (Nouveau): Constante _TRI_ARTICLES_RUBRIQUE

$
0
0

Tardivement...

En utilisant SPIP 3.0.24, la constante « *_TRI_ARTICLES_RUBRIQUE* » qui peut-être définie en surcharge dans mes_options.php ne semble avoir aucune incidence sur le tri dans l'espace privé. Après recherche elle n'apparait nulle part dans les scripts du noyau.
En revanche elle fonctionne bien sous SPIP 3.1.1. où elle est localisée dans le fichier prive/objets/liste/articles_fonctions.php

C'est aussi l'occasion d'apporter une correction à la documentation : http://www.spip.net/fr_article4633.html

Sur les 2 url présentes celle-ci est obsolète :
/?exec=naviguer&id_rubrique=xx

il convient de la remplacer par :
/?exec=rubrique&id_rubrique=xx

Dans l'exemple qui figure sur la documentation, il faudrait également indiquer que par défaut, l'absence d'option du sens de tri, situé après le paramètre du champs sql, correspond au filtre SQL ASC qu'il convient de ne pas mentionner au risque de provoquer une erreur dans le squelette privé.

Bien à vous.

Options for replacing RTMP for live streaming

$
0
0

I have a backend streaming video to web browsers using RTMP. On the browsers we use jwplayer. As everybody know flash player is going to be deprecated soon. Im looking for options to modify the backend using another streaming solution.

We have made some test using DASH but it has too much delay for live streamining compared to RTMP.

What are the options for anyone using RTMP ?

Restarting ffmpeg process using monit

$
0
0

I am trying to use monit for monitoring the ffmpeg process. For this I first created a bash script that has 3 arguments(start, stop and restart). When I run the script manually from the terminal (./thisBashScript start, ./thisBashScript stop and ./thisBashScript restart ) everything works perfectly how it was designed. The process starts, creates and saves the current procees id into a pid file. After if I want to stop the process it takes the current pid file and and kills the process with the given pid. Restarts also works fine, first it stops and after starts the process.

The problem

I installed monit for monitoring the process in case it goes down. I configured to check the process in the exact manner as I configured nginx that excellent works with monit.

After, when I start the process with the command ./thisBashScript start monit starts monitoring. In monit status the process ffmpeg is showing as running. After I kill the process manually using the pid of ffmpeg process to test if monit restarts the process, it fails to do so. Even though the new pid is created and saved in /var/run/ffmpeg.pid.

Here are the monit logs:

[EET Mar 21 12:12:37] error : 'ffmpeg' process is not running
[EET Mar 21 12:12:37] info : 'ffmpeg' trying to restart
[EET Mar 21 12:12:37] info : 'ffmpeg' start: /etc/init.d/iptv/thisBashScript

I have the following bash script:

 #!/bin/sh pid_file="/var/run/ffmpeg.pid" case "$1" in restart) /etc/init.d/iptv/thisBashScript stop /etc/init.d/iptv/thisBashScript start ;; start) rm $pid_file ffmpeg -i udp://@someIp:1234 -acodec libmp3lame -ac 1 -ar 44100 -ab 64k -s 640x360 -deinterlace -vcodec h264_qsv -vb 700k -f flv rtmp://someIp/applicationName/360 & ch_pid=$! echo "Start HLS: ffmpeg = $ch_pid"; echo $ch_pid > $pid_file ;; stop) echo "Stop transcoding"; kill `cat $pid_file` ;; *) echo "Usage: /etc/init.d/thisBashScript {start|stop|restart}" exit 1 ;; esac
exit 0
echo $pid_file

This bash script can accept 3 arguments (start, restart and stop)

  • start (it starts the ffmpeg command that streams a video on an nginx rtmp server);

  • stop (it stops the ffmpeg command);

  • restart (it stops and then starts ffmpeg command);

Here is my monit configuration

check process ffmpeg with pidfile /var/run/ffmpeg.pid start program = "/etc/init.d/iptv/thisBashScript start" stop program = "/etc/init.d/iptv/thisBashScript stop"

libav Windows static libraries

$
0
0

Does anybody know how can I build libav static libraries (.lib) for use them in my projects?

Error converting video with ffmpeg NReco wrapper library

$
0
0

I'm using NReco.VideoConverter for a video converting application. Now I'm trying to replace the audio in the source video for an mp3 track. I'm using this snippet from the official site: http://www.nrecosite.com/video_converter_net.aspx but I receiving this error:

audio.mp3: Invalid data found when processing input (exit code: 1)

var ffmpeg = new NReco.VideoConverter.FFMpegConverter();
ffmpeg.ConvertMedia("video.mp4", null, "output_video.mp4", null, new ConvertSettings() { AudioCodec = "copy", VideoCodec = "copy", CustomInputArgs = String.Format(" -i \"{0}\"", "audio.mp3"), CustomOutputArgs = " -map 0 -map 1",
});

I tried with different audio files but still the same scenario.

-- http://www.nrecosite.com/video_converter_net.aspx

Late reading with FFMPEG

$
0
0

I have 1 source broadcast. 2 ffmpeg is connecting to this source. But 1. ffmpeg needs to read another 7 seconds later. How can i achieve this. (I do not know english very well)

enter image description here

-- enter image description here

FFMPEG Live Stream Convertion

$
0
0

Is is possible for ffmpeg to convert a live stream mjpeg format to mp4 then pushes it to localhost or any server? I tried this using vlc using below command but it doesn't work

vlc http://[ip]:[port]/api/cameras/7589145c-cbb4-4ae0-98aa-74481b62b8a4/live :sout=#transcode{vcodec=h264,scale=Auto,acodec=mpga,ab=128,channels=2,samplerate=44100}:http{mux=ffmpeg{mux=mp4},dst=:8080/test.mp4} :sout-keep

how to combine several video random any one to create 1 new video? using ffmpeg?

$
0
0

how to combine several video random any one to create 1 new video? for example, I have 10 videos: 01.mp4; 02.mp4 ... 10.mp4 I want to combine random 5 of them to create 1 video example: (01.mp4+ 03.mp4+ 04.mp4+ 06.mp4 + 08.mp4) = 1 new video

(02.mp4+ 04.mp4+ 05.mp4+ 06.mp4 + 09.mp4) = 1 new video

Similar: random combination of 50 videos of 1000 videos to create 1 new video?

Add watermark to a video using ffmpeg in python

$
0
0

I want to add watermark for my video, with ffmpeg i found command:

ffmpeg -i input.mp4 -i watermark.png -filter_complex "overlay=1500:1000" output.mp4

But it run in cli, not in python code(i cannot found). So have anyway to embbeded it to python code(not call in subprocess)? edit: i found pyffmpeg but no guide to use it too.

Command-line streaming webcam with audio from Ubuntu server in WebM format

$
0
0

I am trying to stream video and audio from my webcam connected to my headless Ubuntu server (running Maverick 10.10). I want to be able to stream in WebM format (VP8 video + OGG). Bandwidth is limited, and so the stream must be below 1Mbps.

I have tried using FFmpeg. I am able to record WebM video from the webcam with the following:

ffmpeg -s 640x360 \
-f video4linux2 -i /dev/video0 -isync -vcodec libvpx -vb 768000 -r 10 -vsync 1 \
-f alsa -ac 1 -i hw:1,0 -acodec libvorbis -ab 32000 -ar 11025 \
-f webm /var/www/telemed/test.webm 

However despite experimenting with all manner of vsync and async options, I can either get out of sync audio, or Benny Hill style fast-forward video with matching fast audio. I have also been unable to get this actually working with ffserver (by replacing the test.webm path and filename with the relevant feed filename).

The objective is to get a live, audio + video feed which is viewable in a modern browser, in a tight bandwidth, using only open-source components. (None of that MP3 format legal chaff)

My questions are therefore: How would you go about streaming webm from a webcam via Linux with in-sync audio? What software you use?

Have you succeeded in encoding webm from a webcam with in-sync audio via FFmpeg? If so, what command did you issue?

Is it worth persevering with FFmpeg + FFserver, or are there other more suitable command-line tools around (e.g. VLC which doesn't seem too well built for encoding)?

Is something like Gstreamer + flumotion configurable from the command line? If so, where do I find command line documentation because flumotion doc is rather light on command line details?

Thanks in advance!

Anomalie #3882 (Nouveau): Ancres des notes de bas de page pour les URL arborescente

$
0
0

Lorsque les URL arborescentes sont activées, les ancres générées par Spip (donc, aussi des notes de bas de pages ) pointent vers l'URL de base.

Cela est dûà l'ajout de la balise "bsae href" dans le head
Dans ce cas, les ancres générées par Spip doivent donc pointer vers : #URL_SITE_SPIP/[ma_page]/#[mon_ancre]

Viewing all 118079 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>