
Recherche avancée
Médias (91)
-
Les Miserables
9 décembre 2019, par
Mis à jour : Décembre 2019
Langue : français
Type : Textuel
-
VideoHandle
8 novembre 2019, par
Mis à jour : Novembre 2019
Langue : français
Type : Video
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
-
Un test - mauritanie
3 avril 2014, par
Mis à jour : Avril 2014
Langue : français
Type : Textuel
-
Pourquoi Obama lit il mes mails ?
4 février 2014, par
Mis à jour : Février 2014
Langue : français
-
IMG 0222
6 octobre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Image
Autres articles (64)
-
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
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 (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)
Sur d’autres sites (8830)
-
rtmp streaming video does not work [on hold]
12 mai 2017, par 김동영I want to develop rtmp live streaming. It uses ffmpeg and sdl. First, I want to output a simple image. Packets come in but no image is output. Please let me know why the following sources do not work.
I can not find the answer throughout the week and I ask.
It is being developed as an iOS objective-c.
I hope you help me.
Have a good daythank you.
<code>
#import <libavcodec></libavcodec>avcodec.h>
#import <libavformat></libavformat>avformat.h>
#import <libswscale></libswscale>swscale.h>
#import <libavfilter></libavfilter>avfilter.h>
#import <libavfilter></libavfilter>avfiltergraph.h>
#import <libavfilter></libavfilter>buffersrc.h>
#import <libswresample></libswresample>swresample.h>
#import
#import
@implementation hello2
- (void)viewDidLoad {
[super viewDidLoad];
AVFormatContext *pFormatCtx;
int i, videoindex;
AVCodecContext *pCodecCtx;
AVCodec *pCodec;
AVFrame *pFrame,*pFrameYUV;
uint8_t *out_buffer;
AVPacket *packet;
int y_size;
int ret, got_picture;
struct SwsContext *img_convert_ctx;
//SDL---------------------------
int screen_w=0,screen_h=0;
SDL_Window *screen;
SDL_Renderer* sdlRenderer;
SDL_Texture* sdlTexture;
SDL_Rect sdlRect;
FILE *fp_yuv;
av_register_all();
avformat_network_init();
pFormatCtx = avformat_alloc_context();
SDL_SetMainReady();
//rtmp://www.planeta-online.tv:1936/live/channel_4
if(avformat_open_input(&pFormatCtx,"rtmp://live.hkstv.hk.lxdns.com/live/hks",NULL,NULL)!=0){
printf("Couldn't open input stream.\n");
return;
}
if(avformat_find_stream_info(pFormatCtx,NULL)<0){
printf("Couldn't find stream information.\n");
return;
}
videoindex=-1;
for(i=0; inb_streams; i++)
if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO){
videoindex=i;
break;
}
if(videoindex==-1){
printf("Didn't find a video stream.\n");
return;
}
pCodecCtx=pFormatCtx->streams[videoindex]->codec;
pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
if(pCodec==NULL){
printf("Codec not found.\n");
return;
}
if(avcodec_open2(pCodecCtx, pCodec,NULL)<0){
printf("Could not open codec.\n");
return;
}
pFrame=av_frame_alloc();
pFrameYUV=av_frame_alloc();
out_buffer=(uint8_t *)av_malloc(avpicture_get_size(AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height));
avpicture_fill((AVPicture *)pFrameYUV, out_buffer, AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height);
packet=(AVPacket *)av_malloc(sizeof(AVPacket));
//Output Info-----------------------------
printf("--------------- File Information ----------------\n");
av_dump_format(pFormatCtx,0,"rtmp://live.hkstv.hk.lxdns.com/live/hks",0);
printf("-------------------------------------------------\n");
img_convert_ctx = sws_getContext(pCodecCtx->width, pCodecCtx->height, pCodecCtx->pix_fmt,
pCodecCtx->width, pCodecCtx->height, AV_PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL);
#if OUTPUT_YUV420P
fp_yuv=fopen("output.yuv","wb+");
#endif
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER)) {
printf( "Could not initialize SDL - %s\n", SDL_GetError());
return;
}
screen_w = pCodecCtx->width;
screen_h = pCodecCtx->height;
//SDL 2.0 Support for multiple windows
screen = SDL_CreateWindow("Simplest ffmpeg player", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
screen_w, screen_h,
SDL_WINDOW_OPENGL);
if(!screen) {
printf("SDL: could not create window - exiting:%s\n",SDL_GetError());
return;
}
sdlRenderer = SDL_CreateRenderer(screen, -1, 0);
//IYUV: Y + U + V (3 planes)
//YV12: Y + V + U (3 planes)
sdlTexture = SDL_CreateTexture(sdlRenderer, SDL_PIXELFORMAT_IYUV, SDL_TEXTUREACCESS_STREAMING,pCodecCtx->width,pCodecCtx->height);
sdlRect.x=0;
sdlRect.y=0;
sdlRect.w=screen_w;
sdlRect.h=screen_h;
SDL_SetTextureBlendMode(sdlTexture, SDL_BLENDMODE_BLEND);
//SDL End----------------------
while(av_read_frame(pFormatCtx, packet)>=0){
if(packet->stream_index==videoindex){
ret = avcodec_decode_video2(pCodecCtx, pFrame, &got_picture, packet);
if(ret < 0){
printf("Decode Error.\n");
return;
}
//NSLog(@"write packet pst = %lld, dts = %lld, stream = %d", packet->pts, packet->dts, packet->stream_index);
if(got_picture){
sws_scale(img_convert_ctx, (const uint8_t* const*)pFrame->data, pFrame->linesize, 0, pCodecCtx->height,
pFrameYUV->data, pFrameYUV->linesize);
#if OUTPUT_YUV420P
y_size=pCodecCtx->width*pCodecCtx->height;
fwrite(pFrameYUV->data[0],1,y_size,fp_yuv); //Y
fwrite(pFrameYUV->data[1],1,y_size/4,fp_yuv); //U
fwrite(pFrameYUV->data[2],1,y_size/4,fp_yuv); //V
#endif
//SDL---------------------------
#if 0
SDL_UpdateTexture( sdlTexture, NULL, pFrameYUV->data[0], pFrameYUV->linesize[0] );
#else
SDL_UpdateYUVTexture(sdlTexture, &sdlRect,
pFrameYUV->data[0], pFrameYUV->linesize[0],
pFrameYUV->data[1], pFrameYUV->linesize[1],
pFrameYUV->data[2], pFrameYUV->linesize[2]);
#endif
SDL_RenderClear( sdlRenderer );
SDL_RenderCopy( sdlRenderer, sdlTexture, NULL, &sdlRect);
SDL_RenderPresent( sdlRenderer );
//SDL End-----------------------
//Delay 40ms
SDL_Delay(20);
}
}
av_free_packet(packet);
}
//flush decoder
//FIX: Flush Frames remained in Codec
while (1) {
ret = avcodec_decode_video2(pCodecCtx, pFrame, &got_picture, packet);
if (ret < 0)
break;
if (!got_picture)
break;
sws_scale(img_convert_ctx, (const uint8_t* const*)pFrame->data, pFrame->linesize, 0, pCodecCtx->height,
pFrameYUV->data, pFrameYUV->linesize);
#if OUTPUT_YUV420P
int y_size=pCodecCtx->width*pCodecCtx->height;
fwrite(pFrameYUV->data[0],1,y_size,fp_yuv); //Y
fwrite(pFrameYUV->data[1],1,y_size/4,fp_yuv); //U
fwrite(pFrameYUV->data[2],1,y_size/4,fp_yuv); //V
#endif
//SDL---------------------------
SDL_UpdateTexture( sdlTexture, &sdlRect, pFrameYUV->data[0], pFrameYUV->linesize[0] );
SDL_RenderClear( sdlRenderer );
SDL_RenderCopy( sdlRenderer, sdlTexture, NULL, &sdlRect);
SDL_RenderPresent( sdlRenderer );
//SDL End-----------------------
//Delay 40ms
SDL_Delay(40);
}
sws_freeContext(img_convert_ctx);
#if OUTPUT_YUV420P
fclose(fp_yuv);
#endif
SDL_Quit();
av_frame_free(&pFrameYUV);
av_frame_free(&pFrame);
avcodec_close(pCodecCtx);
avformat_close_input(&pFormatCtx);
}
@end` -
RN 0.74.7 can't find repo for ffmpeg-kit-react-native 6.0.2
9 mai, par user938363My React Native 0.74.7 (on MacOS) app has hard time to find the ffmpeg-kit-react-native repo when
run-android
. It constantly complains no repo found on maven. Here is the error whenreact-native run-android
:

* What went wrong:
Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
 > Could not find com.arthenica:ffmpeg-kit-full-gpl:6.0.
 Searched in the following locations:
 - https://oss.sonatype.org/content/repositories/snapshots/com/arthenica/ffmpeg-kit-full-gpl/6.0/ffmpeg-kit-full-gpl-6.0.pom
 - https://repo.maven.apache.org/maven2/com/arthenica/ffmpeg-kit-full-gpl/6.0/ffmpeg-kit-full-gpl-6.0.pom
 - file:/Users/macbook/Documents/code/js/VmonFront/node_modules/jsc-android/dist/com/arthenica/ffmpeg-kit-full-gpl/6.0/ffmpeg-kit-full-gpl-6.0.pom
 - https://dl.google.com/dl/android/maven2/com/arthenica/ffmpeg-kit-full-gpl/6.0/ffmpeg-kit-full-gpl-6.0.pom
 - https://www.jitpack.io/com/arthenica/ffmpeg-kit-full-gpl/6.0/ffmpeg-kit-full-gpl-6.0.pom
 Required by:
 project :app > project :ffmpeg-kit-react-native



In android/build.gradle, the repo was specified :


buildscript {
 ext {
 buildToolsVersion = "34.0.0"
 minSdkVersion = 23
 compileSdkVersion = 34
 targetSdkVersion = 34
 ndkVersion = "26.1.10909125"
 kotlinVersion = "1.9.22"

 ffmpegKitPackage = "full-gpl"
 }

 repositories {
 google()
 mavenCentral()
 maven { url "https://jitpack.io" }
 // You can comment out the below line if it causes issues:
 maven { url 'https://maven.arthenica.com/public/' } //<<<===repo here
 }

 dependencies {
 classpath("com.android.tools.build:gradle")
 classpath("com.facebook.react:react-native-gradle-plugin")
 classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
 }
}


apply plugin: "com.facebook.react.rootproject"



Also the following code is added to android/app/build.gradle :


// 🔥 Add this block to override the wrong version in ffmpeg's gradle.properties
configurations.all {
 resolutionStrategy {
 force "com.arthenica:ffmpeg-kit-https:6.0". //<<<===6.0.2 or 6 didn't work
 force "com.arthenica:ffmpeg-kit-full-gpl:6.0" // Include if using other packages
 }
}



The problem seems to be with RN 0.74.7 only, as my RN 0.78.0 with ffmpeg-kit-react-native installed was able to download full-gpl version and installed successfully. What is missing here to install ffmpeg-kit on RN 0.74.7 ?


-
Failed to find two consecutive MPEG audio frames [closed]
3 décembre 2024, par matrixebizI'm receiving this error trying to download/convert an m3u8


[mp3 @ 000001c8f5112200] Format mp3 detected only with low score of 1, misdetection possible!
[mp3 @ 000001c8f5112200] Failed to find two consecutive MPEG audio frames.
[in#0 @ 000001c8f5111f40] Error opening input: Invalid data found when processing input



Any way to fix this in my ffmpeg command line ? Also, playing the stream in VLC and other apps shows this in the path /%EF%BB%BF for some reason.
VLC is unable to open the MRL 'file :///C :/Temp/%EF%BB%BF'. Check the log for details. Then it will play the actual video.


Do i need to change the beginning of the m3u8 ?
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1000,RESOLUTION=640x360,


Even if I remove it and just leave the URL that is inside the m3u8, will still display the %EF%BB%BF which I need to stop from happening


EDIT : Adding the PowerShell script I'm using to output my file :


function Replace-FileText
{
 [CmdletBinding()]
 Param
 (
 $File1,
 $File2,
 $File1StartAnchor,
 $File1EndAnchor = "$",
 $File2StartAnchor,
 $File2EndAnchor = "$"
 )
 
 #Escape the regex meta characters, this assumes literals are used in the input
 $File1StartAnchorEscaped = [System.Text.RegularExpressions.Regex]::Escape($File1StartAnchor)
 $File2StartAnchorEscaped = [System.Text.RegularExpressions.Regex]::Escape($File2StartAnchor)

 if ($PSBoundParameters.ContainsKey('File1EndAnchor'))
 {
 $File1EndAnchorEscaped = [System.Text.RegularExpressions.Regex]::Escape($File1EndAnchor)
 }
 else
 {
 $File1EndAnchorEscaped = $File1EndAnchor
 }

 if ($PSBoundParameters.ContainsKey('File2EndAnchor'))
 {
 $File2EndAnchorEscaped = [System.Text.RegularExpressions.Regex]::Escape($File2EndAnchor)
 }
 else
 {
 $File2EndAnchorEscaped = $File2EndAnchor
 }


 if ((Get-Content $File1 -Raw) -match "$File1StartAnchorEscaped(.*?)$File1EndAnchorEscaped")
 {
 Write-Host "Found the following string in between the anchors in $File1 :$($Matches[1])"
 $TextToInject = $Matches[1]
 }
 else
 {
 Write-Host "Could not find the Start and end Anchors in $File1"
 return
 }
 
 if ((Get-Content $File2 -Raw) -match "$File2StartAnchorEscaped(.*?)$File2EndAnchorEscaped")
 {
 Write-Host "Found the following string in between the anchors in $File2 :$($Matches[1])"
 $TextToReplace = $Matches[1]
 }
 else
 {
 Write-Host "Could not find the Start Anchor in $File2"
 return
 }
 
 (Get-Content $File2 -Raw) -replace $TextToReplace,$TextToInject | Out-File $File2 -NoNewline
}
 
 
Replace-FileText -File1 'C:\EQDA\File1.txt' -File2 'C:\EQDA\File2.txt' -File1StartAnchor 'two' -File1EndAnchor '"' -File2StartAnchor 'four'
Replace-FileText -File1 'C:\EQDA\File1.txt' -File2 'C:\EQDA\File2.txt' -File1StartAnchor 'server-' -File1EndAnchor '-name' -File2StartAnchor 'server-' -File2EndAnchor '-name'