Recherche avancée

Médias (91)

Autres articles (100)

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

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, 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 (...)

Sur d’autres sites (8091)

  • Video capturing in portrait mode but the orientation is wrong when played back with a media player

    17 octobre 2016, par Ahmed Mujtaba

    I’m trying to make a custom video app. The app captures a video using mediarecorder and uploads it to the website where it’s played on a html5 media player. The issue is that, when I capture the video in portrait mode, the playback video on the website and on vlc player have it’s orientation off by 90 degrees. I have tried various solution on the internet but none work for me.

    Here’s what my code for setting up the media recorder :

    private bool prepareMediaRecorder() {

           Android.Hardware.Camera.Parameters p = mCamera.GetParameters();
           List previewSizes = p.SupportedPreviewSizes.ToList();

           //mCamera = GetCameraInstance();
           //setCameraDisplayOrientation(Activity, cameraId, mCamera);

           mediaRecorder = new MediaRecorder();
           mCamera.Unlock();
           mediaRecorder.SetCamera(mCamera);

           mediaRecorder.SetAudioSource(AudioSource.Camcorder);
           mediaRecorder.SetVideoSource(VideoSource.Camera);
           mediaRecorder.SetOrientationHint(CameraS.result);

           if (currentapiVersion >= 16)
           {
               mediaRecorder.SetProfile(CamcorderProfile.Get(CamcorderQuality.High)); // requires API Level 8 or higher
           }
           else
           {
               mediaRecorder.SetProfile(CamcorderProfile.Get(CamcorderQuality.Q480p)); // requires API Level 8 or higher
           }

           //mediaRecorder.SetVideoFrameRate(30);
           mediaRecorder.SetOutputFile(localPath);
           mediaRecorder.SetMaxDuration(600000); // Set max duration 60 sec.
           mediaRecorder.SetMaxFileSize(50000000); // Set max file size 50M
           mediaRecorder.SetVideoSize(previewSizes[0].Width, previewSizes[0].Height);
           mediaRecorder.SetPreviewDisplay(mPreview.Holder.Surface);

           mediaRecorder.SetOrientationHint(getDisplayOrientationAngle());

           try
           {
               mediaRecorder.Prepare();
           }
           catch (IllegalStateException e)
           {
               releaseMediaRecorder();
               return false;
           }
           catch (Java.IO.IOException e)
           {
               releaseMediaRecorder();
               return false;
           }
           return true;

    }

    public int getDisplayOrientationAngle() {
           //Log.e("", "setDisplayOrientationAngle is call");
           int angle;


           var mDisplayRotation = Activity.WindowManager.DefaultDisplay.Rotation;
           // switch (MeasurementNativeActivity.DisplayRotation) {
           switch (mDisplayRotation)
           {
               case SurfaceOrientation.Rotation0: // This is display orientation
                   angle = 90; // This is camera orientation
                   break;
               case SurfaceOrientation.Rotation90:
                   angle = 0;
                   break;
               case SurfaceOrientation.Rotation180:
                   angle = 270;
                   break;
               case SurfaceOrientation.Rotation270:
                   angle = 180;
                   break;
               default:
                   angle = 90;
                   break;
           }
           //Log.v("", "media recorder displayRotation: " + mDisplayRotation);
           //Log.v("", "media recorder angle: " + angle);
           return angle;

    }

    The orientation of the video is fine when played on the phone app but on the website it’s not. I tried to use FFMPEG encoder to rotate the video clockwise. This seemed to fix the orientation of the video, however the aspect ratio of the video is all messed up. The video is stretched vertically and goes off screen.
    The command I’m using to rotate and encode the video is as follows :

    -y -i inputPath -vf scale=640:480,setsar=1,transpose=1 -strict experimental -r 25 -vcodec mpeg4 -b 1000k ab 48000 -ac 2 -ar 22050 destinationPath

    I will really appreciate if someone can help me fix either the orientation of the video or the aspect ration after encoding the video.

    Cheers !

    Edit.

    Here’s the readout of the input file :

    General
    Complete name                  : C:\Users\Ahmed\Desktop\9adcdb56-500e-4d3f-8fb2-ccf20c680422_yt.mp4
    Format                         : MPEG-4
    Format profile                 : Base Media
    Codec ID                       : isom
    File size                      : 6.30 MiB
    Duration                       : 12s 437ms
    Overall bit rate               : 4 251 Kbps
    Encoded date                   : UTC 2016-05-29 23:54:30
    Tagged date                    : UTC 2016-05-29 23:54:30

    Video
    ID                             : 1
    Format                         : AVC
    Format/Info                    : Advanced Video Codec
    Format profile                 : Baseline@L3.1
    Format settings, CABAC         : No
    Format settings, ReFrames      : 1 frame
    Format settings, GOP           : M=1, N=31
    Codec ID                       : avc1
    Codec ID/Info                  : Advanced Video Coding
    Duration                       : 12s 323ms
    Bit rate                       : 3 967 Kbps
    Width                          : 1 280 pixels
    Height                         : 720 pixels
    Display aspect ratio           : 16:9
    Rotation                       : 90°
    Frame rate mode                : Variable
    Frame rate                     : 29.700 fps
    Minimum frame rate             : 29.354 fps
    Maximum frame rate             : 30.040 fps
    Color space                    : YUV
    Chroma subsampling             : 4:2:0
    Bit depth                      : 8 bits
    Scan type                      : Progressive
    Bits/(Pixel*Frame)             : 0.145
    Stream size                    : 5.83 MiB (92%)
    Title                          : VideoHandle
    Language                       : English
    Encoded date                   : UTC 2016-05-29 23:54:30
    Tagged date                    : UTC 2016-05-29 23:54:30

    Audio
    ID                             : 2
    Format                         : AAC
    Format/Info                    : Advanced Audio Codec
    Format profile                 : LC
    Codec ID                       : 40
    Duration                       : 12s 437ms
    Source duration                : 12s 454ms
    Bit rate mode                  : Constant
    Bit rate                       : 128 Kbps
    Nominal bit rate               : 96.0 Kbps
    Channel(s)                     : 2 channels
    Channel positions              : Front: L R
    Sampling rate                  : 48.0 KHz
    Compression mode               : Lossy
    Stream size                    : 194 KiB (3%)
    Source stream size             : 194 KiB (3%)
    Title                          : SoundHandle
    Language                       : English
    Encoded date                   : UTC 2016-05-29 23:54:30
    Tagged date                    : UTC 2016-05-29 23:54:30
    mdhd_Duration                  : 12454
  • HLS encoded video audio (ffmpeg) drops when seeking past buffer on Safari

    13 juin 2019, par eschie

    Some of my HLS encoded videos via ffmpeg drop the audio when seeking past the buffer. The only way to sync the audio and video up again is to restart the video. What would be causing this ?

    Example Profile :

    bitrate: 4800, profile: 'high', level: '4.1', resolution: 1080, framerate: '24000/1001'
    ffmpeg
       '-y'
       '-i' input_file.mov                                                
       '-v' error
       '-map' '0:0'                                                        
       '-c:v' libx264                                                  
       '-x264opts' f'
           keyint=23:                  
           min-keyint=23:          
           no-scenecut                                                    
       '
       '-vf' f'scale=-1:1080'
       '-preset' 'slow'
       '-profile:v' 'high'
       '-level' '4.1'
       '-b:v' '4800k'
       '-maxrate' '4800k'
       '-movflags' 'faststart'
       '-bufsize' '9600k'
       '-write_tmcd', '0'
       '-r' '24000/1001'                                  
       output_dir                                                      

    Segmentation CMD :

    FFMPEG
       '-i' output_dir
       '-v' 'error'
       '-acodec' 'copy'
       '-vcodec' 'copy'
       '-hls_time' '4' #seconds
       '-hls_list_size' '0'
       '-hls_flags' 'single_file'
       os.path.join(output_dir, f'{run_id}_{bitrate}.m3u8'

    Added : apple’s mediastreamvalidator outputs a few different errors :

    Error: Playlist vs segment duration mismatch
    --> Detail:  Segment duration 98.0146, Playlist duration: 4.7968
    --> Source:  1559962503399_2200k.m3u8 - 1559962503399_2200k.ts:1746520@0
    Error: Measured peak bitrate compared to master playlist declared value exceeds error tolerance
    --> Detail:  Measured: 3182.61 kb/s, Master playlist: 2173.82 kb/s, Error: 46.41%, Combined rendition name: English
    --> Source:  ...playlist.m3u8
    --> Compare: 1559962503399_2200k.m3u8
    Error: Different target durations detected
    --> Detail:  Target duration: 5 vs Target duration: 4
    --> Source:  1559962503399_64k.m3u8
    --> Compare: 1559962503399_128k.m3u8
  • ffmpeg transcode to hls and multiple aac audio tracks

    23 août 2023, par Aquarius

    I'm trying to transcode h264 mp4 file to HLS format with multiple AAC audio tracks. On Windows browsers everythins works like a shine. There's an option to switch audio track

    


    audio track switcher

    


    It doesn't work on Android devices or TV. On Android Opera browser video works with sound, but screen stuck while seeking and there's no option to switch audio track. On TV browser video works, it doesn't stuck when seeking but also no option to switch audio track

    


    Using video.js player on site. Below code for transcode and produced manifest file

    


    ffmpeg -i "file.mp4" -i PL-6ch.aac -i EN-6ch.aac -map 0:v -map 1:a -map 2:a -c:v copy -c:a:0 aac -ac:a:0 6 -af channelmap=channel_layout=5.1 -c:a:1 aac -ac:a:1 6 -af channelmap=channel_layout=5.1 -tag:v:0 h264 -b:v:0 2500k -tag:a:0 aac -b:a:0 384k -tag:a:1 aac -b:a:1 384k -f hls -hls_time 10 -hls_playlist_type vod -hls_list_size 0 -master_pl_name file.m3u8 -var_stream_map "v:0,agroup:AAC a:0,agroup:AAC,language:pl a:1,agroup:AAC,language:en" file_%v_.m3u8


    


    #EXTM3U
#EXT-X-VERSION:3
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="AAC",NAME="Polish",AUTOSELECT=YES,DEFAULT=YES,LANGUAGE="pl",URI="file_1_.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="AAC",NAME="English",AUTOSELECT=YES,DEFAULT=NO,LANGUAGE="en",URI="file_2_.m3u8"
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3172400,RESOLUTION=1920x872,CODECS="avc1.640029,mp4a.40.2",AUDIO="AAC" 
file_0_.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=422400,CODECS="mp4a.40.2",AUDIO="AAC"
file_1_.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=422400,CODECS="mp4a.40.2",AUDIO="AAC"
file_2_.m3u8


    


    Any clues what's wrong ?