Recherche avancée

Médias (91)

Autres articles (43)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

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

  • L’espace de configuration de MediaSPIP

    29 novembre 2010, par

    L’espace de configuration de MediaSPIP est réservé aux administrateurs. Un lien de menu "administrer" est généralement affiché en haut de la page [1].
    Il permet de configurer finement votre site.
    La navigation de cet espace de configuration est divisé en trois parties : la configuration générale du site qui permet notamment de modifier : les informations principales concernant le site (...)

Sur d’autres sites (4427)

  • How to embed subtitles to .mp4 movie using ffmpeg

    25 novembre 2016, par hudac

    I’m trying to embed subtitles I wrote to a movie I created.
    I’m using FFmpeg version : ffmpeg-20150418-git-edbb9b5-win64-static with the command :
    ffmpeg -i in.mp4 -f srt -i subs.srt -c:v copy -c:a copy -c:s mov_text out.mp4 I saw here.

    But I get errors during the process, and when the process is done there’s an output file out.mp4 without subtitles embedded.
    When I play the in.mp4 in some player such as media player classic with the subtitles separately, the subtitles are sync and everything is fine.

    The subtitles are subrip encoded in UTF8.

    I tried to look out for these errors but didn’t find anything useful. it seems something ridiculous.
    What am I doing wrong ?

    Errors such as :

    [mp4 @ 00000000003fe020] Codec for stream 0 does not use global headers but container format requires global headers
    [mp4 @ 00000000003fe020] Codec for stream 1 does not use global headers but container format requires global headers
    [mp4 @ 00000000003fe020] Application provided duration: -8 / timestamp: 72205 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value

    Movie details from Media info :

    Video  
    ID: 1  
    Format: AVC  
    Format/Info: Advanced Video Codec  
    Format profile: Main@L4.2  
    Format settings, CABAC: Yes  
    Format settings, ReFrames: 3 frames  
    Format settings, GOP: M=4, N=24  
    Codec ID: avc1  
    Codec ID/Info: Advanced Video Coding  
    Duration: 8mn 32s  
    Source duration: 8mn 32s  
    Bit rate: 23.4 Mbps  
    Width: 1920 pixels  
    Height: 1080 pixels  
    Display aspect ratio: 16:9  
    Original display aspect ratio: 2.2:1  
    Frame rate mode: Variable  
    Frame rate: 23.976 fps  
    Minimum frame rate: 23.976 fps  
    Maximum frame rate: 24.000 fps  
    Standard: NTSC  
    Color space: YUV  
    Chroma subsampling: 4:2:0  
    Bit depth: 8 bits  
    Scan type: Progressive  
    Bits/(Pixel*Frame): 0.472  
    Stream size: 1.40 GiB (99%)  
    Source stream size: 1.40 GiB (99%)  
    Language: English  
    Encoded date: UTC 2015-04-28 20:31:41  
    Tagged date: UTC 2015-04-28 20:31:41  
    mdhd_Duration: 512137  

    Ffmpeg command output :

    ffmpeg version N-71497-gedbb9b5 Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.9.2 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
    le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
    ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
    able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
    --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
    ble-decklink --enable-zlib
     libavutil      54. 22.101 / 54. 22.101
     libavcodec     56. 34.100 / 56. 34.100
     libavformat    56. 30.100 / 56. 30.100
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 14.100 /  5. 14.100
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mp4':
     Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: mp42mp41
       creation_time   : 2015-04-28 20:31:41
     Duration: 00:08:32.17, start: 0.000000, bitrate: 23640 kb/s
       Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1920x1080 [SAR 40:33 DAR 640:297], 23444 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 t
    bc (default)
       Metadata:
         creation_time   : 2015-04-28 20:31:41
         handler_name    : ?Mainconcept Video Media Handler
         encoder         : AVC Coding
       Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
       Metadata:
         creation_time   : 2015-04-28 20:31:41
         handler_name    : #Mainconcept MP4 Sound Media Handler
    Input #1, srt, from 'subs.srt':
     Duration: N/A, bitrate: N/A
       Stream #1:0: Subtitle: subrip
    [mp4 @ 00000000003fe020] Codec for stream 0 does not use global headers but container format requires global headers
    [mp4 @ 00000000003fe020] Codec for stream 1 does not use global headers but container format requires global headers
    Output #0, mp4, to 'out.mp4':
     Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: mp42mp41
       encoder         : Lavf56.30.100
       Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 40:33 DAR 640:297], q=2-31, 23444 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 24k t
    bc (default)
       Metadata:
         creation_time   : 2015-04-28 20:31:41
         handler_name    : ?Mainconcept Video Media Handler
         encoder         : AVC Coding
       Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 189 kb/s (default)
       Metadata:
         creation_time   : 2015-04-28 20:31:41
         handler_name    : #Mainconcept MP4 Sound Media Handler
       Stream #0:2: Subtitle: mov_text ([8][0][0][0] / 0x0008)
       Metadata:
         encoder         : Lavc56.34.100 mov_text
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (copy)
     Stream #1:0 -> #0:2 (subrip (srt) -> mov_text (native))
    Press [q] to stop, [?] for help
    [mp4 @ 00000000003fe020] Application provided duration: -8 / timestamp: 72205 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -7 / timestamp: 74217 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -8 / timestamp: 76267 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -4 / timestamp: 77872 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -7 / timestamp: 79260 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -1 / timestamp: 88987 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -60 / timestamp: 91489 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -4 / timestamp: 108080 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -1 / timestamp: 112974 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -8 / timestamp: 115528 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -9 / timestamp: 122758 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -6 / timestamp: 124862 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -12 / timestamp: 130307 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -140 / timestamp: 150079 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -144 / timestamp: 156606 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -245 / timestamp: 158916 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -6 / timestamp: 231587 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -1 / timestamp: 234743 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -9 / timestamp: 239406 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -6 / timestamp: 242670 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -4 / timestamp: 249833 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -9 / timestamp: 252669 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -6 / timestamp: 257713 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -2 / timestamp: 272866 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -152 / timestamp: 276417 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -3 / timestamp: 290209 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -6 / timestamp: 302825 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -6 / timestamp: 305466 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -3 / timestamp: 314151 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -8 / timestamp: 315957 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -1 / timestamp: 322568 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -164 / timestamp: 333373 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -3 / timestamp: 379341 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -5 / timestamp: 385070 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -7 / timestamp: 396166 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -7 / timestamp: 402007 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -4 / timestamp: 404571 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -2 / timestamp: 418218 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -5 / timestamp: 428136 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -5 / timestamp: 433347 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -4 / timestamp: 438939 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -7 / timestamp: 445657 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -6 / timestamp: 449039 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -6 / timestamp: 451870 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    [mp4 @ 00000000003fe020] Application provided duration: -5 / timestamp: 456582 is out of range for mov/mp4 format
    [mp4 @ 00000000003fe020] pts has no value
    frame=12279 fps=138 q=-1.0 Lsize= 1477815kB time=00:08:32.16 bitrate=23637.2kbits/s
    video:1465658kB audio:11840kB subtitle:8kB other streams:0kB global headers:0kB muxing overhead: 0.020907%
  • FFMPEG concat demuxer - how to make file formats compatible ?

    10 avril 2015, par user206481

    I need to automate mp4 concatenation server-side and I’m using FFMPEG. I will get uploads of mp4 files and I want to attach a Title.mp4 and End.mp4 to each one. I am also overlaying a soundtrack (the input videos do not have sound) There is a potential high server load so I’d like to do it as efficiently as possible using ffmpeg’s concat demuxer to avoid re-encoding the video.

    After receiving samples of each file, I am not successful and I believe it is due to mismatched file formats. My result has good Title.mp4 and audio, then when the sample uploaded mp4 is supposed to play there is garbled green/pink/red pixels on the top half of the video, then the End.mp4 plays fine. Here is my ffmpeg command and output :

    $ ffmpeg -f concat -i <(printf "file '%s'\n" Title.mp4 Sample.mp4 End.mp4) -i SoundTrack.wav -c:v copy -strict -2 -y Out.mp4

    ffmpeg version 2.6.1 Copyright (c) 2000-2015 the FFmpeg developers
    built with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-55)
    configuration: --prefix=/home/dpmsmobi/ffmpeg_build --extra-cflags=-I/home/dpmsmobi/ffmpeg_build/include --extra-ldflags=-L/home/dpmsmobi/ffmpeg_build/lib --bindir=/home/dpmsmobi/bin --enable-gpl --enable-nonfree --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264
     libavutil      54. 20.100 / 54. 20.100
     libavcodec     56. 26.100 / 56. 26.100
     libavformat    56. 25.101 / 56. 25.101
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 11.102 /  5. 11.102
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, concat, from '/dev/fd/63':
     Duration: N/A, start: 0.000000, bitrate: 1810 kb/s
       Stream #0:0: Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 768x512 [SAR 1:1 DAR 3:2], 1810 kb/s, 30 fps, 30 tbr, 30k tbn, 60 tbc
    Guessed Channel Layout for  Input Stream #1.0 : stereo
    Input #1, wav, from 'SoundTrack.wav':
     Metadata:
       encoded_by      : Adobe Premiere Pro CC 2014 (Maci
       encoder         : Adobe Premiere Pro CC 2014 (Macintosh)
       date            : 2015-04-07
       creation_time   : 11:12:10
       time_reference  : 0
     Duration: 00:00:15.06, bitrate: 1551 kb/s
       Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 2 channels, s16, 1536 kb/s
    Output #0, mp4, to 'Out.mp4':
     Metadata:
       encoder         : Lavf56.25.101
       Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 768x512 [SAR 1:1 DAR 3:2], q=2-31, 1810 kb/s, 30 fps, 30 tbr, 30k tbn, 30k tbc
       Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 128 kb/s
       Metadata:
         encoder         : Lavc56.26.100 aac
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
    Press [q] to stop, [?] for help
    [concat @ 0x1dedc20] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
    [concat @ 0x1dedc20] DTS 69750 < 91000 out of order
    [mp4 @ 0x1f75060] Non-monotonous DTS in output stream 0:0; previous: 91000, current: 69750; changing to 91001. This may result in incorrect timestamps in the output file.

    <----- many more Non-monotonous DTS messages omitted here ---->

    frame=  427 fps=0.0 q=-1.0 Lsize=    4123kB time=00:00:15.06 bitrate=2242.5kbits/s    
    video:3873kB audio:236kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.344173%

    I can successfully concatenate the Title.mp4 to the End.mp4, and I can successfully concatenate two Sample.mp4 files, so I know I’ve got the ffmpeg command right. I can also successfully concat the files using the following ffmpeg command with filter_complex instead of concat demuxer (this takes considerably longer due to re-encoding) :

    ffmpeg -i Title.mp4 -i Sample.mp4 -i End.mp4 -i SoundTrack.wav -filter_complex '[0:0] [1:0] [2:0] concat=n=3:v=1 [v]' -map '[v]' -map 3:0 -crf 20 -strict -2 -y Out2.mp4

    Here is the MediaInfo output for each type of mp4 file :

    $ mediainfo Title.mp4
    General
    Complete name                            : Title.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media / Version 2
    Codec ID                                 : mp42
    File size                                : 693 KiB
    Duration                                 : 3s 100ms
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 1 831 Kbps
    Encoded date                             : UTC 2015-04-07 19:15:03
    Tagged date                              : UTC 2015-04-07 19:15:03
    ©TIM                                     : 00:00:00:00
    ©TSC                                     : 30
    ©TSZ                                     : 1

    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : Main@L3.1
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 3 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 3s 100ms
    Bit rate mode                            : Variable
    Bit rate                                 : 1 811 Kbps
    Maximum bit rate                         : 3 000 Kbps
    Width                                    : 768 pixels
    Height                                   : 512 pixels
    Display aspect ratio                     : 3:2
    Frame rate mode                          : Constant
    Frame rate                               : 30.000 fps
    Standard                                 : NTSC
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.154
    Stream size                              : 685 KiB (99%)
    Language                                 : English
    Encoded date                             : UTC 2015-04-07 19:15:03
    Tagged date                              : UTC 2015-04-07 19:15:03
    Color range                              : Limited

    $ mediainfo Sample.mp4
    General
    Complete name                            : Sample.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom
    File size                                : 2.93 MiB
    Duration                                 : 7s 9ms
    Overall bit rate                         : 3 505 Kbps
    Encoded date                             : UTC 1970-01-01 00:00:00
    Tagged date                              : UTC 1970-01-01 00:00:00
    Writing application                      : Lavf52.64.2

    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=30
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 7s 9ms
    Bit rate                                 : 3 500 Kbps
    Width                                    : 768 pixels
    Height                                   : 512 pixels
    Display aspect ratio                     : 3:2
    Frame rate mode                          : Variable
    Frame rate                               : 30.250 fps
    Minimum frame rate                       : 23.462 fps
    Maximum frame rate                       : 296.053 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.294
    Stream size                              : 2.92 MiB (100%)
    Language                                 : English
    Encoded date                             : UTC 1970-01-01 00:00:00
    Tagged date                              : UTC 1970-01-01 00:00:00

    I’m pretty sure it’s the mp42 vs isom Codec ID’s, and potentially the constant vs variable frame rates. I can’t change the input mp4’s but I know their format will stay the same. How can I reformat the Title and End mp4’s to match the input mp4 files so I can use ffmpeg concat demux ?

  • How can i create a portrait video using Android's MediaRecorder

    23 mars 2015, par urudroid

    I have an Android application which is able to record and play a videos in portrait mode, those features are working fine on Android phones.

    The issue comes up because this video is needed to be played also on iOS devices (after being shared through a server).

    iOS is not correctly showing the video as it looks "cropped", but videos recorded on iOS are played without issues.

    So, the main difference between videos created on Android and iOS’ is the size and the rotation.

    Im using CWAC-Camera library for preview and recording and ffmpeg to scale the video down to 320x568px (as this is the standard size for both Android and iOS apps).

    Here is the metadata from an video created from Android :

    General
    Complete name                            : android_video.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom
    File size                                : 447 KiB
    Duration                                 : 5s 596ms
    Overall bit rate                         : 654 Kbps
    Encoded date                             : UTC 1904-01-01 00:00:00
    Tagged date                              : UTC 1904-01-01 00:00:00
    Writing application                      : Lavf56.4.101

    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L2.1
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 4 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 5s 406ms
    Bit rate                                 : 536 Kbps
    Width                                    : 568 pixels
    Height                                   : 320 pixels
    Display aspect ratio                     : 16:9
    Original display aspect ratio            : 16:9
    Rotation                                 : 270°
    Frame rate mode                          : Constant
    Frame rate                               : 14.985 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.197
    Stream size                              : 354 KiB (79%)
    Writing library                          : x264 core 142
    Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=14 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
    Language                                 : English
    Encoded date                             : UTC 1904-01-01 00:00:00
    Tagged date                              : UTC 1904-01-01 00:00:00

    Audio
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format profile                           : LC
    Codec ID                                 : 40
    Duration                                 : 5s 596ms
    Bit rate mode                            : Constant
    Bit rate                                 : 132 Kbps
    Channel(s)                               : 2 channels
    Channel(s)_Original                      : 1 channel
    Channel positions                        : Front: C
    Sampling rate                            : 44.1 KHz
    Compression mode                         : Lossy
    Stream size                              : 89.4 KiB (20%)
    Language                                 : English
    Encoded date                             : UTC 1904-01-01 00:00:00
    Tagged date                              : UTC 1904-01-01 00:00:00

    And here is the metadata from the video created on iOS :

    General
    Complete name                            : ios_video.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media / Version 2
    Codec ID                                 : mp42
    File size                                : 673 KiB
    Duration                                 : 7s 38ms
    Overall bit rate                         : 783 Kbps
    Encoded date                             : UTC 2015-03-17 19:16:36
    Tagged date                              : UTC 2015-03-17 19:16:37

    Video
    ID                                       : 2
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : Main@L3.0
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 2 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 7s 33ms
    Bit rate                                 : 711 Kbps
    Width                                    : 320 pixels
    Height                                   : 568 pixels
    Display aspect ratio                     : 0.563
    Frame rate mode                          : Constant
    Frame rate                               : 30.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.130
    Stream size                              : 610 KiB (91%)
    Title                                    : Core Media Video
    Encoded date                             : UTC 2015-03-17 19:16:36
    Tagged date                              : UTC 2015-03-17 19:16:37
    Color primaries                          : BT.709
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.709
    Color range                              : Limited

    Audio
    ID                                       : 1
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format profile                           : LC
    Codec ID                                 : 40
    Duration                                 : 7s 38ms
    Source duration                          : 7s 105ms
    Bit rate mode                            : Constant
    Bit rate                                 : 64.0 Kbps
    Channel(s)                               : 2 channels
    Channel(s)_Original                      : 1 channel
    Channel positions                        : Front: C
    Sampling rate                            : 44.1 KHz
    Compression mode                         : Lossy
    Stream size                              : 56.8 KiB (8%)
    Source stream size                       : 57.2 KiB (9%)
    Title                                    : Core Media Audio
    Encoded date                             : UTC 2015-03-17 19:16:36
    Tagged date                              : UTC 2015-03-17 19:16:37

    The values width and height are inverted on Android, also the Rotation parameter is set to 270º (this is the rotation parameter for portrait videos).

    This is a sketch of how iOS’ videos look on iOS app :

    Videos recorded on iOS

    And this is how Android’s videos look on iOS app :

    enter image description here

    So, in order to get the videos correctly displayed both on iOS and Android i need to be able to set the width to 320 and height to 568 on Android. I tried it from several places (outside and inside CWAC-Camera library) but i always get a Camera.Parameters error.

    It is possible to do this on Android ?

    EDIT :

    This is the result i get when i set the rotation to 0 with ffmpeg :

    enter image description here