Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (41)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • 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

Sur d’autres sites (8693)

  • Can't split 24bit flac files on the command line [closed]

    21 mars 2023, par Martin

    I am trying to export a 24bit flac file in my ubuntu terminal. I've tried two different methods, but neither work.

    


    Method 1 : shntool

    


    when I run this command :
shntool split -f times.cue -O always -o lowq_full_silence.flac

    


    where lowq_full_silence.flac was rendered in audacity as a flac file with level=0 and bit depth=16 bit, my command works.

    


    but if i run this command :

    


    shntool split -f times.cue -O always -o full_hq.flac

    


    where full_hq.flac has level=8 and bit depth=24 bit
The command fails :

    


    shntool [split]: warning: unsupported format 0xfffe (Unknown) while processing file: [full_hq.flac]
shntool [split]: error: cannot continue due to error(s) shown above


    


    https://bugs.launchpad.net/ubuntu/+source/shntool/+bug/2000794

    


    Method 2 : ffmpeg

    


    Trying to split the flac file with comma separated 'split points' input

    


    ffmpeg -i "full_hq.flac" -c copy -map 0 -f segment -segment_times "22,441,556,559" "%d_output.flac"

    


    But the output from this ffmpeg command has broken length metadata :

    


    https://trac.ffmpeg.org/ticket/4905

    


    Is there a better way to split a high quality 24bit flac file into individual segments, where each exported segment file has correct length metadata ?

    


    Files :
https://file.io/lvGTUEgQArb7

    


  • avcodec : add common fflcms2 boilerplate

    28 juin 2022, par Niklas Haas
    avcodec : add common fflcms2 boilerplate
    

    Handling this in general code makes more sense than handling it in
    individual codec files, because it would be a lot of unnecessary code
    duplication for the plenty of formats that support exporting ICC
    profiles (jpg, png, tiff, webp, jxl, ...).

    encode.c and decode.c will be in charge of initializing this state as
    needed, so we merely need to make sure to uninit it afterwards from the
    common destructor path.

    Signed-off-by : Niklas Haas <git@haasn.dev>

    • [DH] configure
    • [DH] libavcodec/Makefile
    • [DH] libavcodec/avcodec.c
    • [DH] libavcodec/decode.c
    • [DH] libavcodec/internal.h
  • ffmpeg h264 to mp4 conversion from multiple files fails to preserve in-sequence resolution changes

    1er juillet 2023, par LB2

    This will be a long post, so I thank you in advance for your patience in digesting it.

    &#xA;

    Context

    &#xA;

    I have different sources that generate visual content that eventually need to be all composed into a single .mp4 file. The sources are :

    &#xA;

      &#xA;
    • H.264 video (encoded using CUDA NVENC).&#xA;
        &#xA;
      • This video can have in-sequence resolution change that is natively supported by H.264 codec.
      • &#xA;

      • I.e. stream may start as HxW resolution and mid-stream change to WxH. This behavior happens because it comes from a camera device that can be rotated and flipped between portrait and landscape (e.g. think of a phone camera recording video and phone being flipped from one orientation to another, and video recording adjusting its encoding for proper video scaling and orientation).
      • &#xA;

      • When rotation occurs, most of the time H & W are just swaps, but may actually be entirely new values — e.g. in some cases 1024x768 will switch to 768x1024, but in other cases 1024x768 may become 460x640 (depends on source camera capabilities that I have no control over).
      • &#xA;

      &#xA;

    • &#xA;

    • JPEGs. A series (a.k.a. batch) of still JPEGs.&#xA;
        &#xA;
      • The native resolution of JPEGs may or may not match the video resolution in the earlier bullet.
      • &#xA;

      • JPEGs can also reflect rotation of device and so some JPEGs in a sequence may start at HxW resolution and then from some arbitrary JPEG file can flip and become WxH. Similar to video, resolution dimensions are likely to be just a swap, but may become altogether different values.
      • &#xA;

      &#xA;

    • &#xA;

    • There can be any number of batches and intermixes between video and still sources. E.g. V1 + S2 + S3 + V4 + V5 + V6 + S7 + ...
    • &#xA;

    • There can be any number of resolution changes between or within batches. e.g. V1 ;r1 + V1 ;r2 + S2 ;r1 + S2 ;r3 + V3 ;r2 + ... (where first subscript is batch sequence ; rX is resolution)
    • &#xA;

    &#xA;

    Problem

    &#xA;

    I'm attempting to do this conversion with ffmpeg and can't quite get it right. The problem is that I can't get output to respect source resolutions, and it just squishes all into a single output resolution.

    &#xA;

    Example of squishing problem

    &#xA;

    As already mentioned above, H.264 supports resolution changes in-sequence (mid-stream), and it should be possible to convert and concatenate all the content and have final output contain in-sequence resolution changes.

    &#xA;

    Since MP4 is just a container, I'm assuming that MP4 files can do so as well ?

    &#xA;

    Attempts so far

    &#xA;

    The approach thus far has been to take each batch of content (i.e. .h264 video or a set of JPEGs), and individually convert to .mp4. Video is converted using -c copy to ensure it doesn't try to transcode, e.g. :

    &#xA;

    ffmpeg -hide_banner -i videoX.h264 -c copy -vsync vfr -video_track_timescale 90000 intermediateX.mp4&#xA;

    &#xA;

    ... and JPEGs are converted using -f concat

    &#xA;

    ffmpeg -hide_banner -f concat -safe 0 -i jpegsX.txt -vf &#x27;scale=trunc(iw/2)*2:trunc(ih/2)*2&#x27; -r 30 -vsync vfr -video_track_timescale 90000 intermediateX.mp4&#xA;

    &#xA;

    ... and then all the intermediates concatenated together

    &#xA;

    ffmpeg -hide_banner -f concat -safe 0 -i final.txt -pix_fmt yuv420p -c copy -vsync vfr -video_track_timescale 90000 -metadata title=&#x27;yabadabadoo&#x27; -fflags &#x2B;bitexact -flags:v &#x2B;bitexact -flags:a &#x2B;bitexact final.mp4&#xA;

    &#xA;

    This concatenates, but if resolution changes at some mid point, then that part of content comes up squished/stretched in final output.

    &#xA;

    Use h.264 as intermediates

    &#xA;

    All the intermediates are produced the same, except as .h264. All intermediate .h264 are cat'ed together like `cat intermediate1.h264 intermediate2.264 > final.h264.

    &#xA;

    If final output is final.mp4, the output is incorrect and images are squished/stretched.

    &#xA;

    If final.h264, then at least it seems to be respecting aspect ratios of input and managing to produce correctly looking output. However, examining with ffprobe it seems that it uses SAR weird ratios, where first frames are width=1440 height=3040 sample_aspect_ratio=1:1, but later SAR takes on values like width=176 height=340 sample_aspect_ratio=1545:176, which I suspect isn't right, since all original input was with "square pixels". I think the reason for it is that it was composed out of different sized JPEGs, and concat filter somehow caused ffmpeg to manipulate SAR "to get things fit".

    &#xA;

    But at least it renders respectably, though hard to say with ffplay if player would actually see resolution change and resize accordingly .

    &#xA;

    And, that's .h264 ; and I need final output to be .mp4.

    &#xA;

    Use -vf filter

    &#xA;

    I tried enforcing SAR using -vf &#x27;scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=1:1&#x27; (scaling is to deal with odd dimension JPEGs), but it still produces frames with SAR like stated earlier.

    &#xA;

    Other thoughts

    &#xA;

    For now, while I haven't given up, I'm trying to avoid in my code examining each individual JEPG in a batch to see if there are differing sizes, and splitting batch so that each sub-batch is homogenous resolution-wise, and generating individual intermediate .h264 so that SAR remains sane, and keep fingers crossed that the final would work correctly. It'll be very slow, unfortunately.

    &#xA;

    Question

    &#xA;

    What's the right way to deal with all that using ffmpeg, and how to concatenate mulitple varying resolution sources into a final mp4 so that it respects resolution changes mid-stream ?

    &#xA;