Recherche avancée

Médias (91)

Autres articles (107)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • 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 (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

Sur d’autres sites (10690)

  • How to read the timecode from a DPX file via Python

    20 janvier 2020, par Mike McReynolds

    As part of a larger script, I need to be able to read the timecode off of a DPX file. I have ffmpeg and ffprobe, but I’m a beginner when it comes to using those programs.

    For MOV files, I was able to cobble this together :

    def GetStartingTimecodeFromMOV(Filename):
       cmd = "ffprobe -v quiet -print_format json -show_streams -show_format"
       args = shlex.split(cmd)
       args.append(Filename)
       String = subprocess.check_output(args).decode('utf-8')
       for Line in String.split("\n"):
           if Line.count("timecode"):
               Timecode = Line.split("\"")[3]
               return Timecode

    ...but their must be some subtle difference in the metadata between a MOV file and a DPX. Any help would be appreciated.

    If I try....

    ffprobe -v quiet -show_streams -show_format
    "/Render/MyFile/MyFile.0001016.dpx"

    ...then I get a lot of useful info, including resolution and FPS, but not timecode (at least for a DPX file)

    [STREAM]
    index=0
    codec_name=dpx
    codec_long_name=DPX (Digital Picture Exchange) image
    profile=unknown
    codec_type=video
    codec_time_base=0/1
    codec_tag_string=[0][0][0][0]
    codec_tag=0x0000
    width=1920
    height=1600
    coded_width=1920
    coded_height=1600
    has_b_frames=0
    sample_aspect_ratio=1:1
    display_aspect_ratio=6:5
    pix_fmt=rgb48be
    level=-99
    color_range=unknown
    color_space=unknown
    color_transfer=unknown
    color_primaries=unknown
    chroma_location=unspecified
    field_order=unknown
    timecode=N/A
    refs=1
    id=N/A
    r_frame_rate=25/1
    avg_frame_rate=0/0
    time_base=1/25
    start_pts=N/A
    start_time=N/A
    duration_ts=N/A
    duration=N/A
    bit_rate=N/A
    max_bit_rate=N/A
    bits_per_raw_sample=16
    nb_frames=N/A
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=0
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    [/STREAM]
    [FORMAT]
    filename=/Render/MyFile/MyFile.0001016.dpx
    nb_streams=1
    nb_programs=0
    format_name=dpx_pipe
    format_long_name=piped dpx sequence
    start_time=N/A
    duration=N/A
    size=18440192
    bit_rate=N/A
    probe_score=51
    [/FORMAT]
  • Python : Extracting device and lens information from video metadata

    14 mai 2023, par cat_got_my_tongue

    I am interested in extracting device and lens information from videos. Specifically, make and model of the device and the focal length. I was able to do this successfully for still images using the exifread module and extract a whole bunch of very useful information :

    


    image type      : MPO
Image ImageDescription: Shot with DxO ONE
Image Make: DxO
Image Model: DxO ONE
Image Orientation: Horizontal (normal)
Image XResolution: 300
Image YResolution: 300
Image ResolutionUnit: Pixels/Inch
Image Software: V3.0.0 (2b448a1aee) APP:1.0
Image DateTime: 2022:04:05 14:53:45
Image YCbCrCoefficients: [299/1000, 587/1000, 57/500]
Image YCbCrPositioning: Centered
Image ExifOffset: 158
Thumbnail Compression: JPEG (old-style)
Thumbnail XResolution: 300
Thumbnail YResolution: 300
Thumbnail ResolutionUnit: Pixels/Inch
Thumbnail JPEGInterchangeFormat: 7156
Thumbnail JPEGInterchangeFormatLength: 24886
EXIF ExposureTime: 1/3
EXIF FNumber: 8
EXIF ExposureProgram: Aperture Priority
EXIF ISOSpeedRatings: 100
EXIF SensitivityType: ISO Speed
EXIF ISOSpeed: 100
EXIF ExifVersion: 0221
EXIF DateTimeOriginal: 2022:04:05 14:53:45
EXIF DateTimeDigitized: 2022:04:05 14:53:45
EXIF ComponentsConfiguration: CrCbY
EXIF CompressedBitsPerPixel: 3249571/608175
EXIF ExposureBiasValue: 0
EXIF MaxApertureValue: 212/125
EXIF SubjectDistance: 39/125
EXIF MeteringMode: MultiSpot
EXIF LightSource: Unknown
EXIF Flash: Flash did not fire
EXIF FocalLength: 1187/100
EXIF SubjectArea: [2703, 1802, 675, 450]
EXIF MakerNote: [68, 88, 79, 32, 79, 78, 69, 0, 12, 0, 0, 0, 21, 0, 3, 0, 5, 0, 2, 0, ... ]
EXIF SubSecTime: 046
EXIF SubSecTimeOriginal: 046
EXIF SubSecTimeDigitized: 046
EXIF FlashPixVersion: 0100
EXIF ColorSpace: sRGB
EXIF ExifImageWidth: 5406
EXIF ExifImageLength: 3604
Interoperability InteroperabilityIndex: R98
Interoperability InteroperabilityVersion: [48, 49, 48, 48]
EXIF InteroperabilityOffset: 596
EXIF FileSource: Digital Camera
EXIF ExposureMode: Auto Exposure
EXIF WhiteBalance: Auto
EXIF DigitalZoomRatio: 1
EXIF FocalLengthIn35mmFilm: 32
EXIF SceneCaptureType: Standard
EXIF ImageUniqueID: C01A1709306530020220405185345046
EXIF BodySerialNumber: C01A1709306530


    


    Unfortunately, I have been unable to extract this kind of info from videos so far.

    


    This is what I have tried so far, with the ffmpeg module :

    


    import ffmpeg
from pprint import pprint

test_video = "my_video.mp4"
pprint(ffmpeg.probe(test_video)["streams"])


    


    And the output I get contains a lot of info but nothing related to the device or lens, which is what I am looking for :

    


    [{'avg_frame_rate': '30/1',
  'bit_rate': '1736871',
  'bits_per_raw_sample': '8',
  'chroma_location': 'left',
  'codec_long_name': 'H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10',
  'codec_name': 'h264',
  'codec_tag': '0x31637661',
  'codec_tag_string': 'avc1',
  'codec_time_base': '1/60',
  'codec_type': 'video',
  'coded_height': 1088,
  'coded_width': 1920,
  'display_aspect_ratio': '16:9',
  'disposition': {'attached_pic': 0,
                  'clean_effects': 0,
                  'comment': 0,
                  'default': 1,
                  'dub': 0,
                  'forced': 0,
                  'hearing_impaired': 0,
                  'karaoke': 0,
                  'lyrics': 0,
                  'original': 0,
                  'timed_thumbnails': 0,
                  'visual_impaired': 0},
  'duration': '20.800000',
  'duration_ts': 624000,
  'has_b_frames': 0,
  'height': 1080,
  'index': 0,
  'is_avc': 'true',
  'level': 40,
  'nal_length_size': '4',
  'nb_frames': '624',
  'pix_fmt': 'yuv420p',
  'profile': 'Constrained Baseline',
  'r_frame_rate': '30/1',
  'refs': 1,
  'sample_aspect_ratio': '1:1',
  'start_pts': 0,
  'start_time': '0.000000',
  'tags': {'creation_time': '2021-05-08T13:23:20.000000Z',
           'encoder': 'AVC Coding',
           'handler_name': 'VideoHandler',
           'language': 'und'},
  'time_base': '1/30000',
  'width': 1920},
 {'avg_frame_rate': '0/0',
  'bit_rate': '79858',
  '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_time_base': '1/48000',
  'codec_type': 'audio',
  'disposition': {'attached_pic': 0,
                  'clean_effects': 0,
                  'comment': 0,
                  'default': 1,
                  'dub': 0,
                  'forced': 0,
                  'hearing_impaired': 0,
                  'karaoke': 0,
                  'lyrics': 0,
                  'original': 0,
                  'timed_thumbnails': 0,
                  'visual_impaired': 0},
  'duration': '20.864000',
  'duration_ts': 1001472,
  'index': 1,
  'max_bit_rate': '128000',
  'nb_frames': '978',
  'profile': 'LC',
  'r_frame_rate': '0/0',
  'sample_fmt': 'fltp',
  'sample_rate': '48000',
  'start_pts': 0,
  'start_time': '0.000000',
  'tags': {'creation_time': '2021-05-08T13:23:20.000000Z',
           'handler_name': 'SoundHandler',
           'language': 'und'},
  'time_base': '1/48000'}]


    


    Are these pieces of info available for videos ? Should I be using a different package ?

    


    Thanks.

    


    Edit :

    


    pprint(ffmpeg.probe(test_video)["format"]) gives

    


    {'bit_rate': '1815244',
 'duration': '20.864000',
 'filename': 'my_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': '4734158',
 'start_time': '0.000000',
 'tags': {'artist': 'Microsoft Game DVR',
          'compatible_brands': 'mp41isom',
          'creation_time': '2021-05-08T12:12:33.000000Z',
          'major_brand': 'mp42',
          'minor_version': '0',
          'title': 'Snipping Tool'}}


    


  • Taking care of silent priming frames converting mp4 to ts ?

    13 février 2019, par keepitterron
    videoOutputSettings = [
     AVVideoCodecKey: AVVideoCodecH264,
     AVVideoWidthKey: width,
     AVVideoHeightKey: height,
     AVVideoCompressionPropertiesKey: [
       AVVideoAverageBitRateKey: avgBitRate,
       AVVideoExpectedSourceFrameRateKey: fps,
       AVVideoProfileLevelKey: AVVideoProfileLevelH264BaselineAutoLevel
     ]
    ]
    audioOutputSettings = [
     AVFormatIDKey: kAudioFormatMPEG4AAC,
     AVSampleRateKey: 44100,
     AVNumberOfChannelsKey: 2
    ]

    I record a video + audio with AVCaptureSession (screen, camera and mic in OSX) and i encode it with AVAssetWriter (AVFileType.mp4), swapping the writers every 6 seconds.
    Every time a new part is written, a nodeJS app will be notified and using ffmpeg will convert it to ts with

    ffmpeg -y -i generatedFile.mp4 -c copy -copyts -muxdelay 0 -muxpreload 0 outputFile.ts

    I’ll manually write a m3u8 looking like :

    #EXTM3U
    #EXT-X-VERSION:3
    #EXT-X-TARGETDURATION:7
    #EXT-X-MEDIA-SEQUENCE:0
    #EXT-X-PLAYLIST-TYPE:VOD
    #EXTINF:6.140227,
    11214532343c4cae953d45e94a1660ea-0.ts
    #EXTINF:6.284218,
    11214532343c4cae953d45e94a1660ea-1.ts
    #EXTINF:6.099999999999998,
    11214532343c4cae953d45e94a1660ea-2.ts
    #EXTINF:6.133333,
    11214532343c4cae953d45e94a1660ea-3.ts
    #EXTINF:6.133333,
    11214532343c4cae953d45e94a1660ea-4.ts
    #EXTINF:6.100000000000001,
    11214532343c4cae953d45e94a1660ea-5.ts
    #EXTINF:6.133333,
    11214532343c4cae953d45e94a1660ea-6.ts
    #EXTINF:6.199999999999996,
    11214532343c4cae953d45e94a1660ea-7.ts
    #EXTINF:6.0666670000000025,
    11214532343c4cae953d45e94a1660ea-8.ts
    #EXT-X-ENDLIST

    The issue is : I have audio gaps between parts and I believe is AAC’s priming frames not being handled correctly.
    Am I correct in assuming so ?

    example file

    ❯ afinfo 11.mp4
    File:           11.mp4
    File type ID:   mp4f
    Num Tracks:     1
    ----
    Data format:     2 ch,  44100 Hz, 'aac ' (0x00000000) 0 bits/channel, 0 bytes/packet, 1024 frames/packet, 0 bytes/frame
                   no channel layout.
    estimated duration: 6.128617 sec
    audio bytes: 87558
    audio packets: 266
    bit rate: 113407 bits per second
    packet size upper bound: 401
    maximum packet size: 401
    audio data file offset: 577163
    optimized
    audio 270272 valid frames + 2112 priming + 0 remainder = 272384
    format list:
    [ 0] format:      2 ch,  44100 Hz, 'aac ' (0x00000000) 0 bits/channel, 0 bytes/packet, 1024 frames/packet, 0 bytes/frame
    Channel layout: Stereo (L R)
    ----

    example file

    ❯ ffprobe -v error -show_format -show_streams 1.mp4
    [STREAM]
    index=0
    codec_name=h264
    codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
    profile=Baseline
    codec_type=video
    codec_time_base=1/60
    codec_tag_string=avc1
    codec_tag=0x31637661
    width=1920
    height=1080
    coded_width=1920
    coded_height=1088
    has_b_frames=0
    sample_aspect_ratio=1:1
    display_aspect_ratio=16:9
    pix_fmt=yuv420p
    level=40
    color_range=tv
    color_space=bt709
    color_transfer=bt709
    color_primaries=bt709
    chroma_location=bottom
    field_order=unknown
    timecode=N/A
    refs=1
    is_avc=true
    nal_length_size=4
    id=N/A
    r_frame_rate=30/1
    avg_frame_rate=30/1
    time_base=1/600
    start_pts=3600
    start_time=6.000000
    duration_ts=7260
    duration=12.100000
    bit_rate=4227137
    max_bit_rate=N/A
    bits_per_raw_sample=8
    nb_frames=183
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=1
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:creation_time=2019-02-13T13:21:51.000000Z
    TAG:language=und
    TAG:handler_name=Core Media Video
    [/STREAM]
    [STREAM]
    index=1
    codec_name=aac
    codec_long_name=AAC (Advanced Audio Coding)
    profile=LC
    codec_type=audio
    codec_time_base=1/44100
    codec_tag_string=mp4a
    codec_tag=0x6134706d
    sample_fmt=fltp
    sample_rate=44100
    channels=2
    channel_layout=stereo
    bits_per_sample=0
    id=N/A
    r_frame_rate=0/0
    avg_frame_rate=0/0
    time_base=1/44100
    start_pts=272991
    start_time=6.190272
    duration_ts=545352
    duration=12.366259
    bit_rate=115688
    max_bit_rate=128000
    bits_per_raw_sample=N/A
    nb_frames=269
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=1
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:creation_time=2019-02-13T13:21:51.000000Z
    TAG:language=und
    TAG:handler_name=Core Media Audio
    [/STREAM]
    [FORMAT]
    filename=1.mp4
    nb_streams=2
    nb_programs=0
    format_name=mov,mp4,m4a,3gp,3g2,mj2
    format_long_name=QuickTime / MOV
    start_time=6.000000
    duration=12.366259
    size=3317034
    bit_rate=2145860
    probe_score=100
    TAG:major_brand=mp42
    TAG:minor_version=1
    TAG:compatible_brands=mp41mp42isom
    TAG:creation_time=2019-02-13T13:21:51.000000Z
    [/FORMAT]

    Is there a way I can generate ts files with the encoder delay being taken care of ?