
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (45)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
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" (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (7943)
-
Get RGB values from AVPicture and change to grey-scale in FFMPEG
22 octobre 2014, par user2742299The main motive of my code is to change the RGB values from the AVPicture in FFMPEG.
I have been able to get the image data "data[0]" by following the article : http://blog.tomaka17.com/2012/03/libavcodeclibavformat-tutorial/
I would like to know that how can I access the 3 bytes of pic.data[0] which is in RGB format. I have been trying to access the pic.data[i][j] via for-loop in 2D matrix fashion but jth element>3.
Any guidance in this regard will be helpful.
Code is here :
AVPicture pic;
avpicture_alloc(&pic, PIX_FMT_RGB24, mpAVFrameInput->width,mpAVFrameInput->height);
auto ctxt = sws_getContext(mpAVFrameInput->width,mpAVFrameInput->height,static_cast<pixelformat>(mpAVFrameInput->format),
mpAVFrameInput->width, mpAVFrameInput->height, PIX_FMT_RGB24, SWS_BILINEAR, nullptr, nullptr, nullptr);
if (ctxt == nullptr)
throw std::runtime_error("Error while calling sws_getContext");
sws_scale(ctxt, mpAVFrameInput->data, mpAVFrameInput->linesize, 0, mpAVFrameInput->height, pic.data,
pic.linesize);
for (int i = 0; i < (mpAVFrameInput->height-1); i++) {
for (int j = 0; j < (mpAVFrameInput->width-1); j++) {
printf("\n value: %d",pic.data[0][j]);
}
}
</pixelformat>Pseudo code which is in my mind is :
For each pixel in image {
Red = pic.data[i][j].pixel.RED;
Green = pic.data[i][j].pixel.GREEN;
Blue = pic.data[i][j].pixel.BLUE;
GRAY = (Red+Green+Blue)/3;
Red = GRAY;
Green = GRAY;
Blue = GRAY;
Save Frame;}I am quite new to FFMPEG therefore any guidance and help will be highly appreciable.
Many Thanks
-
Android recorded video getting rotated after using ffmpeg
6 novembre 2014, par VaeianorI’m developing an android app, in which users can record a video, trim it, and then upload it to my server. I’m using the MediaRecorder class to handle the recording and using ffmpeg to trim the recorded video. The problem I’m having with ffmpeg is that the video is always getting rotated either 90 or 180 degrees after being trimmed. I know I can add a video filter (transpose=1) within the ffmpeg command to rotate the video. But that will require re-encoding the video. In my case, I don’t want to re-encode the video,as it takes too long. Instead, I’m having "-vcodec:copy" within ffmpeg command to use the same video codec.
Because I’m setting an orientation hint to the media recorder, the media recorder always adds "rotate=90" or "rotate=180" to the video metadata. I think that’s why the video is always getting rotated by ffmpeg.
So I was wondering if there is a way to rotate the video without re-encoding it. Or if there is a way to modify the metadata(rotate) of a recorded video before trimming it with ffmpeg.Please help ! The problem has been driving me crazy...
Thanks in advance !
Here is the ffmpeg command :
/data/data/com.xxx.xxx/app_bin/ffmpeg -y -ss 00:00:00 -t 4.000000 -i file:/storage/sdcard0/Movies/xxx/vid.mp4 -vcodec copy -acodec copy -metadata:s:v:0 rotate=0 - strict -2 file:/storage/sdcard0/Movies/xxx/vid_new.mp4
Below is the console output :
I/ShellCallback : shellOut()(9781): ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers
I/ShellCallback : shellOut()(9781): built on Nov 15 2013 00:50:10 with gcc 4.6 20120106 (prerelease)
I/ShellCallback : shellOut()(9781): configuration: --arch=arm --cpu=cortex-a8 --target-os=linux --enable-runtime-cpudetect --enable-small --prefix=/data/data/info.guardianproject.ffmpeg/app_opt --enable-pic --disable-shared --enable-static --cross-prefix=/home/n8fr8/dev/android/ndk//toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi- --sysroot=/home/n8fr8/dev/android/ndk//platforms/android-3/arch-arm --extra-cflags='-I../x264 -mfloat-abi=softfp -mfpu=neon' --extra-ldflags=-L../x264 --enable-version3 --enable-gpl --disable-doc --enable-yasm --enable-decoders --enable-encoders --enable-muxers --enable-demuxers --enable-parsers --enable-protocols --enable-filters --enable-avresample --enable-libfreetype --disable-indevs --enable-indev=lavfi --disable-outdevs --enable-hwaccels --enable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-network --enable-libx264 --enable-zlib --enable-muxer=md5
I/ShellCallback : shellOut()(9781): libavutil 51. 54.100 / 51. 54.100
I/ShellCallback : shellOut()(9781): libavcodec 54. 23.100 / 54. 23.100
I/ShellCallback : shellOut()(9781): libavformat 54. 6.100 / 54. 6.100
I/ShellCallback : shellOut()(9781): libavdevice 54. 0.100 / 54. 0.100
I/ShellCallback : shellOut()(9781): libavfilter 2. 77.100 / 2. 77.100
I/ShellCallback : shellOut()(9781): libswscale 2. 1.100 / 2. 1.100
I/ShellCallback : shellOut()(9781): libswresample 0. 15.100 / 0. 15.100
I/ShellCallback : shellOut()(9781): libpostproc 52. 0.100 / 52. 0.100
I/ShellCallback : shellOut()(9781): Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:/storage/sdcard0/Movies/xxx/vid.mp4':
I/ShellCallback : shellOut()(9781): Metadata:
I/ShellCallback : shellOut()(9781): major_brand : isom
I/ShellCallback : shellOut()(9781): minor_version : 0
I/ShellCallback : shellOut()(9781): compatible_brands: isom3gp4
I/ShellCallback : shellOut()(9781): creation_time : 2014-09-17 17:25:50
I/ShellCallback : shellOut()(9781): Duration: 00:00:04.69, start: 0.000000, bitrate: 2969 kb/s
I/ShellCallback : shellOut()(9781): Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p, 720x480, 2989 kb/s, 29.89 fps, 30 tbr, 90k tbn, 180k tbc
I/ShellCallback : shellOut()(9781): Metadata:
I/ShellCallback : shellOut()(9781): rotate : 90
I/ShellCallback : shellOut()(9781): creation_time : 2014-09-17 17:25:50
I/ShellCallback : shellOut()(9781): handler_name : VideoHandle
I/ShellCallback : shellOut()(9781): Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, s16, 128 kb/s
I/ShellCallback : shellOut()(9781): Metadata:
I/ShellCallback : shellOut()(9781): creation_time : 2014-09-17 17:25:50
I/ShellCallback : shellOut()(9781): handler_name : SoundHandle
I/ShellCallback : shellOut()(9781): Output #0, mp4, to 'file:/storage/sdcard0/Movies/xxx/vid_new.mp4':
I/ShellCallback : shellOut()(9781): Metadata:
I/ShellCallback : shellOut()(9781): major_brand : isom
I/ShellCallback : shellOut()(9781): minor_version : 0
I/ShellCallback : shellOut()(9781): compatible_brands: isom3gp4
I/ShellCallback : shellOut()(9781): creation_time : 2014-09-17 17:25:50
I/ShellCallback : shellOut()(9781): encoder : Lavf54.6.100
I/ShellCallback : shellOut()(9781): Stream #0:0(eng): Video: h264 (![0][0][0] / 0x0021), yuv420p, 720x480, q=2-31, 2989 kb/s, 29.89 fps, 90k tbn, 90k tbc
I/ShellCallback : shellOut()(9781): Metadata:
I/ShellCallback : shellOut()(9781): handler_name : VideoHandle
I/ShellCallback : shellOut()(9781): creation_time : 2014-09-17 17:25:50
I/ShellCallback : shellOut()(9781): rotate : 0
I/ShellCallback : shellOut()(9781): Stream #0:1(eng): Audio: aac (@[0][0][0] / 0x0040), 44100 Hz, mono, 128 kb/s
I/ShellCallback : shellOut()(9781): Metadata:
I/ShellCallback : shellOut()(9781): creation_time : 2014-09-17 17:25:50
I/ShellCallback : shellOut()(9781): handler_name : SoundHandle
I/ShellCallback : shellOut()(9781): Stream mapping:
I/ShellCallback : shellOut()(9781): Stream #0:0 -> #0:0 (copy)
I/ShellCallback : shellOut()(9781): Stream #0:1 -> #0:1 (copy)
I/ShellCallback : shellOut()(9781): Press [q] to stop, [?] for help
I/ShellCallback : shellOut()(9781): frame= 120 fps=0.0 q=-1.0 Lsize= 1530kB time=00:00:03.98 bitrate=3147.1kbits/s
I/ShellCallback : shellOut()(9781): video:1462kB audio:62kB global headers:0kB muxing overhead 0.329934%
I/ShellCallback : shellOut()(9781): ret 0, stream_spec v:0 -
Convert WMV to mp4 using ffmpeg get Black screen
16 mars 2015, par HawkEye000When converting an .wmv file to .mp4 i used this command :
exec("ffmpeg -i file.wmv -vcodec mpeg4 -acodec libfaac -b 1200 -r 15 -s 320x240 -pix_fmt yuv420p file.mp4") ;
Sound is fine but i have no image (using html5 not when downloaded to pc) .
this is the outputs :FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
built on Jan 29 2012 17:52:15 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
[wmv3 @ 0xc2daa0]Extra data: 8 bits left, value: 20
Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 30.00 (30/1)
Input #0, asf, from '/home/xxx/public_html/new/zawmju.wmv':
Metadata:
Application : Windows Movie Maker 2.6.4037.0
WM/ParentalRating:
WMFSDKVersion : 12.0.9200.16384
WMFSDKNeeded : 0.0.0.0000
IsVBR : 0
title :
author : SahlaTube
copyright :
comment :
Duration: 00:00:04.03, start: 2.000000, bitrate: 740 kb/s
Stream #0.0: Audio: wmav2, 44100 Hz, 2 channels, s16, 64 kb/s
Stream #0.1: Video: wmv3, yuv420p, 640x480, 30 tbr, 1k tbn, 1k tbc
[wmv3 @ 0xc2daa0]Extra data: 8 bits left, value: 20
Output #0, mp4, to '/home/xxx/public_html/new/zawmju.wmv.mp4':
Metadata:
encoder : Lavf52.64.2
Stream #0.0: Video: mpeg4, yuv420p, 320x240, q=2-31, 1 kb/s, 15 tbn, 15 tbc
Stream #0.1: Audio: libfaac, 44100 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
Press [q] to stop encoding
frame= 61 fps= 0 q=24.8 Lsize= 82kB time=4.02 bitrate= 166.4kbits/s dup=0 drop=59
video:55kB audio:24kB global headers:0kB muxing overhead 3.828952%