
Recherche avancée
Médias (1)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
Autres articles (88)
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Dépôt de média et thèmes par FTP
31 mai 2013, parL’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)
Sur d’autres sites (8892)
-
How can i create a portrait video using Android's MediaRecorder
23 mars 2015, par urudroidI have an Android application which is able to record and play a videos in portrait mode, those features are working fine on Android phones.
The issue comes up because this video is needed to be played also on iOS devices (after being shared through a server).
iOS is not correctly showing the video as it looks "cropped", but videos recorded on iOS are played without issues.
So, the main difference between videos created on Android and iOS’ is the size and the rotation.
Im using CWAC-Camera library for preview and recording and ffmpeg to scale the video down to 320x568px (as this is the standard size for both Android and iOS apps).
Here is the metadata from an video created from Android :
General
Complete name : android_video.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 447 KiB
Duration : 5s 596ms
Overall bit rate : 654 Kbps
Encoded date : UTC 1904-01-01 00:00:00
Tagged date : UTC 1904-01-01 00:00:00
Writing application : Lavf56.4.101
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L2.1
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 5s 406ms
Bit rate : 536 Kbps
Width : 568 pixels
Height : 320 pixels
Display aspect ratio : 16:9
Original display aspect ratio : 16:9
Rotation : 270°
Frame rate mode : Constant
Frame rate : 14.985 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.197
Stream size : 354 KiB (79%)
Writing library : x264 core 142
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=14 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language : English
Encoded date : UTC 1904-01-01 00:00:00
Tagged date : UTC 1904-01-01 00:00:00
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 5s 596ms
Bit rate mode : Constant
Bit rate : 132 Kbps
Channel(s) : 2 channels
Channel(s)_Original : 1 channel
Channel positions : Front: C
Sampling rate : 44.1 KHz
Compression mode : Lossy
Stream size : 89.4 KiB (20%)
Language : English
Encoded date : UTC 1904-01-01 00:00:00
Tagged date : UTC 1904-01-01 00:00:00And here is the metadata from the video created on iOS :
General
Complete name : ios_video.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 673 KiB
Duration : 7s 38ms
Overall bit rate : 783 Kbps
Encoded date : UTC 2015-03-17 19:16:36
Tagged date : UTC 2015-03-17 19:16:37
Video
ID : 2
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3.0
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 7s 33ms
Bit rate : 711 Kbps
Width : 320 pixels
Height : 568 pixels
Display aspect ratio : 0.563
Frame rate mode : Constant
Frame rate : 30.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.130
Stream size : 610 KiB (91%)
Title : Core Media Video
Encoded date : UTC 2015-03-17 19:16:36
Tagged date : UTC 2015-03-17 19:16:37
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Color range : Limited
Audio
ID : 1
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 7s 38ms
Source duration : 7s 105ms
Bit rate mode : Constant
Bit rate : 64.0 Kbps
Channel(s) : 2 channels
Channel(s)_Original : 1 channel
Channel positions : Front: C
Sampling rate : 44.1 KHz
Compression mode : Lossy
Stream size : 56.8 KiB (8%)
Source stream size : 57.2 KiB (9%)
Title : Core Media Audio
Encoded date : UTC 2015-03-17 19:16:36
Tagged date : UTC 2015-03-17 19:16:37The values width and height are inverted on Android, also the Rotation parameter is set to 270º (this is the rotation parameter for portrait videos).
This is a sketch of how iOS’ videos look on iOS app :
And this is how Android’s videos look on iOS app :
So, in order to get the videos correctly displayed both on iOS and Android i need to be able to set the width to 320 and height to 568 on Android. I tried it from several places (outside and inside CWAC-Camera library) but i always get a Camera.Parameters error.
It is possible to do this on Android ?
EDIT :
This is the result i get when i set the rotation to 0 with ffmpeg :
-
how to record camera to file while encoding stream to v4l2-loopback device ?
3 février 2021, par JonatasSo i have this logitech c920 camera 1920x1080 h264 capable and i would like to record the camera to file while at the same time copying/encoding the stream to a loopback device so the camera can be still used by other apps.
here is the code i got so far :


ffmpeg -report -f alsa -i hw:CARD=C920,DEV=0 -r 1500 -s 1920x1080 -f v4l2 -vcodec h264 \
-i /dev/video1 -copyinkf -vcodec copy /home/jonatas/Videos/2021-02-01185658.mp4 \ 
-f v4l2 /dev/video0



error :


Unknown V4L2 pixel format equivalent for yuvj420p
Could not write header for output file #1 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 1:0 -- 



some info on /dev/video0(loopbackdevice) :


v4l2-ctl -d /dev/video0

 Device Caps : 0x05208003
 Video Capture
 Video Output
 Video Memory-to-Memory
 Read/Write
 Streaming
 Extended Pix Format
Priority: 0
Video input : 0 (loopback: ok)
Video output: 0 (loopback in)
Format Video Output:
 Width/Height : 1280/720
 Pixel Format : 'YUYV' (YUYV 4:2:2)
 Field : None
 Bytes per Line : 2560
 Size Image : 1843200
 Colorspace : sRGB
 Transfer Function : Default (maps to sRGB)
 YCbCr/HSV Encoding: Default (maps to ITU-R 601)
 Quantization : Default (maps to Limited Range)
 Flags : 
Streaming Parameters Video Capture:
 Frames per second: 30.000 (30/1)
 Read buffers : 8
Streaming Parameters Video Output:
 Frames per second: 30.000 (30/1)
 Write buffers : 8

User Controls

 keep_format 0x0098f900 (bool) : default=0 value=0
 sustain_framerate 0x0098f901 (bool) : default=0 value=0
 timeout 0x0098f902 (int) : min=0 max=100000 step=1 default=0 value=0
 timeout_image_io 0x0098f903 (bool) : default=0 value=0



some info on my camera in /dev/video1


v4l2-ctl -d /dev/video1 --all
Driver Info:
 Driver name : uvcvideo
 Card type : HD Pro Webcam C920
 Bus info : usb-0000:00:14.0-7.2
 Driver version : 5.4.78
 Capabilities : 0x84a00001
 Video Capture
 Metadata Capture
 Streaming
 Extended Pix Format
 Device Capabilities
 Device Caps : 0x04200001
 Video Capture
 Streaming
 Extended Pix Format
Media Driver Info:
 Driver name : uvcvideo
 Model : HD Pro Webcam C920
 Serial : EC6C336F
 Bus info : usb-0000:00:14.0-7.2
 Media version : 5.4.78
 Hardware revision: 0x00000011 (17)
 Driver version : 5.4.78
Interface Info:
 ID : 0x03000002
 Type : V4L Video
Entity Info:
 ID : 0x00000001 (1)
 Name : HD Pro Webcam C920
 Function : V4L2 I/O
 Flags : default
 Pad 0x01000007 : 0: Sink
 Link 0x0200001f: from remote pad 0x100000a of entity 'Processing 3': Data, Enabled, Immutable
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
 Width/Height : 1280/720
 Pixel Format : 'H264' (H.264)
 Field : None
 Bytes per Line : 2560
 Size Image : 1843200
 Colorspace : sRGB
 Transfer Function : Default (maps to sRGB)
 YCbCr/HSV Encoding: Default (maps to ITU-R 601)
 Quantization : Default (maps to Full Range)
 Flags : 
Crop Capability Video Capture:
 Bounds : Left 0, Top 0, Width 1280, Height 720
 Default : Left 0, Top 0, Width 1280, Height 720
 Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 1280, Height 720, Flags: 
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1280, Height 720, Flags: 
Streaming Parameters Video Capture:
 Capabilities : timeperframe
 Frames per second: 30.000 (30/1)
 Read buffers : 0
 brightness 0x00980900 (int) : min=0 max=255 step=1 default=128 value=128
 contrast 0x00980901 (int) : min=0 max=255 step=1 default=128 value=128
 saturation 0x00980902 (int) : min=0 max=255 step=1 default=128 value=128
 white_balance_temperature_auto 0x0098090c (bool) : default=1 value=1
 gain 0x00980913 (int) : min=0 max=255 step=1 default=0 value=255
 power_line_frequency 0x00980918 (menu) : min=0 max=2 default=2 value=2
 0: Disabled
 1: 50 Hz
 2: 60 Hz
 white_balance_temperature 0x0098091a (int) : min=2000 max=6500 step=1 default=4000 value=3233 flags=inactive
 sharpness 0x0098091b (int) : min=0 max=255 step=1 default=128 value=128
 backlight_compensation 0x0098091c (int) : min=0 max=1 step=1 default=0 value=0
 exposure_auto 0x009a0901 (menu) : min=0 max=3 default=3 value=3
 1: Manual Mode
 3: Aperture Priority Mode
 exposure_absolute 0x009a0902 (int) : min=3 max=2047 step=1 default=250 value=333 flags=inactive
 exposure_auto_priority 0x009a0903 (bool) : default=0 value=0
 pan_absolute 0x009a0908 (int) : min=-36000 max=36000 step=3600 default=0 value=0
 tilt_absolute 0x009a0909 (int) : min=-36000 max=36000 step=3600 default=0 value=0
 focus_absolute 0x009a090a (int) : min=0 max=250 step=5 default=0 value=0
 focus_auto 0x009a090c (bool) : default=1 value=0
 zoom_absolute 0x009a090d (int) : min=100 max=500 step=1 default=100 value=100



if i remove the 3rd line of my script the camera records the stream of video and sound to the file flawless. i tried diferent things for the 3rd line as -vcodec and something to do with pix-format flag to YUYV without success.
Is it possible to achieve this with just one ffmpeg process ?
Will the sound be made available to the loopback device also ?
How to transcode it to the proper pixel format used by loopback device ?


-
FFMPEG, DrawText Issue in Live Stream
7 décembre 2022, par KennethI am using the following command to create an H264 stream with text data from a text file. Example data is fake. I am sending this to an RTSP server that then allows clients to connect. I am connecting from VLC to view the stream.


See update, this only happens for the live stream. If I output to file, it looks correct.


OS : Windows 10


ffmpeg -f lavfi -re -i color=size=1280x720:rate=1:color=black ^
 -vf drawtext="fontsize=16:fontfile=C\\:/Windows/fonts/consola.ttf:fontcolor=white:textfile='livetext.txt':x=50:y=50: reload=1" ^
 -c:v libx264 -preset ultrafast -tune zerolatency -x264-params keyint=10:min-keyint=10 ^
 -f rtsp rtsp://127.0.0.1:60000/sorting



The issue I am having is that the text shown in the video seems to be limited to 10 rows. On a fresh restart, I get even less. I don't see anything mentioned in the documentation about a limitation on length.


I have tried different
-preset
and-tune
options. Nothing improves this issue.

Are there settings I should adjust to help this ?




Console Output :


..\ffmpeg\ffmpeg -f lavfi -re -i color=size=1280x720:rate=5:color=black -vf drawtext="fontsize=20:fontfile=C\\:/Windows/fonts/consola.ttf:fontcolor=white:textfile='livetext.txt':x=50:y=50: reload=5" -c:v libx264 -preset ultrafast -tune zerolatency -x264-params keyint=10:min-keyint=10 -f rtsp rtsp://127.0.0.1:60000/sorting
ffmpeg version 2022-12-04-git-6c814093d8-essentials_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
 built with gcc 12.1.0 (Rev2, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
 libavutil 57. 43.100 / 57. 43.100
 libavcodec 59. 54.100 / 59. 54.100
 libavformat 59. 34.102 / 59. 34.102
 libavdevice 59. 8.101 / 59. 8.101
 libavfilter 8. 51.100 / 8. 51.100
 libswscale 6. 8.112 / 6. 8.112
 libswresample 4. 9.100 / 4. 9.100
 libpostproc 56. 7.100 / 56. 7.100
Input #0, lavfi, from 'color=size=1280x720:rate=5:color=black':
 Duration: N/A, start: 0.000000, bitrate: N/A
 Stream #0:0: Video: wrapped_avframe, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 5 fps, 5 tbr, 5 tbn
Stream mapping:
 Stream #0:0 -> #0:0 (wrapped_avframe (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 000002402dcca140] using SAR=1/1
[libx264 @ 000002402dcca140] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000002402dcca140] profile Constrained Baseline, level 3.1, 4:2:0, 8-bit
[libx264 @ 000002402dcca140] 264 - core 164 r3101 b093bbe - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - 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=11 lookahead_threads=11 sliced_threads=1 slices=11 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=10 keyint_min=6 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, rtsp, to 'rtsp://127.0.0.1:60000/sorting':
 Metadata:
 encoder : Lavf59.34.102
 Stream #0:0: Video: h264, yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 5 fps, 90k tbn
 Metadata:
 encoder : Lavc59.54.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame= 485 fps=5.0 q=11.0 size=N/A time=00:01:36.80 bitrate=N/A speed= 1x 0x



Update 1 :


If I output to a file, the text is shown correctly (shown below). If I take out the -re argument for the output to match input rate, I get 150fps, so processing power does not seem to be the issue.