
Recherche avancée
Médias (2)
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (70)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
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 (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (5111)
-
Past duration 0.750206 too large when capturing my screen
2 avril 2018, par it_is_a_literatureI want to capture my screen with ffmpeg
xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
ffmpeg -f x11grab -framerate 30 -threads 0 -s 1920 x 1080 -i :0 /tmp/capture.mp4Error info :
[x11grab @ 0x556025373ae0] Stream #0: not enough frames to estimate rate; consider increasing probesize
Past duration 0.750206 too large 435kB time=00:00:01.00 bitrate=3564.5kbits/s dup=19 drop=0 speed=0.382x
Past duration 0.749168 too largeTry other ffmpeg command.
ffmpeg -f x11grab -video_size 1360x768 -framerate 30 -i :0.0 -f pulse -i default -preset ultrafast -crf 18 -pix_fmt yuv420p out.mkv
[x11grab @ 0x55db2f72fc00] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
[pulse @ 0x55db2f7374e0] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
[output stream 0:1 @ 0x55db2f7784e0] 100 buffers queued in output stream 0:1, something may be wrong.
[libvorbis @ 0x55db2f753720] Queue input is backward in time
[matroska @ 0x55db2f750760] Non-monotonous DTS in output stream 0:1; previous: 3411, current: 3272; changing to 3411. This may result in incorrect timestamps in the output file.How to fix it ?
-
mp4 plays only sound but no video on ios
5 avril 2018, par ChenI have a video that I get from a third party provide in my App, I want to play using react-native-video. It works fine on simulator, but on a real iphone 7 it has only sound but no video.
After further research I found, when I try to airdrop/move via itunes the video to my iphone. It shows something like the following :
I have checked the codec with ffprobe and here is the output.
```Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'bad.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41
creation_time : 2018-03-28T21:30:13.000000Z
Duration: 00:00:45.55, start: 0.000000, bitrate: 1373 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 1042 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
Metadata:
creation_time : 2018-03-28T21:30:13.000000Z
handler_name : Alias Data Handler
encoder : AVC Coding
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
Metadata:
creation_time : 2018-03-28T21:30:13.000000Z
handler_name : Alias Data Handler
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1001/60000
codec_tag_string=avc1
codec_tag=0x31637661
width=1920
height=1080
coded_width=1920
coded_height=1080
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=41
color_range=tv
color_space=bt709
color_transfer=bt709
color_primaries=bt709
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=30000/1001
avg_frame_rate=30000/1001
time_base=1/30000
start_pts=0
start_time=0.000000
duration_ts=1365364
duration=45.512133
bit_rate=1042237
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=1364
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2018-03-28T21:30:13.000000Z
TAG:language=eng
TAG:handler_name=Alias Data Handler
TAG:encoder=AVC Coding
[/STREAM]
[STREAM]
index=1
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=LC
codec_type=audio
codec_time_base=1/48000
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
sample_rate=48000
channels=2
channel_layout=stereo
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/48000
start_pts=0
start_time=0.000000
duration_ts=2184582
duration=45.512125
bit_rate=317375
max_bit_rate=458625
bits_per_raw_sample=N/A
nb_frames=2135
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2018-03-28T21:30:13.000000Z
TAG:language=eng
TAG:handler_name=Alias Data Handler
[/STREAM]Then I tried VLC on iOS the video played without problem (it has both video and sound), except at the beginning it shows a grey pixel screen.
Next, what i did was using ffmpeg to re-encode the video stream via :
ffmpeg -i bad.mp4 -c:a copy new.mp4
After this new.mp4 plays with no problem.
This is really confusing as the codec does not change and both videos works with no problem on my Mac.I have tried to play around with the b_frames, profile level on the new video to reproduce the problem but with no luck.
I really do not want to process every video via ffmpeg after get it from the third party. Just wondering what might be the problem with the video ?
-
FFMPEG corrupted frame when streaming in UDP (MPEGTS)
17 décembre 2020, par user37616I am working on a screen streaming program, till now, I can capture and encode my screen into a video perfectly. 
However, whenever I try to stream it over LAN, and play using Mplayer, it is able to run in simple desktop (text document, etc...) but when I try to play video the frame stated to corrupted until I quit the video (this video cause the most corrupted frame https://www.youtube.com/watch?v=1La4QzGeaaQ&t=230s)



I am not really sure why when streaming, I got corrupted frame with the youtube video but when save it to a file (change URL from udp ://192.168.1.xxx:YYYY to file name C :\Test.ts) there were no corrupted frame at all.
 My Mplayer log :



`V: 0.0 1563/1563 51% 43% 0.0% 0 0
[h264 @ 0000000001d04940]Invalid NAL unit 0, skipping.
[h264 @ 0000000001d04940]error while decoding MB 23 51, bytestream -64
[h264 @ 0000000001d04940]concealing 2066 DC, 2066 AC, 2066 MV errors in I frame
V: 0.0 1564/1564 51% 43% 0.0% 0 0
[h264 @ 0000000001d04940]concealing 7598 DC, 7598 AC, 7598 MV errors in P frame
V: 0.0 1652/1652 50% 43% 0.0% 0 0
[h264 @ 0000000001d04940]Invalid NAL unit 0, skipping.
[h264 @ 0000000001d04940]error while decoding MB 26 49, bytestream -55
[h264 @ 0000000001d04940]concealing 2303 DC, 2303 AC, 2303 MV errors in I frame
V: 0.0 1653/1653 50% 43% 0.0% 0 0
[h264 @ 0000000001d04940]concealing 7727 DC, 7727 AC, 7727 MV errors in P frame
V: 0.0 1741/1741 49% 43% 0.0% 0 0
[h264 @ 0000000001d04940]Invalid NAL unit 0, skipping.
[h264 @ 0000000001d04940]error while decoding MB 65 62, bytestream -57
[h264 @ 0000000001d04940]concealing 704 DC, 704 AC, 704 MV errors in I frame
V: 0.0 1742/1742 49% 43% 0.0% 0 0`




Stream initialize code



static void Stream_ini(const char *Url, AVFormatContext *&ofmt_ctx, AVCodec *codec, AVCodecContext *c, AVStream *&out_stream)
{
 int ret;


 avformat_alloc_output_context2(&ofmt_ctx, NULL, "mpegts", Url);
 out_stream = avformat_new_stream(ofmt_ctx, codec)
 out_stream->codec = c;
 av_dump_format(ofmt_ctx, 0, Url, 1);


 if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
 out_stream->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
 if (!(ofmt_ctx->flags & AVFMT_NOFILE))
 {
 ret = avio_open(&ofmt_ctx->pb, Url, AVIO_FLAG_WRITE);
 if (ret < 0)
 {
 printf("Could not open output URL '%s'", Url);
 return;
 }
 }


 ret = avformat_write_header(ofmt_ctx, NULL);

 if (ret < 0)
 {
 printf("Error occurred when opening output URL\n");
 return;
 }


}




this code will get the captured screen and send it to encoder :



ScreenCap.load_screen_data(inFrame,timmer) // this will capture screen and return the time and AVFrame for encoding
sws_scale(ctx, inFrame->data, inFrame->linesize, 0,c->height, frame->data, frame->linesize);

frame->pts = (timmer - first_frame_time) / fps;
EncodeToPkT(c, frame, pkt, ofmt_ctx,out_stream);

av_frame_free(&inFrame);




the AVFrame will then be send to encoder using avcodec_send_frame() to get Packet data and av_interleaved_write_frame() to stream it over LAN.



All error check are removed for simplicity



Also, this is my AVCodecContex setting for the encoder :



c->bit_rate = 15000000;
c->width = 1920;
c->height = 1080;
c->time_base = AVRational{ 1, 90 };
c->framerate = AVRational{ 90, 1 };
c->gop_size = 90;
c->max_b_frames = 0;
c->pix_fmt = AV_PIX_FMT_RGB0;




I also notice it only happen when I increase encoder bitrate (15 MBIT) but when lower it down to (10 MBIT) it happen less. And when lower it down to 2 MBIT the corrupted frame not happen anymore however the quality is really bad.

I test the streaming in LAN using : PC -> cable ->laptop, PC->wireless->laptop, PC->Virtual PC, PC only (enter PC IP address in both program and Mplayer), all got the same result.


I also test my DXGICap.load_screen_data function by make it output raw image and there were no corrupted image at all



Does anybody have an idea why.



Thank Nam.