
Recherche avancée
Médias (91)
-
Head down (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Echoplex (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Discipline (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Letting you (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
1 000 000 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
999 999 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (65)
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Dépôt de média et thèmes par FTP
31 mai 2013, parL’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...) -
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)
Sur d’autres sites (6440)
-
Nginx rtmp module - on_publish fires multiple time instead of once
29 juillet 2017, par Stephen WrightThis is copy and pasted from the bug report I created on the rtmp-module by Arut, I am not completely sure if it is a bug or me not understanding how the module works, I have read the whole directives of module as from https://github.com/arut/nginx-rtmp-module/wiki/Directives
Proper explanation, if code is not displayed properly I will edit and fix
Hi, been using the module and finding it very very good !
Think I have found a issue though, although it may be me misunderstanding the directives.
Essentially I wish to fire a script (/usr/local/bin/make_thumbnail.sh) which creates a thumbnail automatically from a stream (using ffmpeg), the idea is to have this done for every stream as soon as it is published in order to create a function a bit like twitch tv where the streamer will not have to specify any thumbnail image, authenticated users simply start a stream (which will later be authenticated but is not yet) The script does also write data into the database however this stage works fine and I don’t believe the issue is related, if I comment out these lines then the thumbnail creation still works and my issue continues.
Initially this was done using the "exec" command as I believe I mis-read the documentation and I believe the exec command doesn’t work for my problem as ". When publishing stops the process is terminated." does this mean it will continually execute until stream stops ?
I have started using the exec_publish command to try and fix this issue however the same issue seems to occur. The entire script repeats approximately every 15-17 seconds, a new thumbnail is created and a new database entry is create with all the correct information.
Below is the nginx.conf line. Please ignore if indentation is incorrect couldn’t see a way to indent blocks of code and it’s late here, assume all code is indented correctly unless you believe that could be the issue in which case I will post it indented as early as I can.
application live {
allow play all;
live on;
record all;
record_path /var/stream/video_recordings/;
record_unique on;
hls on;
hls_nested on;
hls_path /var/stream/HLS/live;
hls_fragment 10s;
#on publish create thumbnail using first second of stream and save in
/var/stream/video_recordings/thumbnails
exec_publish usr/local/bin/make_thumbnail.sh $name;The rest can be pasted or attached if needed but is working nginx config for rtmp + website
The most simple version of the make_thumbnail..sh is pasted below, I have omitted the variables that I have used for database entryys obviously but as the script works without fail from terminal I believe this to be an nginx issue (if I run the command manually under the nginx user e.g. sudo -u nginx /usr/local/bin/make_thumbnail.sh with a name the same as any running stream, it works and only executes once as would expect, all permissions in script are ok and tested.
make_thumbnail.sh
#!/bin/bash
TIME=$(date +%s)
NAME=$1
echo "time: "
FILENAME=${TIME}_${NAME}
ffmpeg -i rtmp://192.168.0.98:1935/live/$1 -vframes 1 -s 150x150 -ss 10 -
strftime 1 /var/stream/video_recordings/thumbnails/"$FILENAME.jpg";
#Writes path to video into database
mysql --user=$DB_USER --password=$DB_PASSWD $DB_NAME << EOF
INSERT INTO $TABLE3 (thumbnailfile) VALUES ('$FILENAME');
set @last_id_in_thumbnails = LAST_INSERT_ID();
INSERT INTO $TABLE (created_at, updated_at, thumnailID) VALUES
(NOW(),NOW(),@last_id_in_thumbnails);
SET @last_id_in_livestreams = LAST_INSERT_ID();
INSERT INTO $TABLE2 (created_at, updated_at, filename,liveID) VALUES
(NOW(),NOW(),'$FILENAME',@last_id_in_livestreams);
EOFI have not got the nginx rtmp logs installed, I can obviously do this however some of the logs appear in the nginx error.log, strangely the latest stream I tried did not update in the access log, however I think this is because I did not attempt to connect to it via any method. I don’t fully understand the error.log, in my stupidity I decided to use nginx with which I am quite inexperienced and I am finding it very difficult to troubleshoot this issue, it appears to me that as part of the RTMP protocol or my streaming software (OBS) is either directly pinging the rtmp stream or is being pinged by the server to ensure the connection is still there. And this ping is
I have left a stream running from approx 4 minutes without interacting with the server, streaming software, computer running the stream, I have ensured the internet connection is constant as my first though was the connection dropped, however on inspecting the database the executing is done always after at least 11 seconds however usually this is 16, I can’t seem to figure out how to select the closest dates from the database however there has been at least a few 17 second differences (potentially when
I am unsure if this is an issue or if it is intended behavior but I do require this to finish a university degree, I’m not asking for answers but if it is a legitimate issue then I would be happy to spend as much time I can commit to it if some insight into what is causing it, or if there is a workaround I believe it should be documented somewhere, I have googled into making any exec commands run only once on publishI can’t seem to pinpoint where in the log the issue is happening however think it is something to do with the below exceprts I would attach the file but can’t seem to select all lines after the timestamp upon starting a stream
2017/07/26 18:17:35 [info] 1451#0: *2229 exec: starting managed child
'ffmpeg', client: 192.168.0.78, server: 0.0.0.0:1935
2017/07/26 18:17:35 [info] 1451#0: *2412 client connected '192.168.0.98'
2017/07/26 18:17:35 [info] 1451#0: *2412 connect: app='live' args=''
flashver='LNX 9,0,124,2' swf_url='' tc_url='rtmp://192.168.0.98:1935/live'
page_url='' acodecs=4071 vcodecs=252 object_encoding=0, client:
192.168.0.98, server: 0.0.0.0:1935
2017/07/26 18:17:35 [info] 1451#0: *2412 createStream, client: 192.168.0.98,
server: 0.0.0.0:1935
2017/07/26 18:17:35 [info] 1451#0: *2412 play: name='newname' args=''
start=-2000 duration=0 reset=0 silent=0, client: 192.168.0.98, server:
0.0.0.0:1935
2017/07/26 18:17:36 [info] 1451#0: *2410 recv() failed (104: Connection
reset by peer), client: 192.168.0.98, server: 0.0.0.0:1935
2017/07/26 18:17:36 [info] 1451#0: *2410 disconnect, client: 192.168.0.98,
server: 0.0.0.0:1935
2017/07/26 18:17:36 [info] 1451#0: *2410 deleteStream, client: 192.168.0.98,
server: 0.0.0.0:1935
2017/07/26 18:17:36 [notice] 1451#0: signal 17 (SIGCHLD) received
2017/07/26 18:17:36 [notice] 1451#0: unknown process 10487 exited with code
0
2017/07/26 18:17:36 [info] 1451#0: *2229 exec: child 10487 exited; ignoring,
client: 192.168.0.78, server: 0.0.0.0:1935
ver: 0.0.0.0:1935
2017/07/26 18:17:41 [info] 1451#0: *2229 exec: starting managed child
'usr/local/bin/make_thumbnail.sh', client: 192.168.0.78, server:
0.0.0.0:1935
2017/07/26 18:17:41 [info] 1451#0: *2413 client connected '192.168.0.98'
2017/07/26 18:17:41 [info] 1451#0: *2413 connect: app='live' args=''
flashver='LNX 9,0,124,2' swf_url='' tc_url='rtmp://192.168.0.98:1935/live'
page_url='' acodecs=4071 vcodecs=252 object_encoding=0, client:
192.168.0.98,
server: 0.0.0.0:1935
2017/07/26 18:17:41 [info] 1451#0: *2413 createStream, client: 192.168.0.98,
server: 0.0.0.0:1935
2017/07/26 18:17:41 [info] 1451#0: *2413 play: name='newname' args=''
start=-2000 duration=0 reset=0 silent=0, client: 192.168.0.98, server:
0.0.0.0:1935
2017/07/26 18:17:43 [info] 1451#0: *2229 exec: starting managed child
'ffmpeg',
client: 192.168.0.78, server: 0.0.0.0:1935
2017/07/26 18:17:43 [info] 1451#0: *2414 client connected '192.168.0.98'
2017/07/26 18:17:43 [info] 1451#0: *2414 connect: app='live' args=''
flashver='LNX 9,0,124,2' swf_url='' tc_url='rtmp://192.168.0.98:1935/live'
page_url='' acodecs=4071 vcodecs=252 object_encoding=0, client:
192.168.0.98,
server: 0.0.0.0:1935
@ -
Monit not restarting ffmpeg live stream when disconnected
21 juillet 2017, par digibreadNo matter what I try I cannot get Monit to restart my ffmpeg live stream even though my bash script works from the command line. I start the ffmpeg live stream and all is working. Monit status shows that is ffmpeg is running. I then reboot the camera and the connection is lost, Monit tries to start it with the log file entries below. the config files.
Here is my setup. Any help is greatly appreciated.Monit Status
Process 'ffmpeg'
status Running
monitoring status Monitored
monitoring mode active
on reboot start
pid 17349
parent pid 1
uid 0
effective uid 0
gid 0
uptime 0m
threads 1
children 0
cpu 0.0%
cpu total 0.0%
memory 8.3% [40.4 MB]
memory total 8.3% [40.4 MB]
port response time -
data collected Fri, 21 Jul 2017 15:36:31My bash file in /etc/init.d/monitoring1.sh
#!/bin/bash
pid_file="/var/run/ffmpeg.pid"
case "$1" in
restart)
/etc/init.d/monitoring1.sh stop
/etc/init.d/monitoring1.sh start
;;
start)
rm $pid_file
/usr/bin/ffmpeg -timeout -1 -i rtsp://user:pw@mydomain:port/h264Preview_01_sub http://localhost:8090/monitoring1.ffm &
ch_pid=$!
echo "Start Monitoring1: ffmpeg = $ch_pid";
echo $ch_pid > $pid_file
;;
stop)
echo "Stop ffmpeg Monitoring1";
kill `cat $pid_file` &> /dev/null
;;
*)
echo "Usage: /etc/init.d/streambash.sh {start|stop|restart}"
exit 1
;;
esac
exit 0
echo $pid_fileMy /etc/monit/conf-available/ffmpeg
check process ffmpeg with pidfile /var/run/ffmpeg.pid
group nogroup
start program = "/bin/bash /etc/init.d/monitoring1.sh start"
stop program = "/bin/bash /etc/init.d/monitoring1.sh stop"
if failed host localhost port 8090 type tcp with timeout 15 seconds for 5 cycles
then restart/var/log/monit.log
[UTC Jul 21 15:36:31] info : 'ffmpeg' process is running with pid 17349
[UTC Jul 21 15:36:31] debug : 'ffmpeg' zombie check succeeded
[UTC Jul 21 15:36:31] debug : 'ffmpeg' connection test paused for 13 s while the process is starting
[UTC Jul 21 15:37:01] debug : 'ffmpeg' process is running with pid 17349
[UTC Jul 21 15:37:01] debug : 'ffmpeg' zombie check succeeded
[UTC Jul 21 15:37:01] debug : 'ffmpeg' succeeded testing protocol [DEFAULT] at [localhost]:8090 [TCP/IP] [response time 1.152 ms]
[UTC Jul 21 15:37:01] debug : 'ffmpeg' connection succeeded to [localhost]:8090 [TCP/IP]
[UTC Jul 21 15:43:02] debug : 'ffmpeg' process test failed [pid=17349] -- No such process
[UTC Jul 21 15:43:02] error : 'ffmpeg' process is not running
[UTC Jul 21 15:43:02] info : 'ffmpeg' trying to restart
[UTC Jul 21 15:43:02] debug : 'ffmpeg' process test failed [pid=17349] -- No such process
[UTC Jul 21 15:43:02] debug : 'ffmpeg' process test failed [pid=17349] -- No such process
[UTC Jul 21 15:43:02] info : 'ffmpeg' start: '/bin/bash /etc/init.d/monitoring1.sh start'
[UTC Jul 21 15:43:02] debug : Start Monitoring1: ffmpeg = 17421
[UTC Jul 21 15:43:02] debug : 'ffmpeg' started
[UTC Jul 21 15:43:32] debug : 'ffmpeg' process test failed [pid=17421] -- No such process
[UTC Jul 21 15:43:32] error : 'ffmpeg' process is not running
[UTC Jul 21 15:43:32] info : 'ffmpeg' trying to restart
[UTC Jul 21 15:43:32] debug : 'ffmpeg' process test failed [pid=17421] -- No such process
[UTC Jul 21 15:43:32] debug : 'ffmpeg' process test failed [pid=17421] -- No such process
[UTC Jul 21 15:43:32] info : 'ffmpeg' start: '/bin/bash /etc/init.d/monitoring1.sh start'
[UTC Jul 21 15:43:32] debug : Start Monitoring1: ffmpeg = 17430
[UTC Jul 21 15:43:32] debug : 'ffmpeg' started
[UTC Jul 21 15:44:02] debug : 'ffmpeg' process test failed [pid=17430] -- No such process
[UTC Jul 21 15:44:02] error : 'ffmpeg' process is not running
[UTC Jul 21 15:44:02] info : 'ffmpeg' trying to restart
[UTC Jul 21 15:44:02] debug : 'ffmpeg' process test failed [pid=17430] -- No such process
[UTC Jul 21 15:44:02] debug : 'ffmpeg' process test failed [pid=17430] -- No such process
[UTC Jul 21 15:44:02] info : 'ffmpeg' start: '/bin/bash /etc/init.d/monitoring1.sh start'
[UTC Jul 21 15:44:02] debug : Start Monitoring1: ffmpeg = 17436
[UTC Jul 21 15:44:02] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:03] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:03] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:04] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:05] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:06] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:07] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:08] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:09] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:10] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:11] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:12] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:13] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:14] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:15] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:16] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:17] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:18] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:19] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:20] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:21] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:22] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:23] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:24] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:25] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:26] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:27] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:28] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:29] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:30] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:31] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:32] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:44:32] error : 'ffmpeg' failed to start (exit status 0) -- '/bin/bash /etc/init.d/monitoring1.sh start': Start Monitoring1: ffmpeg = 17436
[UTC Jul 21 15:45:02] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:45:02] error : 'ffmpeg' process is not running
[UTC Jul 21 15:45:02] info : 'ffmpeg' trying to restart
[UTC Jul 21 15:45:02] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:45:02] debug : 'ffmpeg' process test failed [pid=17436] -- No such process
[UTC Jul 21 15:45:02] info : 'ffmpeg' start: '/bin/bash /etc/init.d/monitoring1.sh start'
[UTC Jul 21 15:45:03] debug : Start Monitoring1: ffmpeg = 17448
[UTC Jul 21 15:45:03] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:03] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:03] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:04] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:06] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:07] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:08] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:09] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:10] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:11] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:12] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:13] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:14] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:15] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:16] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:17] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:18] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:19] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:20] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:21] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:22] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:23] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:24] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:25] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:26] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:27] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:28] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:29] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:30] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:31] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:32] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:33] debug : 'ffmpeg' process test failed [pid=17448] -- No such process
[UTC Jul 21 15:45:33] error : 'ffmpeg' failed to start (exit status 0) -- '/bin/bash /etc/init.d/monitoring1.sh start': Start Monitoring1: ffmpeg = 17448 -
ffmpeg run from shell runs properly, but does not when called from within .NET
2 juillet 2013, par BevinI'm attempting to use ffmpeg (compiled on Windows with Cygwin) in a C# program, by using the
Process
class to spawn an ffmpeg instance. However, I've hit a rather odd bug that doesn't make much sense.When I run ffmpeg directly from a shell (be it Cygwin's bash, PowerShell, cmd), ffmpeg can properly decode and reencode files without any issues :
PS C:\audio> ffmpeg -i .\sound1.wav -acodec libvorbis -f ogg abc.ogg
ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers
built on Apr 8 2013 15:10:40 with gcc 4.5.3 (GCC)
configuration: --disable-encoder=vorbis --enable-libvorbis
libavutil 52. 18.100 / 52. 18.100
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.104 / 54. 63.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 42.103 / 3. 42.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
[wav @ 0x800538a0] max_analyze_duration 5000000 reached at 5015510 microseconds
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from '.\sound1.wav':
Metadata:
encoder : Lavf54.63.104
Duration: 00:00:05.76, bitrate: 1411 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Output #0, ogg, to 'abc.ogg':
Metadata:
encoder : Lavf54.63.104
Stream #0:0: Audio: vorbis, 44100 Hz, stereo, fltp
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le -> libvorbis)
Press [q] to stop, [?] for help
size= 55kB time=00:00:05.74 bitrate= 78.5kbits/s
video:0kB audio:51kB subtitle:0 global headers:4kB muxing overhead 0.817473%The file plays fine, and I can encode to WAV or any other format I like. However, when I call ffmpeg from C# with the following code :
string tempfile = Path.GetTempFileName();
FileStream tempfilestr = File.OpenWrite(tempfile);
input.CopyTo(tempfilestr);
ProcessStartInfo pstart = new ProcessStartInfo("ffmpeg", string.Format("-i \"{0}\" -v verbose -y -f wav -", tempfile));
pstart.CreateNoWindow = true;
pstart.ErrorDialog = false;
pstart.RedirectStandardOutput = true;
pstart.RedirectStandardError = true;
pstart.UseShellExecute = false;
Process proc = new Process();
proc.StartInfo = pstart;
proc.Start();
StreamReader stdout = proc.StandardOutput;
StreamReader stderr = proc.StandardError;
outtempfilestr = File.OpenRead(outtempfile);
MemoryStream output = new MemoryStream();
stdout.BaseStream.CopyTo(output);
try {
proc.Kill();
}
catch(InvalidOperationException) { }
catch(Win32Exception) { }
File.Delete(tempfile);
return output.ToArray();This randomly produces errors in the output :
ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers
built on Apr 8 2013 15:10:40 with gcc 4.5.3 (GCC)
configuration: --disable-encoder=vorbis --enable-libvorbis
libavutil 52. 18.100 / 52. 18.100
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.104 / 54. 63.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 42.103 / 3. 42.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
[wav @ 0x80053860] parser not found for codec pcm_s16le, packets or times may be invalid.
Last message repeated 1 times
[wav @ 0x80053860] max_analyze_duration 5000000 reached at 5015510 microseconds
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'C:\Users\Bevin\AppData\Local\Temp\tmp1CCE.tmp':
Duration: 00:00:05.20, bitrate: 1411 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
[graph 0 input from stream 0:0 @ 0x8011f320] tb:1/44100 samplefmt:s16 samplerate:44100 chlayout:0x3
Output #0, wav, to 'pipe:':
Metadata:
ISFT : Lavf54.63.104
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le -> pcm_s16le)
Press [q] to stop, [?] for help
Multiple frames in a packet from stream 0
[pcm_s16le @ 0x8005c160] Invalid PCM packet, data has size 3 but at least a size of 4 was expected
Error while decoding stream #0:0: Invalid data found when processing input
No more output streams to write to, finishing.
size= 896kB time=00:00:05.20 bitrate=1411.3kbits/s
video:0kB audio:896kB subtitle:0 global headers:0kB muxing overhead 0.008719%Note that these errors don't always occur. Sometimes they happen for certain files, sometimes they don't. I've tried various combinations of stream redirects and temp files, none of them work. I've also verified the integrity of the temp files, and it all checks out. I've even extracted the temp file before it was deleted, and decoded it in shell without a hitch.
Any ideas ?
Edit : I've tried running ffmpeg from a shell script that's run through C#. It gives the same issues. Compiling ffmpeg via MinGW gives the same issue as well.