
Recherche avancée
Autres articles (7)
-
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...) -
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 -
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)
Sur d’autres sites (4008)
-
Metadict in ffmpeg does not have rotate information
14 juillet 2022, par Lucky SundaMy aim is to extract frames out of a video but many times the frames are inverted. This is happening because "VideoCapture" in cv2 does read the rotate flag data present in the video metadata. I am running it on mac and installed "ffmpeg" package (5.0.1) using brew package manager. This is my code to check rotation present in a video using ffmpeg.


import ffmpeg 
import cv2 
import pprint 
pp = pprint.PrettyPrinter(depth=4)
def check_rotation(path_video_file):
 # this returns meta-data of the video file in form of a dictionary
 meta_dict = ffmpeg.probe(path_video_file)
 pp.pprint(meta_dict)

 # from the dictionary, meta_dict['streams'][0]['tags']['rotate'] is the key
 # we are looking for
 rotateCode = None
 if int(meta_dict['streams'][0]['tags']['rotate']) == 90:
 rotateCode = cv2.ROTATE_90_CLOCKWISE
 elif int(meta_dict['streams'][0]['tags']['rotate']) == 180:
 rotateCode = cv2.ROTATE_180
 elif int(meta_dict['streams'][0]['tags']['rotate']) == 270:
 rotateCode = cv2.ROTATE_90_COUNTERCLOCKWISE

 return rotateCode




Here the meta_dict is supposed to have information about the rotation but it is not there.
printing out meta_dict gives :


{'format': {'bit_rate': '18498544',
 'duration': '3.584000',
 'filename': 'video.mp4',
 'format_long_name': 'QuickTime / MOV',
 'format_name': 'mov,mp4,m4a,3gp,3g2,mj2',
 'nb_programs': 0,
 'nb_streams': 2,
 'probe_score': 100,
 'size': '8287348',
 'start_time': '0.000000',
 'tags': {'com.android.version': '11',
 'compatible_brands': 'isommp42',
 'creation_time': '2021-12-08T10:56:57.000000Z',
 'major_brand': 'mp42',
 'minor_version': '0'}},
 'streams': [{'avg_frame_rate': '990000/34997',
 'bit_rate': '18804651',
 'bits_per_raw_sample': '8',
 'chroma_location': 'left',
 'closed_captions': 0,
 'codec_long_name': 'H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10',
 'codec_name': 'h264',
 'codec_tag': '0x31637661',
 'codec_tag_string': 'avc1',
 'codec_type': 'video',
 'coded_height': 1080,
 'coded_width': 1920,
 'color_primaries': 'bt470bg',
 'color_range': 'pc',
 'color_space': 'bt470bg',
 'color_transfer': 'smpte170m',
 'display_aspect_ratio': '16:9',
 'disposition': {'attached_pic': 0,
 'captions': 0,
 'clean_effects': 0,
 'comment': 0,
 'default': 1,
 'dependent': 0,
 'descriptions': 0,
 'dub': 0,
 'forced': 0,
 'hearing_impaired': 0,
 'karaoke': 0,
 'lyrics': 0,
 'metadata': 0,
 'original': 0,
 'still_image': 0,
 'timed_thumbnails': 0,
 'visual_impaired': 0},
 'duration': '3.499700',
 'duration_ts': 314973,
 'extradata_size': 35,
 'field_order': 'progressive',
 'film_grain': 0,
 'has_b_frames': 0,
 'height': 1080,
 'id': '0x1',
 'index': 0,
 'is_avc': 'true',
 'level': 40,
 'nal_length_size': '4',
 'nb_frames': '99',
 'pix_fmt': 'yuvj420p',
 'profile': 'High',
 'r_frame_rate': '120/1',
 'refs': 1,
 'sample_aspect_ratio': '1:1',
 'side_data_list': [{...}],
 'start_pts': 3168,
 'start_time': '0.035200',
 'tags': {'creation_time': '2021-12-08T10:56:57.000000Z',
 'handler_name': 'VideoHandle',
 'language': 'eng',
 'vendor_id': '[0][0][0][0]'},
 'time_base': '1/90000',
 'width': 1920},
 {'avg_frame_rate': '0/0',
 'bit_rate': '128986',
 'bits_per_sample': 0,
 'channel_layout': 'stereo',
 'channels': 2,
 'codec_long_name': 'AAC (Advanced Audio Coding)',
 'codec_name': 'aac',
 'codec_tag': '0x6134706d',
 'codec_tag_string': 'mp4a',
 'codec_type': 'audio',
 'disposition': {'attached_pic': 0,
 'captions': 0,
 'clean_effects': 0,
 'comment': 0,
 'default': 1,
 'dependent': 0,
 'descriptions': 0,
 'dub': 0,
 'forced': 0,
 'hearing_impaired': 0,
 'karaoke': 0,
 'lyrics': 0,
 'metadata': 0,
 'original': 0,
 'still_image': 0,
 'timed_thumbnails': 0,
 'visual_impaired': 0},
 'duration': '3.584000',
 'duration_ts': 172032,
 'extradata_size': 2,
 'id': '0x2',
 'index': 1,
 'nb_frames': '168',
 'profile': 'LC',
 'r_frame_rate': '0/0',
 'sample_fmt': 'fltp',
 'sample_rate': '48000',
 'start_pts': 0,
 'start_time': '0.000000',
 'tags': {'creation_time': '2021-12-08T10:56:57.000000Z',
 'handler_name': 'SoundHandle',
 'language': 'eng',
 'vendor_id': '[0][0][0][0]'},
 'time_base': '1/48000'}]}



Can someone please help me to find if rotation is present in a video ?


-
Convert mkv to mp4
7 juin 2021, par KalemKutuI have a video file input.mkv
It contains 2 audios and only 1 substring.


I want to convert it in mp4 with same quality.
It should contain same : 2 audios and 1 substring.


I tried :


ffmpeg -i input.mkv -map 0:v:0 -map 0:a:0 -map 0:a:1 -map 0:s:0 -c copy output.mp4


I got an error message :


Could not find tag for codec subrip in stream #3, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:3 -- 



.


I tried also


ffmpeg -i input.mkv -c copy -c:s mov_text output.mp4


But this line converts audio=1 and substitle=1, but NO audio 2.


Anyone who can help me ?


Thanks,
Kalem


PS : I am using mac version of ffmpeg downloaded on "2021-06-05"


-
Image generated by System.Drawing.Image is 10x larger than original file
13 mai 2021, par NinburaI've written a Powershell script that extracts one frame from a dshow capture device using FFmpeg, and then copies the output image from a file to my clipboard :


$screenshot = [System.Drawing.Image]::FromFile((Get-Item -Path $outputFilePath))
[System.Windows.Forms.Clipboard]::SetImage($screenshot)
$screenshot.Dispose()



The original file is a 1MB JPEG, but the image in my clipboard is an 11MB PNG. When I go to paste this file into something like Discord the file size is too large, unless you have Discord Nitro.


Is there any way to avoid this file size inflation while using
[System.Drawing.Image]::FromFile()
?

Here's an easy test template :


Add-Type -AssemblyName System.Drawing
Add-Type -AssemblyName System.Windows.Forms

$screenshot = [System.Drawing.Image]::FromFile((Get-Item -Path "Path to picture"))
[System.Windows.Forms.Clipboard]::SetImage($screenshot)
$screenshot.Dispose()



Edit 2021/05/13 :


Interestingly, it's starting to seem like this is a limitation of copying an image to a clipboard. I decided to dig deeper and see if the image size was increasing when I drew the image with
System.Drawing.Image
or when I pushed it in my clipboard withSystem.Windwos.Forms.Clipboard
. If I save the image before putting it my clipboard like so, it retains the original file size, even if I change the extension to png :

Add-Type -AssemblyName System.Drawing
Add-Type -AssemblyName System.Windows.Forms

$screenshot = [System.Drawing.Image]::FromFile((Get-Item -Path "C:\Users\gabri\Pictures\FFScreenshots\2021-05-12 19-04-26.845.jpeg"))
$screenshot.Save("C:\Users\gabri\Pictures\FFScreenshots\test.jpeg") # test.png makes no difference
$screenshot.Dispose()



So it would seem that the image grows exponentially in size specifically when I push it to my clipboard. I verified this by simply uploading an image to Discord, copying it to my clipboard (click image > Open original > right click and copy result), and uploading it again. Sure enough, the new image pasted from my clipboard was around 10x the size of the original image (1MB vs 12MB). I wondered if this was a "limitation" of Windows so I ran the same test on Ubuntu 20.04. Uploaded an image to Discord, copied the image to my clipboard, and uploaded it again. Once again the image was about 10x larger, though slightly smaller than then when I uploaded the image from my clipboard on my Windows machine (11.4MB VS 12MB). Just to make sure this wasn't limited to Discord, I ran the same test with Gmail in-browser on both operating systems, same result.


Alas, there appears to be something happening when you copy an image to a clipboard that drastically increases file size. One thing's for sure, whatever's happening is definitely over my head.