Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (56)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

Sur d’autres sites (3977)

  • Unable to convert mov to mp4 using ffmpeg carrierwave in ruby

    9 avril 2021, par LearningROR

    I am unable to convert MOV files to MP4 using carrierwave and FFmpeg.

    


    It does upload mp4 file but does not convert it to mp4 and so on browser only sound gets played not the video.

    


    What I am missing here ? I tried most of the solutions.

    


    Code :

    


    class VideoUploader < CarrierWave::Uploader::Base
  include CarrierWave::MiniMagick
  include CarrierWave::Video
  include CarrierWave::Video::Thumbnailer
  include CarrierWave::FFmpeg
  # Choose what kind of storage to use for this uploader:
  storage :file
  # Override the directory where uploaded files will be stored.
  # This is a sensible default for uploaders that are meant to be mounted:
  def store_dir
    "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
  end
  version :video, :if => :video? do
    process :encode
  end
  version :thumb do
    process thumbnail: [{format: 'jpg', quality: 8, size: 360, logger: Rails.logger, square: false}]
    def full_filename for_file
      jpg_name for_file, version_name
    end
  end
  def encode
    tmp_path = File.join( File.dirname(current_path), "tmpfile.mp4" )
    movie = FFMPEG::Movie.new(current_path)
    movie.transcode(tmp_path, custom: %w(-c:v libx264 -c:a aac -vf format=yuv420p -movflags +faststart)) do |progress|
      puts progress
    end
    File.rename tmp_path, current_path
  end
  protected
  def video?(new_file)
    new_file.content_type.include? 'video'
  end
end


    


    Logs :

    


    I, [2021-04-09T15:33:24.783337 #9397]  INFO -- : Running transcoding...
["/usr/local/bin/ffmpeg", "-y", "-i", "/Users/osx/workspace_ror/xxx-react/tmp/1617964403-459168728101935-0021-9213/video/sample_iTunes__1_.mov", "-c:v", "libx264", "-c:a", "aac", "-vf", "format=yuv420p", "-movflags", "+faststart", "/Users/osx/workspace_ror/xxx-react/tmp/1617964403-459168728101935-0021-9213/video/tmpfile.mp4"]

0.0
0.08304093567251461
0.1672514619883041
0.2327485380116959
0.3229239766081871
0.4008187134502924
0.45426900584795327
0.5033918128654971
0.5403508771929825
0.6100584795321637
0.663859649122807
0.711812865497076
0.7657309941520468
0.8196491228070175
0.87953216374269
0.9394152046783625
1.0
1.0
I, [2021-04-09T15:33:33.555508 #9397]  INFO -- : Transcoding of /Users/osx/workspace_ror/xxx-react/tmp/1617964403-459168728101935-0021-9213/video/sample_iTunes__1_.mov to /Users/osx/workspace_ror/xxx-react/tmp/1617964403-459168728101935-0021-9213/video/tmpfile.mp4 succeeded

Running....ffmpegthumbnailer -i /Users/osx/workspace_ror/xxx-react/tmp/1617964403-459168728101935-0021-9213/thumb/sample_iTunes__1_.mov -o /Users/osx/workspace_ror/xxx-react/tmp/1617964403-459168728101935-0021-9213/thumb/tmpfile.jpg -c jpg -q 8 -s 360
Success!


    


  • Metadict in ffmpeg does not have rotate information

    14 juillet 2022, par Lucky Sunda

    My 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 ?

    


  • FFmpeg giving a wierd "Permission denied" error (Digitalocean VPS Ubuntu 18.04)

    10 mai 2021, par DJ Danny

    I've set up a VPS server on Digitalocean. Installed Ubuntu 18.04, LAMP, etc.
Finally, I installed ffmpeg. It is working fine from terminal but when I try to execute it through php it gives a weird "Permission denied" error :

    


    Here is some information :

    
root@vl :/# whereis ffmpeg
    
ffmpeg : /usr/local/bin/ffmpeg
    
root@vl :/# whereis ffprobe
    
ffprobe : /usr/local/bin/ffprobe

    


    root@vl :/# ffmpeg -version
    
ffmpeg version N-102461-g8649f5dca6 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1 18.04)
configuration : —prefix=/usr/local/ffmpeg_build —pkg-config-flags=—static —extra-cflags=-I/usr/local/ffmpeg_build/include —extra-ldflags=-L/usr/local/ffmpeg_build/lib —extra-libs='-lpthread -lm' —ld=g++ —bindir=/usr/local/bin —enable-gpl —enable-gnutls —enable-libaom —enable-libass —enable-libfdk-aac —enable-libfreetype —enable-libmp3lame —enable-libopus —enable-libsvtav1 —enable-libvorbis —enable-libvpx —enable-libx264 —enable-libx265 —enable-nonfree
libavutil 57. 0.100 / 57. 0.100
libavcodec 59. 1.100 / 59. 1.100
libavformat 59. 0.101 / 59. 0.101
libavdevice 59. 0.100 / 59. 0.100
libavfilter 8. 0.101 / 8. 0.101
libswscale 6. 0.100 / 6. 0.100
libswresample 4. 0.100 / 4. 0.100
libpostproc 56. 0.100 / 56. 0.100


    


    My php file :

    

echo shell_exec("ffmpeg -i mj.gif -profile:v baseline -pix_fmt yuv420p -vf scale=600 :-2 output.mp4 2>&1")
    
 ?>

    


    The ERROR ! :
    
ffmpeg version N-102461-g8649f5dca6 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 7 (Ubuntu 7.5.0-3ubuntu1 18.04) configuration : —prefix=/usr/local/ffmpeg_build —pkg-config-flags=—static —extra-cflags=-I/usr/local/ffmpeg_build/include —extra-ldflags=-L/usr/local/ffmpeg_build/lib —extra-libs='-lpthread -lm' —ld=g++ —bindir=/usr/local/bin —enable-gpl —enable-gnutls —enable-libaom —enable-libass —enable-libfdk-aac —enable-libfreetype —enable-libmp3lame —enable-libopus —enable-libsvtav1 —enable-libvorbis —enable-libvpx —enable-libx264 —enable-libx265 —enable-nonfree libavutil 57. 0.100 / 57. 0.100 libavcodec 59. 1.100 / 59. 1.100 libavformat 59. 0.101 / 59. 0.101 libavdevice 59. 0.100 / 59. 0.100 libavfilter 8. 0.101 / 8. 0.101 libswscale 6. 0.100 / 6. 0.100 libswresample 4. 0.100 / 4. 0.100 libpostproc 56. 0.100 / 56. 0.100 Input #0, gif, from 'mj.gif' : Duration : 00:00:01.60, start : 0.000000, bitrate : 22863 kb/s Stream #0:0 : Video : gif, bgra, 1400x1050, 10 fps, 10 tbr, 100 tbn output.mp4 : Permission denied


    
From the past 24 hours I've tried installing ffmpeg in different ways (compiling & apt install), I've also tried changing the permission but still I'm stuck with this error.
    
Any help would be highly appreciated !
    
Thanks