
Recherche avancée
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 (5515)
-
"File descriptor in bad state" error while running ffmpeg on android device and selecting an input device
25 août 2012, par user1545779Below is the output of the ffmpeg command :# ./ffmpeg -y -f s16le -i /dev/snd/pcmC3D0c 1640.wmv -to create an audio file from a Logitech webcam on an android device.
As shown in the output, I received a File descriptor in bad state error for referring to the mic input as /dev/snd/pcmC3D0c I determined the value of the device (webcam mic) by reviewing the contents of /proc/asound. The webcam mic was card3 and its STREAM0 file indicated that the mic has an audio format of format S16_LE
It was also confirmed that it is a capture device and its' pcm id was pcmC3D0c (C3 being the card number and D0 being the Device number. I then confirmed the correct device by checking the /dev/snd/ directory to confirm its proper and full description. The /dev/snd folder confirmed that the mic was /dev/snd/pcmC3D0c
I then checked the permissions and ownership to make sure that I could use that device. Hence as far as identifying the correct device to used I do believe that /dev/snd/pcmC3D0c is the correct device. I do believe this error could possibly have something to do with the OS, however after all these checks, I still cannot figure out what is giving the bad file descriptor state error.
Please note that I tested for different output formats, etc and that did not make any difference. Any leads or suggestions ?
# ./ffmpeg -y -f s16le -i /dev/snd/pcmC3D0c 1640.wmv
ffmpeg version N-43170-gd84dd35 Copyright (c) 2000-2012 the FFmpeg developers
built on Aug 24 2012 09:16:05 with gcc 4.4.3 (GCC) configuration : —enable-cross-compile —arch=arm —cpu=cortex-a9 —target-os=linux —enable-runtime-cpudetect —prefix=/output —enable-pic —cross-prefix=/home/jasongipsyblues/Desktop/apps/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- —sysroot=/home/jasongipsyblues/Desktop/apps/android-ndk-r8b/platforms/android-14/arch-arm —enable-version3 —enable-gpl —enable-memalign-hack —disable-doc —enable-yasm —enable-libx264 —enable-zlib —extra-cflags=-I../x264 —extra-ldflags='-L../x264 -lc'libavutil 51. 66.100 / 51. 66.100
libavcodec 54. 48.100 / 54. 48.100
libavformat 54. 22.100 / 54. 22.100
libavdevice 54. 2.100 / 54. 2.100
libavfilter 3. 5.102 / 3. 5.102
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100[s16le @ 0xfd84f0] Invalid sample rate 0 specified using default of 44100
[s16le @ 0xfd84f0] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, s16le, from '/dev/snd/pcmC3D0c' :
Duration : N/A, bitrate : 705 kb/s
Stream #0:0 : Audio : pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
Output #0, asf, to '1640.wmv' :
Metadata :
WM/EncodingSettings : Lavf54.22.100
Stream #0:0 : Audio : wmav2 (a[1][0][0] / 0x0161), 44100 Hz, mono, s16, 128 kb/s
Stream mapping :
Stream #0:0 -> #0:0 (pcm_s16le -> wmav2)
Press [q] to stop, [?] for help
/dev/snd/pcmC3D0c : File descriptor in bad state
size= 1kB time=00:00:00.00 bitrate= 0.0kbits/s
video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead 5340.000000% -
Raspberry Pi 4 live streaming with ffmpeg [closed]
12 décembre 2019, par BerriSo speedify created a blog post and youtube video about making an IRL streaming backpack using the Elgato Cam Link 4k, Raspberry Pi 4, and ffmpeg.
They gave pretty detailed instructions, and included downloads to prebuilt scripts/commands to get it all running once put together.
Blog post :
https://speedify.com/blog/how-to/build-irl-streaming-backpack-complete-guide/ffmpeg command from post :
ffmpeg_command = “/home/pi/bin/ffmpeg -nostdin -re -f v4l2 -s ‘1280×720’ -framerate 24 -i /dev/video0 -f alsa -ac 2 -i hw:CARD=Link,DEV=0 -vcodec libx264 -framerate 24 -rtbufsize 1500k -s 1280×720 -preset ultrafast -pix_fmt yuv420p -crf 17 -force_key_frames ‘expr:gte(t,n_forced*2)’ -minrate 850k -maxrate 1000k -b:v 1000k -bufsize 1000k -acodec libmp3lame -rtbufsize 1500k -b 96k -ar 44100 -f flv – | ffmpeg -f flv -i – -c copy -f flv -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 1 rtmp://live.twitch.tv/app/live_” + streamKey + “‘\n”
I replaced
-i hw:card=link,dev=0
in that command with-i hw:2,0
because-i hw:card=link,dev=0
gave me "file does not exist" errors in the log. "streamkey" is filled with the appropriate key for my twitch.Github Resources + Instructions used :
https://github.com/speedify/rpi-streaming-experimentI’m using all the exact same hardware as outlined in the post, and have gotten everything installed correctly as far as I can tell.
But when I go to run the ffmpeg command, it seems like nothing actually gets sent over to twitch correctly.The log after trying to run it looks like this.
If anybody has any insight as to what may be going wrong, it would be greatly appreciated.Starting ffmpeg
ffmpeg version N-95970-gd5274f8 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8 (Raspbian 8.3.0-6+rpi1)
configuration: --prefix=/home/pi/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/pi/ffmpeg_build/include --extra-ldflags=-L/home/pi/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/pi/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
libavutil 56. 36.101 / 56. 36.101
libavcodec 58. 64.101 / 58. 64.101
ffmpeg version N-95970-gd5274f8 libavformat 58. 35.101 / 58. 35.101
Copyright (c) 2000-2019 the FFmpeg developers libavdevice 58. 9.101 / 58. 9.101
libavfilter 7. 67.100 / 7. 67.100
built with gcc 8 (Raspbian 8.3.0-6+rpi1)
libswscale 5. 6.100 / 5. 6.100
configuration: --prefix=/home/pi/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/pi/ffmpeg_build/include --extra-ldflags=-L/home/pi/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/pi/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
libavutil 56. 36.101 / 56. 36.101
libavcodec 58. 64.101 / 58. 64.101
libavformat 58. 35.101 / 58. 35.101
libavdevice 58. 9.101 / 58. 9.101
libavfilter 7. 67.100 / 7. 67.100
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
[video4linux2,v4l2 @ 0x2aac5e0] The V4L2 driver changed the video from 1280x720 to 1920x1080
[video4linux2,v4l2 @ 0x2aac5e0] The driver changed the time per frame from 1/24 to 117/7013
[video4linux2,v4l2 @ 0x2aac5e0] Dequeued v4l2 buffer contains 4147200 bytes, but 3110400 were expected. Flags: 0x00012001.
Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 4683.201589, bitrate: 1491503 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080, 1491503 kb/s, 59.94 fps, 59.94 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:2,0':
Duration: N/A, start: 1576099663.557438, bitrate: 1536 kb/s
Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Please use -b:a or -b:v, -b is ambiguous
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Stream #1:0 -> #0:1 (pcm_s16le (native) -> mp3 (libmp3lame))
[video4linux2,v4l2 @ 0x2aac5e0] Dequeued v4l2 buffer contains 4147200 bytes, but 3110400 were expected. Flags: 0x00012001.
Last message repeated 9 times
[video4linux2,v4l2 @ 0x2aac5e0] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
[video4linux2,v4l2 @ 0x2aac5e0] Dequeued v4l2 buffer contains 4147200 bytes, but 3110400 were expected. Flags: 0x00012001.
Last message repeated 28 times
terminated script
pipe:: could not find codec parameters
Exiting normally, received signal 15.
Last message repeated 15 times
[alsa @ 0x2aaf2c0] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
Finishing stream 0:0 without any data written to it.
[libx264 @ 0x2abee40] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x2abee40] profile Constrained Baseline, level 3.2, 4:2:0, 8-bit
[libx264 @ 0x2abee40] 264 - core 158 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc_lookahead=0 rc=crf mbtree=0 crf=17.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1000 vbv_bufsize=1000 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=0
Finishing stream 0:1 without any data written to it.
Output #0, flv, to 'pipe:':
Metadata:
encoder : Lavf58.35.101
Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 1280x720, q=-1--1, 96 kb/s, 59.94 fps, 1k tbn, 59.94 tbc
Metadata:
encoder : Lavc58.64.101 libx264
Side data:
cpb: bitrate max/min/avg: 1000000/0/96000 buffer size: 1000000 vbv_delay: N/A
Stream #0:1: Audio: mp3 (libmp3lame) ([2][0][0][0] / 0x0002), 44100 Hz, stereo, s16p
Metadata:
encoder : Lavc58.64.101 libmp3lame
[flv @ 0x2abda90] Failed to update header with correct duration.
[flv @ 0x2abda90] Failed to update header with correct filesize.
Error writing trailer of pipe:: Broken pipe
frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=00:00:00.00 bitrate=N/A speed= 0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Exiting normally, received signal 15.This message repeats until script is terminated with the Circuit Express button. For length, many instances of this line were cut out.
[video4linux2,v4l2 @ 0x2aac5e0] Dequeued v4l2 buffer contains 4147200
bytes, but 3110400 were expected. Flags: 0x00012001.
Last message repeated xx timesOutput from
v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'YUYV' (YUYV 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.017s (59.940 fps)
[1]: 'NV12' (Y/CbCr 4:2:0)
Size: Discrete 1920x1080
Interval: Discrete 0.017s (59.940 fps)
[2]: 'YU12' (Planar YUV 4:2:0)
Size: Discrete 1920x1080
Interval: Discrete 0.017s (59.940 fps)Log output after ffmpeg command modification.
Starting ffmpeg
ffmpeg version N-95970-gd5274f8 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8 (Raspbian 8.3.0-6+rpi1)
configuration: --prefix=/home/pi/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/pi/ffmpeg_build/include --extra-ldflags=-L/home/pi/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/pi/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
libavutil 56. 36.101 / 56. 36.101
libavcodec 58. 64.101 / 58. 64.101
libavformat 58. 35.101 / 58. 35.101
libavdevice 58. 9.101 / 58. 9.101
libavfilter 7. 67.100 / 7. 67.100
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
terminated script
Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, bitrate: 1491503 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080, 1491503 kb/s, 59.94 fps, 59.94 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:1,0':
Duration: N/A, bitrate: 1536 kb/s
Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[rtmp @ 0x2605cd0] Cannot open connection tcp://live.twitch.tv:1935
rtmp://live.twitch.tv/app/live: Immediate exit requested
Exiting normally, received signal 15. -
cv::cudacodec::VideoReader unable to Play rtsp stream
22 février 2018, par PawanSystem information
- OpenCV => 3.3.0
- Operating System / Platform => Ubuntu 16.04, x86_64
- Compiler => gcc version 5.4.1 20160904
- Cuda => 8.0
- Nvidia card => GTX 1080 Ti
- ffmpeg details
- libavutil 55. 74.100 / 55. 74.100
- libavcodec 57.103.100 / 57.103.100
- libavformat 57. 77.100 / 57. 77.100
- libavdevice 57. 7.101 / 57. 7.101
- libavfilter 6.100.100 / 6.100.100
- libswscale 4. 7.103 / 4. 7.103
- libswresample 2. 8.100 / 2. 8.100
Detailed description
i am trying to play a rtsp stream using
cudacodec::VideoReader
Rtsp Stream Details ( from vlc )
this stream plays fine in vlc and
cv::VideoCapture
but when i try to play it incudacodec::VideoReader
i get a error saying :OpenCV Error: Gpu API call (CUDA_ERROR_FILE_NOT_FOUND [Code = 301]) in CuvidVideoSource, file /home/deep/Development/libraries/opencv/opencv/modules/cudacodec/src/cuvid_video_source.cpp, line 66
OpenCV Error: Assertion failed (init_MediaStream_FFMPEG()) in FFmpegVideoSource, file /home/deep/Development/libraries/opencv/opencv/modules/cudacodec/src/ffmpeg_video_source.cpp, line 101
Steps to reproduce
#include <iostream>
#include "opencv2/opencv_modules.hpp"
#if defined(HAVE_OPENCV_CUDACODEC)
#include <opencv2></opencv2>core.hpp>
#include <opencv2></opencv2>cudacodec.hpp>
#include <opencv2></opencv2>highgui.hpp>
int main(int argc, const char* argv[])
{
const std::string fname = "rtsp://admin:admin@192.168.1.13/media/video2";
cv::namedWindow("GPU", cv::WINDOW_NORMAL);
cv::cuda::GpuMat d_frame;
cv::Ptr d_reader = cv::cudacodec::createVideoReader(fname);
for (;;)
{
if (!d_reader->nextFrame(d_frame))
break;
cv::Mat frame;
d_frame.download(frame);
cv::imshow("GPU", frame);
if (cv::waitKey(3) > 0)
break;
}
return 0;
}
#else
int main()
{
std::cout << "OpenCV was built without CUDA Video decoding support\n" << std::endl;
return 0;
}
#endif
</iostream>I tried debugging it using GDB and saw that in
ffmpeg_video_source.cpp
bool init_MediaStream_FFMPEG()
directly returns without checking the if condition.GDB output
cv::cudacodec::detail::FFmpegVideoSource::FFmpegVideoSource
(this=0x402a20 <_start>, fname=...) at /home/deep/Development/libraries/opencv/opencv/modules/cudacodec/src/ffmpeg_video_source.cpp:98
98 cv::cudacodec::detail::FFmpegVideoSource::FFmpegVideoSource(const String& fname) :
(gdb) n
99 stream_(0)
(gdb) n
101 CV_Assert( init_MediaStream_FFMPEG() );
(gdb) s
(anonymous namespace)::init_MediaStream_FFMPEG () at /home/deep/Development/libraries/opencv/opencv/modules/cudacodec/src/ffmpeg_video_source.cpp:94
94 return initialized;
(gdb) display initialized
4: initialized = false
(gdb) s
95 }UPDATE :
I have solved the problem. solution link