
Recherche avancée
Autres articles (42)
-
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...) -
(Dés)Activation de fonctionnalités (plugins)
18 février 2011, parPour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...) -
Soumettre bugs et patchs
10 avril 2011Un logiciel n’est malheureusement jamais parfait...
Si vous pensez avoir mis la main sur un bug, reportez le dans notre système de tickets en prenant bien soin de nous remonter certaines informations pertinentes : le type de navigateur et sa version exacte avec lequel vous avez l’anomalie ; une explication la plus précise possible du problème rencontré ; si possibles les étapes pour reproduire le problème ; un lien vers le site / la page en question ;
Si vous pensez avoir résolu vous même le bug (...)
Sur d’autres sites (7537)
-
ffmpeg rtsp record problems [closed]
3 mai 2023, par user429643I have 3 ip cameras from which I take rtsp stream and record mp4 files via ffmpeg. Previously, everything worked well, but some time ago, the recording from second camera ends after a some period of time (before it should be ended).
Program code :


if [ "$1" = "1" ]; then
 ffmpeg -rtsp_transport tcp -use_wallclock_as_timestamps 1 -fflags +genpts -fflags -discardcorrupt -i rtsp://$CAMLogin@$CAM1IP:$RTSPport/Streaming/Channels/101 -r 20 -vcodec copy -an -t $RECtime -vsync vfr $FULLpath/1.mp4 -report null >/dev/null 2>$FULLpath/cam01.log &
 ffmpeg -i rtsp://$CAMLogin@$CAM1IP:$RTSPport/Streaming/Channels/101 -t 1 -vframes 1 -s 1280x720 -f image2 $FULLpath/1.jpg null >/dev/null 2>$FULLpath/cam_jpg01.log &
fi

if [ "$2" = "1" ]; then
 ffmpeg -rtsp_transport tcp -use_wallclock_as_timestamps 1 -fflags +genpts -fflags -discardcorrupt -i rtsp://$CAMLogin@$CAM2IP:$RTSPport/cam/realmonitor?channel=1&subtype=0 -r 20 -vcodec copy -an -t $RECtime -vsync vfr $FULLpath/2.mp4 -report null >/dev/null 2>$FULLpath/cam02.log &
 ffmpeg -i $CENTRAL -t 1 -vframes 1 -s 1280x720 -f image2 $FULLpath/2.jpg null >/dev/null 2>$FULLpath/cam_jpg02.log &
fi

if [ "$3" = "1" ]; then
 ffmpeg -rtsp_transport tcp -use_wallclock_as_timestamps 1 -fflags +genpts -fflags -discardcorrupt -i rtsp://$CAMLogin@$CAM3IP:$RTSPport/Streaming/Channels/101 -r 20 -vcodec copy -an -t $RECtime -vsync vfr $FULLpath/3.mp4 -report null >/dev/null 2>$FULLpath/cam03.log &
 ffmpeg -i rtsp://$CAMLogin@$CAM3IP:$RTSPport/Streaming/Channels/101 -t 1 -vframes 1 -s 1280x720 -f image2 $FULLpath/3.jpg null >/dev/null 2>$FULLpath/cam_jpg03.log &



If I set a certain recording time, then the problem occurs only from the second camera.


FFMPEG log for first camera :


ffmpeg started on 2023-05-03 at 12:04:01
Report written to "ffmpeg-20230503-120401.log"
ffmpeg version 2.8.14-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
 built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609
 configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
 libavutil 54. 31.100 / 54. 31.100
 libavcodec 56. 60.100 / 56. 60.100
 libavformat 56. 40.101 / 56. 40.101
 libavdevice 56. 4.100 / 56. 4.100
 libavfilter 5. 40.101 / 5. 40.101
 libavresample 2. 1. 0 / 2. 1. 0
 libswscale 3. 1.101 / 3. 1.101
 libswresample 1. 2.101 / 1. 2.101
 libpostproc 53. 3.100 / 53. 3.100
Input #0, rtsp, from 'rtsp://username:password@192.168.8.98:554/Streaming/Channels/101':
 Metadata:
 title : Media Presentation
 Duration: N/A, start: 1683104641.578533, bitrate: N/A
 Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 20 fps, 20 tbr, 90k tbn, 40 tbc
[mp4 @ 0x23f8d80] Codec for stream 0 does not use global headers but container format requires global headers
Output #0, mp4, to '/var/www/view/dist/videos/archive/2023-05-03/c24706a011ae90262875803ad73b8a2b/1.mp4':
 Metadata:
 title : Media Presentation
 encoder : Lavf56.40.101
 Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuvj420p, 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 20 fps, 20 tbr, 10240 tbn, 20 tbc
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mp4 @ 0x23f8d80] Non-monotonous DTS in output stream 0:0; previous: 6516, current: 6516; changing to 6517. This may result in incorrect timestamps in the output file.
[mp4 @ 0x23f8d80] Non-monotonous DTS in output stream 0:0; previous: 6523, current: 6523; changing to 6524. This may result in incorrect timestamps in the output file.
frame= 34 fps=0.0 q=-1.0 size= 1922kB time=00:00:01.52 bitrate=10321.7kbits/s 
frame= 45 fps= 41 q=-1.0 size= 2019kB time=00:00:02.07 bitrate=7978.7kbits/s
....
....
....
....
....
frame=144051 fps= 20 q=-1.0 size= 3530396kB time=02:00:01.84 bitrate=4015.8kbits/s 
frame=144055 fps= 20 q=-1.0 Lsize= 3532194kB time=02:00:02.04 bitrate=4017.7kbits/s 
video:3530424kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.050154% 



FFMPEG log for second camera :


ffmpeg started on 2023-05-03 at 12:04:01
Report written to "ffmpeg-20230503-120401.log"
ffmpeg version 2.8.14-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
 built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609
 configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
 libavutil 54. 31.100 / 54. 31.100
 libavcodec 56. 60.100 / 56. 60.100
 libavformat 56. 40.101 / 56. 40.101
 libavdevice 56. 4.100 / 56. 4.100
 libavfilter 5. 40.101 / 5. 40.101
 libavresample 2. 1. 0 / 2. 1. 0
 libswscale 3. 1.101 / 3. 1.101
 libswresample 1. 2.101 / 1. 2.101
 libpostproc 53. 3.100 / 53. 3.100
[rtsp @ 0x134adc0] DTS discontinuity in stream 1: packet 3 with DTS 80789022795410, packet 4 with DTS 80789022798792
[rtsp @ 0x134adc0] DTS discontinuity in stream 1: packet 7 with DTS 80789022798811, packet 8 with DTS 80789022809865
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://username:password@192.168.8.22:554/cam/realmonitor?channel=1&subtype=0':
 Metadata:
 title : Media Server
 Duration: N/A, start: 1683104641.570750, bitrate: N/A
 Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709), 4096x1800, 90k tbr, 90k tbn, 180k tbc
 Stream #0:1: Audio: pcm_alaw, 48000 Hz, 1 channels, s16, 384 kb/s
[mp4 @ 0x1538e00] Codec for stream 0 does not use global headers but container format requires global headers
Output #0, mp4, to '/var/www/view/dist/videos/archive/2023-05-03/c24706a011ae90262875803ad73b8a2b/2.mp4':
 Metadata:
 title : Media Server
 encoder : Lavf56.40.101
 Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuvj420p, 4096x1800, q=2-31, 90k tbr, 10240 tbn, 20 tbc
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 31 fps=0.0 q=-1.0 size= 1170kB time=00:00:01.46 bitrate=6543.0kbits/s 
frame= 40 fps= 39 q=-1.0 size= 1435kB time=00:00:01.92 bitrate=6120.5kbits/s 
Invalid UE golomb code
frame= 52 fps= 34 q=-1.0 size= 2099kB time=00:00:02.50 bitrate=6864.2kbits/s 
frame= 63 fps= 31 q=-1.0 size= 2399kB time=00:00:03.06 bitrate=6411.5kbits/s 
frame= 72 fps= 28 q=-1.0 size= 2670kB time=00:00:03.52 bitrate=6210.5kbits/s 
Invalid UE golomb code
...
...
...
...
Invalid UE golomb code
frame=27243 fps= 20 q=-1.0 size= 1046397kB time=00:22:42.09 bitrate=6293.3kbits/s 
frame=27254 fps= 20 q=-1.0 size= 1046712kB time=00:22:42.64 bitrate=6292.7kbits/s 
frame=27264 fps= 20 q=-1.0 size= 1046990kB time=00:22:43.12 bitrate=6292.1kbits/s 
frame=27275 fps= 20 q=-1.0 size= 1047290kB time=00:22:43.67 bitrate=6291.4kbits/s 
Invalid UE golomb code
frame=27285 fps= 20 q=-1.0 size= 1048022kB time=00:22:44.20 bitrate=6293.3kbits/s 
frame=27292 fps= 20 q=-1.0 Lsize= 1048561kB time=00:22:44.52 bitrate=6295.1kbits/s 
video:1048224kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.032150%



Initially, I thought that the error was in timestamps, so I added arguments to ffmpeg :


-use_wallclock_as_timestamps 1
-fflags +genpts
-fflags -discardcorrupt
-vsync vfr


But this doesnt help.


-
Safari on Mac and IOS 14 Won't Play HTML 5 MP4 Video
10 mars 2021, par Glen ElkinsSo i have developed a chat application that uses node for the back-end. When a user selects a video on their iphone it usually is .mov format so when it's sent to the node server it's then converted to mp4 with ffmpeg. All that works fine, then if i load up my chat again in Chrome on my mac the video plays just fine as the mp4.




This screenshot shows the video embed is there, set to mp4 yet it won't play in Safari on my mac or my phone, in fact it just shows the video as 0 seconds long yet i can play it in chrome and also download the mp4 file by accessing the embed url directly.


Any ideas ? I had it convert to mp4 to prevent things like this, but safari doesn't seem to even like mp4 files.


The back-end part that serves the private file is in Symfony 4 (PHP) :


/**
 * @Route("/private/files/download/{base64Path}", name="downloadFile")
 * @param string $base64Path
 * @param Request $request
 * @return Response
 */
 public function downloadFile(string $base64Path, Request $request) : Response
 {


 // get token
 if(!$token = $request->query->get('token')){
 return new Response('Access Denied',403);
 }



 /** @var UserRepository $userRepo */
 $userRepo = $this->getDoctrine()->getRepository(User::class);

 /** @var User $user */
 if(!$user = $userRepo->findOneBy(['deleted'=>false,'active'=>true,'systemUser'=>false,'apiKey'=>$token])){
 return new Response('Access Denied',403);
 }



 // get path
 if($path = base64_decode($base64Path)){

 // make sure the folder we need exists
 $fullPath = $this->getParameter('private_upload_folder') . '/' . $path;



 if(!file_exists($fullPath)){
 return new Response('File Not Found',404);
 }

 

 $response = new Response();
 $response->headers->set('Content-Type', mime_content_type($fullPath));
 $response->headers->set('Content-Disposition', 'inline; filename="' . basename($fullPath) . '"');
 $response->headers->set('Content-Length', filesize($fullPath));
 $response->headers->set('Pragma', "no-cache");
 $response->headers->set('Expires', "0");
 $response->headers->set('Content-Transfer-Encoding', "binary");

 $response->sendHeaders();

 $response->setContent(readfile($fullPath));

 return $response;
 }

 return new Response('Invalid Path',404);
 }



This works fine everywhere except safari when trying to embed the video. It's done like this because the videos are not public and need an access token.


UPDATE : Here is a test link of an mp4, you'll have to allow the insecure certificate as it's on a quick test sub domain. If you open it in chrome, you'll see a 3 second video of my 3d printer curing station, if you load the same link in safari, you'll see it doesn't work




The server runs on cPanel with Apache and i think it might be something to do with the video needs streaming ?


UPDATED CODE THAT WORKS IN SAFARI BUT NOW BROKEN IN CHROME :


Chrome is now giving Content-Length : 0 but it's working fine in safari.


public function downloadFile(string $base64Path, Request $request) : ?Response
 {

 ob_clean();

 // get token
 if(!$token = $request->query->get('token')){
 return new Response('Access Denied',403);
 }


 

 /** @var UserRepository $userRepo */
 $userRepo = $this->getDoctrine()->getRepository(User::class);

 /** @var User $user */
 if(!$user = $userRepo->findOneBy(['deleted'=>false,'active'=>true,'systemUser'=>false,'apiKey'=>$token])){
 return new Response('Access Denied',403);
 }



 // get path
 if($path = base64_decode($base64Path)){

 // make sure the folder we need exists
 $fullPath = $this->getParameter('private_upload_folder') . '/' . $path;



 if(!file_exists($fullPath)){
 return new Response('File Not Found',404);
 }


 $filesize = filesize($fullPath);
 $mime = mime_content_type($fullPath);

 header('Content-Type: ' . $mime);

 if(isset($_SERVER['HTTP_RANGE'])){

 // Parse the range header to get the byte offset
 $ranges = array_map(
 'intval', // Parse the parts into integer
 explode(
 '-', // The range separator
 substr($_SERVER['HTTP_RANGE'], 6) // Skip the `bytes=` part of the header
 )
 );



 // If the last range param is empty, it means the EOF (End of File)
 if(!$ranges[1]){
 $ranges[1] = $filesize - 1;
 }

 header('HTTP/1.1 206 Partial Content');
 header('Accept-Ranges: bytes');
 header('Content-Length: ' . ($ranges[1] - $ranges[0])); // The size of the range

 // Send the ranges we offered
 header(
 sprintf(
 'Content-Range: bytes %d-%d/%d', // The header format
 $ranges[0], // The start range
 $ranges[1], // The end range
 $filesize // Total size of the file
 )
 );

 // It's time to output the file
 $f = fopen($fullPath, 'rb'); // Open the file in binary mode
 $chunkSize = 8192; // The size of each chunk to output

 // Seek to the requested start range
 fseek($f, $ranges[0]);

 // Start outputting the data
 while(true){
 // Check if we have outputted all the data requested
 if(ftell($f) >= $ranges[1]){
 break;
 }

 // Output the data
 echo fread($f, $chunkSize);

 // Flush the buffer immediately
 @ob_flush();
 flush();
 }
 }else{

 // It's not a range request, output the file anyway
 header('Content-Length: ' . $filesize);

 // Read the file
 @readfile($filesize);

 // and flush the buffer
 @ob_flush();
 flush();



 }

 }else {

 return new Response('Invalid Path', 404);
 }
 }



I have notice in chrome that it's sending the range header like this :


Range : bytes=611609-


Where safari sends


Range : bytes=611609-61160


So for some reason chrome is missing the second range amount, that obviously means my code can't find a range number for the second one.


Doesn’t matter what I do I can’t get it working in both chrome and safari. Safari wants the byte range part , chrome seems to request it then sends a new request for the full file but even the full file part of the code gives a 500 error. If I take out the byte range bit then it works fine in chrome but not safari.


UPDATE :


Here is some strange things going on in chrome :


For the video i am testing with it makes 3 range requests :


REQUEST 1 HEADERS - asking for bytes 0- (to the end of the file)


GET /private/files/download/Y2hhdC83Nzk1Y2U2MC04MDFmLTExZWItYjkzYy1lZjI4ZGYwMDhkOTMubXA0?token=6ab1720bfe922d44208c25f655d61032 HTTP/1.1

Connection: keep-alive
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Safari/537.36
Accept-Encoding: identity;q=1, *;q=0
Accept: */*
Sec-Fetch-Site: same-site
Sec-Fetch-Mode: no-cors
Sec-Fetch-Dest: video
Referer: https://gofollow.vip/
Accept-Language: en-US,en;q=0.9
Range: bytes=0-



RESPONSE GIVES IT BACK ALL THE BYTES IN THE FILE AS THAT'S WHAT WAS ASKED FOR BY CHROME :


HTTP/1.1 206 Partial Content
Date: Wed, 10 Mar 2021 12:35:54 GMT
Server: Apache
Accept-Ranges: bytes
Content-Length: 611609
Content-Range: bytes 0-611609/611610
Vary: User-Agent
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: video/mp4



SECOND REQUEST HEADERS : NOW IT'S ASKING FOR 589824 to the end of the file :


Connection: keep-alive
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Safari/537.36
Accept-Encoding: identity;q=1, *;q=0
Accept: */*
Sec-Fetch-Site: same-site
Sec-Fetch-Mode: no-cors
Sec-Fetch-Dest: video
Referer: https://gofollow.vip/
Accept-Language: en-US,en;q=0.9
Range: bytes=589824-



RESPONSE OBLIGES :


HTTP/1.1 206 Partial Content
Date: Wed, 10 Mar 2021 12:35:55 GMT
Server: Apache
Accept-Ranges: bytes
Content-Length: 21785
Content-Range: bytes 589824-611609/611610
Vary: User-Agent
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
Content-Type: video/mp4



THEN IT'S MAKING THIS 3rd REQUEST THAT GIVES AN INTERNAL SERVER ERORR, THIS TIME IT'S LITERALLY ASKING FOR THE LAST BYTE :


GET /private/files/download/Y2hhdC83Nzk1Y2U2MC04MDFmLTExZWItYjkzYy1lZjI4ZGYwMDhkOTMubXA0?token=6ab1720bfe922d44208c25f655d61032 HTTP/1.1

Connection: keep-alive
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Safari/537.36
Accept-Encoding: identity;q=1, *;q=0
Accept: */*
Sec-Fetch-Site: same-site
Sec-Fetch-Mode: no-cors
Sec-Fetch-Dest: video
Referer: https://gofollow.vip/
Accept-Language: en-US,en;q=0.9
Range: bytes=611609-



RESPONSE - THE CONTENT LENGTH IS 0 BECAUSE THERE IS NO DIFFERENCE BETWEEN THE REQUESTED BYTES AND THE BYTES RETURNED :


HTTP/1.1 500 Internal Server Error
Date: Wed, 10 Mar 2021 12:35:56 GMT
Server: Apache
Accept-Ranges: bytes
Cache-Control: max-age=0, must-revalidate, private
X-Frame-Options: DENY
X-XSS-Protection: 1
X-Content-Type-Options: nosniff
Referrer-Policy: origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
Expires: Wed, 10 Mar 2021 12:35:56 GMT
Content-Length: 0
Content-Range: bytes 611609-611609/611610
Vary: User-Agent
Connection: close
Content-Type: text/html; charset=UTF-8



-
Protecting consumer privacy : How to ensure CCPA compliance