Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (52)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP 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 (11793)

  • ignore "channel_layout" when working with multichannel audio in ffmpeg

    21 mars 2024, par umläute

    I'm working with multichannel audio files (higher-order ambisonics), that typically have at least 16 channels.

    


    Sometimes I'm only interested in a subset of the audiochannels (e.g. the first 25 channels of a file that contains even more channels).

    


    For this I have a script like the following, that takes a multichannel input file, an output file and the number of channels I want to extract :

    


    #!/bin/sh
infile=$1
outfile=$2
channels=$3

channelmap=$(seq -s"|" 0 $((channels-1)))

ffmpeg -y -hide_banner \
  -i "${infile}" \
  -filter_complex "[0:a]channelmap=${channelmap}" \
  -c:a  libopus -mapping_family 255 -b:a 160k -sample_fmt s16 -vn -f webm -dash 1 \
  "${outfile}"


    


    The actual channel extraction is done via the channelmap filter, that is invoked with something like -filter:complex "[0:a]channelmap=0|1|2|3"

    


    This works great with 1,2,4 or 16 channels.

    


    However, it fails with 9 channels, and 25 and 17 (and generally anything with >>16 channels).

    


    The error I get is :

    


    $ ffmpeg -y -hide_banner -i input.wav  -filter_complex "[0:a]channelmap=0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16" -c:a libopus -mapping_family 255 -b:a 160k  -sample_fmt s16 -vn -f webm -dash 1 output.webm
Input #0, wav, from 'input.wav':
  Duration: 00:00:09.99, bitrate: 17649 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 25 channels, s16, 17640 kb/s
[Parsed_channelmap_0 @ 0x5568874ffbc0] Output channel layout is not set and cannot be guessed from the maps.
[AVFilterGraph @ 0x5568874fff40] Error initializing filter 'channelmap' with args '0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16'
Error initializing complex filters.
Invalid argument


    


    So ffmpeg cannot guess the channel layout for a 17 channel file.
ffmpeg -layouts only lists channel layouts with 1,2,3,4,5,6,7,8 & 16.

    


    However, I really don't care about the channel layout. The entire concept of "channel layout" is centered around the idea, that each audio channel should go to a different speaker.
But my audio channels are not speaker feeds at all.

    


    So I tried providing explicit channel layouts, with something like -filter_complex "[0:a]channelmap=map=0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16:channel_layout=unknown", but this results in an error when parsing the channel layout :

    


    $ ffmpeg -y -hide_banner -i input.wav  -filter_complex "[0:a]channelmap=map=0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16:channel_layout=unknown" -c:a  libopus -mapping_family 255 -b:a 160k  -sample_fmt s16 -vn -f webm -dash 1 output.webm
Input #0, wav, from 'input.wav':
  Duration: 00:00:09.99, bitrate: 17649 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 25 channels, s16, 17640 kb/s
[Parsed_channelmap_0 @ 0x55b60492bf80] Error parsing channel layout: 'unknown'.
[AVFilterGraph @ 0x55b604916d00] Error initializing filter 'channelmap' with args 'map=0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16:channel_layout=unknown'
Error initializing complex filters.
Invalid argument


    


    I also tried values like any, all, none, 0x0 and 0xFF with the same result.
I tried using mono (as the channels are kind-of independent), but ffmpeg is trying to be clever and tells me that a mono layout must not have 17 channels.

    


    I know that ffmpeg can handle multi-channel files without a layout.
E.g. converting a 25-channel file without the -filter_complex "..." works without problems, and ffprobe gives me an unknown channel layout.

    


    So : how do I tell ffmpeg to just not care about the channel_layout when creating an output file that only contains a subset of the input channels ?

    


  • FFmpeg ignores the -r parameter in IDE

    19 décembre 2020, par oo92

    I am using FFmpeg to take screenshots of live streams from Twitch API. It is supposed to take 1 screenshot every 10 seconds. When I run this command in terminal :

    


    ffmpeg 
-ss 30 
-i https://video-weaver.yto01.hls.ttvnw.net/v1/playlist/CvIDlyFiINn0ouutK9xwQnslAsRDXyOUi8M54HZKwgbqbk3vZZuf9Yv-1Cb1Bgr8qMn6B4cN5SEtBdzNU612PMA1Il0VeTQHON-OOnQhMfL3LxsOiNv4W7qo6jk9-hOGxS6txUdj44rr_nbAzD13wiz_2Bo2vUh7-PH8_uqpcNa4AGLiocZ4fAR_VXnSLowpgIIDJqjbd95BdtOEB7T7Oug3mWSVsv2EL_wF1sH-FxPxvyDV46I69_tf_B29gTSnl7G3dWk-hX-TVUeSsqfv6GKlO1SOieVy1eEY8T5DVCf_hK8aycsD7UWClhzm_CMOd_390qIg4fk2dvxi_rIQWiPLwmc5odvfNINskYDF5zBCauGBFAszqm1D0WMLrK_QWkbn5zV_-6r8P4uOlnxbSrQh8BlniXy4T-agiLW3soDLNPFjEM-qtFPUIlLQtrxkf-jCJKNmig53TdEIf35FKqccoFqDnP_8d3ToiSao9afZAIHdu4xjKo7nySVr3aqOiXHXacvp6T8cQJ5rRpFFHhCLPdCGeC2uqQ9__p86ABe8BuWAXKN8Mhv63Io5m6b-WqeDPBKf6TeDMsQuwKVvaiQgLgSi2W1mnYI2Ec1gSbizqYDQbmlGH5qnFs-ta0hSs7zDqFhodborBd80-uVrsYj6NPZGEhBH_B6BYCtXMZVWHXCP-wn8GgxFv8q_Ow4-zRiu6ak.m3u8 
-frames:v 100 
-r 0.1 
-f 
image2 
/home/me/Desktop/datasets/image-dataset/test/40409534908_%03d.jpg> /dev/null 2>&1 < /dev/null


    


    It works well. I have 100 screenshots that are taken 10 seconds apart. Exactly what I want but this is only for one stream. When I run this in a for loop :

    


    user = techzz
id = 39918008013
game = Teamfight-Tactics
stream = https://video-weaver.yto01.hls.ttvnw.net/v1/playlist/Cu4DiJ7T6qlPgUNWaoBhjTtJBwsLjuYEsIKkKCfHptotlZse2SMXQQOkTtkXu9-v4e8_wWQkv-oVxixhL5e6X55OdtIBUiC-9sDgTN8fzz5_Uo8xUi7Yx_3lc2soWBy3xRQkqLIyFkPc02j2AG46OwrLF7oxjD4wxRUiTACoNVQPSLemMtZMGhVI8Yo4N6TacyF-8QQfVlyMFW6M1baPu7tSU_xTRL-4bNQMmnXYYtiEKdH1takb22ouZpiUXrHBcCxBugc5-UEJZfnTurCdVHtOkS49PYoml_HdLBSPFuiWlsTaODV_f3po35MvAIF1kYv7j3LMAfsS6QGrwoMO1Jkr5RtVOE_vUgNVCzhZuqWL5p0CHXL2kEK7o5reUEQ1wkPqpt2sqGx6p57ZltrpCpwf1kq4gUpc1CP-vJiby3cz5QxIn41Whc14DFOF-lzi72BIWH-dMUQ6AChE68jAA8TkS5JYu35H6jTaqLINqHgN11E1VGfxUSyEK9tM3KAm4NmoF1tGfATj0SqAKALX_Fj1bTJU71s9_rc1EZ76b8lIS5WjPqgEcy2GhUzbpqRwom8KlnC7Bcg7tk9Oq4YuujNcZFW2XvcvitbckpJ4bUjRD4HdVOOsfjSlUpIy33N8ioqYytHeHQsmupo904eRtVISEGzDzAPuzNdP6A282flEjIQaDKCInhO3tyoNLs0XtA.m3u8
dir_path = /home/me/Desktop/datasets/image-dataset/test/

subprocess.call('ffmpeg -ss 30 -i ' + stream + f' -frames:v 100 -r 0.1 -f image2 {dir_path}/' + str(id) + '_' + '_%03d.jpg> /dev/null 2>&1 < /dev/null &', shell=True)



    


    I get 100 screenshots that are all taken at the same time. So, for some reason, FFmpeg behaves differently on PyCharm..

    


  • lavfi/drawtext : ignore final LF of textfile.

    30 novembre 2020, par Nicolas George
    lavfi/drawtext : ignore final LF of textfile.
    

    A standard text file ends with a final LF.
    Without this change, it is interpreted as an empty final line,
    and visible with the box option.
    The current behavior can be achieved by actually having
    an empty line at the end of the file.

    Fix trac ticket #7948.

    • [DH] libavfilter/vf_drawtext.c