Recherche avancée

Médias (1)

Mot : - Tags -/pirate bay

Autres articles (44)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

Sur d’autres sites (6157)

  • FFMPEG : How to chose a stream from all stream

    17 janvier 2020, par Ali

    I try to convert a UDP stream (that genrated from DVB signal) to HLS m3u8 file with this code :

    ffmpeg -i udp://239.1.2.1:60001 -acodec aac -strict -2 -vcodec libx264 -hls_wrap 100 -f hls /var/www/html/ts/1.m3u8

    UDP stream contain 1 channel (in this case IRIB-TV1).

    When I run this above code, ffmpeg detect all of service and channel that streamed from DVB card with this message :

    Input #0, mpegts, from 'udp://239.1.2.1:60001':
    Duration: N/A, start: 77906.812644, bitrate: N/A
    Program 101
    Metadata:
     service_name    : IRIB-TV1
     service_provider: IRIB
    Stream #0:0[0x3f2]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x3f3](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp
    Program 102
    Metadata:
     service_name    : IRIB-TV2
     service_provider: IRIB
    Program 103
    Metadata:
     service_name    : IRIB-TV3
     service_provider: IRIB
    Program 104
    Metadata:
     service_name    : IRIB-TV4
     service_provider: IRIB

    As you see ffmpeg finf 4 channel in UDP stream, But VLC play only channel 1(IRIB-TV1).

    Now I have have 2 question :

    1-Can I get all channel and service via this ffmpeg code ?

    2-Can I choose a special stream from this ffmpeg code ?(I know that ffmpeg can choose a stream with -map option but I want to choose other service_name that in output log)

    output file is :

    ffmpeg version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2000-2014 the FFmpeg developers
     built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
     configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened --extra-cflags= --extra-cxxflags= --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libx264 --enable-libsoxr --enable-openal --enable-libopencv
     libavutil      54.  7.100 / 54.  7.100
     libavcodec     56.  1.100 / 56.  1.100
     libavformat    56.  4.101 / 56.  4.101
     libavdevice    56.  0.100 / 56.  0.100
     libavfilter     5.  1.100 /  5.  1.100
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  0.100 /  3.  0.100
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  0.100 / 53.  0.100
    Splitting the commandline.
    Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
    Reading option '-timeout' ... matched as AVOption 'timeout' with argument '6000000'.
    Reading option '-i' ... matched as input file with argument 'udp://239.1.2.1:60001?fifo_size=50000'.
    Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'copy'.
    Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'copy'.
    Reading option '-preset' ... matched as AVOption 'preset' with argument 'ultrafast'.
    Reading option '-flags' ... matched as AVOption 'flags' with argument '-global_header'.
    Reading option '-f' ... matched as option 'f' (force format) with argument 'hls'.
    Reading option '-hls_time' ... matched as AVOption 'hls_time' with argument '20'.
    Reading option '-hls_wrap' ... matched as AVOption 'hls_wrap' with argument '5'.
    Reading option '/var/www/html/ts/1.m3u8' ... matched as output file.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option loglevel (set logging level) with argument debug.
    Successfully parsed a group of options.
    Parsing a group of options: input file udp://239.1.2.1:60001?fifo_size=50000.
    Successfully parsed a group of options.
    Opening an input file: udp://239.1.2.1:60001?fifo_size=50000.
    [udp @ 0x1967040] end receive buffer size reported is 131072
    [mpegts @ 0x1977380] Format mpegts probed with size=2048 and score=100
    [mpegts @ 0x1977380] stream=0 stream_type=1b pid=3f2 prog_reg_desc=
    [mpegts @ 0x1977380] stream=1 stream_type=11 pid=3f3 prog_reg_desc=
    [mpegts @ 0x1977380] Before avformat_find_stream_info() pos: 0 bytes read:14476 seeks:0
    [mpegts @ 0x1977380] parser not found for codec none, packets or times may be invalid.
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [mpegts @ 0x1977380] probing stream 1 pp:2500
    [mpegts @ 0x1977380] Probe with size=853, packets=1 detected loas with score=51
    [mpegts @ 0x1977380] probed stream 1
    [aac_latm @ 0x199e4e0] initializing latmctx
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] non-existing PPS 0 referenced
       Last message repeated 1 times
    [h264 @ 0x199cc60] decode_slice_header error
    [h264 @ 0x199cc60] no frame!
    [h264 @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
    [h264 @ 0x199cc60] Frame num gap 397 393
    [h264 @ 0x199cc60] Frame num gap 397 394
    [h264 @ 0x199cc60] Frame num gap 397 395
    [h264 @ 0x199cc60] mmco: unref short failure
       Last message repeated 1 times
    [h264 @ 0x199cc60] number of reference frames (0+4) exceeds max (3; probably corrupt input), discarding one
    [h264 @ 0x199cc60] no picture ooo
    [h264 @ 0x199cc60] Increasing reorder buffer to 2
    [h264 @ 0x199cc60] no picture ooo
       Last message repeated 1 times
    [h264 @ 0x199cc60] no picture
       Last message repeated 1 times
    [h264 @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
       Last message repeated 3 times
    [mpegts @ 0x1977380] max_analyze_duration 5000000 reached at 5034667 microseconds
    [mpegts @ 0x1977380] After avformat_find_stream_info() pos: 1142476 bytes read:1143604 seeks:0 frames:397
    Input #0, mpegts, from 'udp://239.1.2.1:60001?fifo_size=50000':
     Duration: N/A, start: 43581.024200, bitrate: N/A
     Program 101
       Metadata:
         service_name    : IRIB-TV1
         service_provider: IRIB
       Stream #0:0[0x3f2], 274, 1/90000: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg), 720x576 [SAR 12:11 DAR 15:11], 1/50, 25 fps, 50 tbr, 90k tbn, 50 tbc
       Stream #0:1[0x3f3](per), 123, 1/90000: Audio: aac_latm ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp
     Program 102
       Metadata:
         service_name    : IRIB-TV2
         service_provider: IRIB
     Program 103
       Metadata:
         service_name    : IRIB-TV3
         service_provider: IRIB
     Program 104
       Metadata:
         service_name    : IRIB-TV4
         service_provider: IRIB
     Program 105
       Metadata:
         service_name    : IRIB-TV5
         service_provider: IRIB
     Program 106
       Metadata:
         service_name    : IRINN
         service_provider: IRIB
     Program 107
       Metadata:
         service_name    : AMOOZESH
         service_provider: IRIB
     Program 108
       Metadata:
         service_name    : QURAN
         service_provider: IRIB
     Program 119
       Metadata:
         service_name    : SALAMAT
         service_provider: IRIB
     Program 120
       Metadata:
         service_name    : NASIM
         service_provider: IRIB
     Program 151
       Metadata:
         service_name    : RADIO IRAN
         service_provider: IRIB
     Program 152
       Metadata:
         service_name    : RADIO PAYAM
         service_provider: IRIB
     Program 153
       Metadata:
         service_name    : RADIO JAVAN
         service_provider: IRIB
     Program 154
       Metadata:
         service_name    : RADIO MAAREF
         service_provider: IRIB
     Program 155
       Metadata:
         service_name    : RADIO QURAN
         service_provider: IRIB
     Program 156
       Metadata:
         service_name    : RADIO FARHANG
         service_provider: IRIB
     Program 157
       Metadata:
         service_name    : RADIO SALAMAT
         service_provider: IRIB
     Program 158
       Metadata:
         service_name    : RADIO VARZESH
         service_provider: IRIB
     Program 159
       Metadata:
         service_name    : RADIO EGHTESAD
         service_provider: IRIB
     Program 160
       Metadata:
         service_name    : RADIO TEHRAN
         service_provider: IRIB
     Program 161
       Metadata:
         service_name    : RADIO AVAA
         service_provider: IRIB
     Program 162
       Metadata:
         service_name    : RADIO NAMAYESH
         service_provider: IRIB
     Program 163
       Metadata:
         service_name    : RADIO SABA
         service_provider: IRIB
     Program 164
       Metadata:
         service_name    : English Radio World Service
         service_provider: IRIB
     Program 166
       Metadata:
         service_name    : Arabic Radio World Service
         service_provider: IRIB
     Program 167
       Metadata:
         service_name    : RADIO BAHARAN
         service_provider: IRIB
     Program 169
       Metadata:
         service_name    : RADIO TELAVAT
         service_provider: IRIB
     Program 170
       Metadata:
         service_name    : RADIO GOFTEGO
         service_provider: IRIB
    Successfully opened the file.
    Parsing a group of options: output file /var/www/html/ts/1.m3u8.
    Applying option acodec (force audio codec ('copy' to copy stream)) with argument copy.
    Applying option vcodec (force video codec ('copy' to copy stream)) with argument copy.
    Applying option f (force format) with argument hls.
    Successfully parsed a group of options.
    Opening an output file: /var/www/html/ts/1.m3u8.
    Successfully opened the file.
    [mpegts @ 0x1967180] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
       Last message repeated 1 times
    [mpegts @ 0x1967180] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt every 40 pkts
    Output #0, hls, to '/var/www/html/ts/1.m3u8':
     Metadata:
       encoder         : Lavf56.4.101
       Stream #0:0, 0, 1/90000: Video: h264 ([27][0][0][0] / 0x001B), yuv420p, 720x576 [SAR 12:11 DAR 15:11], 1/25, q=2-31, 25 fps, 90k tbn, 25 tbc
       Stream #0:1(per), 0, 1/90000: Audio: aac_latm ([17][0][0][0] / 0x0011), 48000 Hz, stereo
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    [NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
    [NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
    [NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
    [NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
    [NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
    [NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
    [NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
    [NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
    [NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
    [NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
    [NULL @ 0x199cc60] Current profile doesn't provide more RBSP data in PPS, skipping
    [AVIOContext @ 0x19a9860] Statistics: 0 seeks, 896 writeouts=N/A    
    [hls @ 0x1a65ca0] EXT-X-MEDIA-SEQUENCE:0
    [AVIOContext @ 0x1d162e0] Statistics: 0 seeks, 1 writeouts
    [AVIOContext @ 0x1966b40] Statistics: 0 seeks, 27 writeouts
    [hls @ 0x1a65ca0] EXT-X-MEDIA-SEQUENCE:0
    [AVIOContext @ 0x199b7a0] Statistics: 0 seeks, 1 writeouts
    frame=  826 fps= 69 q=-1.0 Lsize=N/A time=00:00:20.63 bitrate=N/A    
    video:2611kB audio:68kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    Input file #0 (udp://239.1.2.1:60001?fifo_size=50000):
     Input stream #0:0 (video): 872 packets read (2779202 bytes);
     Input stream #0:1 (audio): 405 packets read (69222 bytes);
     Total: 1277 packets (2848424 bytes) demuxed
    Output file #0 (/var/www/html/ts/1.m3u8):
     Output stream #0:0 (video): 826 packets muxed (2673485 bytes);
     Output stream #0:1 (audio): 405 packets muxed (69222 bytes);
     Total: 1231 packets (2742707 bytes) muxed
    0 frames successfully decoded, 0 decoding errors
    [AVIOContext @ 0x1967ce0] Statistics: 3884832 bytes read, 0 seeks
    Received signal 2: terminating.
  • Trying to cancel execution and delete file using ffmpeg C API

    6 mars 2020, par Vuwox

    The code below is a class that handle the conversion of multiples images, through add_frame() method, into a GIF with encode(). It also use a filter to generate and apply the palette. The usage is like this :

    Code call example

    std::unique_ptr gif_obj = nullptr;
    try
    {
       gif_obj = std::make_unique({1000,1000}, 12, "C:/out.gif",
                 "format=pix_fmts=rgb24,split [a][b];[a]palettegen[p];[b][p]paletteuse");

       // Example: a simple vector of images (usually process internally)
       for(auto img : image_vector)
            gif_obj->add_frame(img);

       // Once all frame were added, encode the final GIF with the filter applied.
       gif_obj->encode();
    }
    catch(const std::exception& e)
    {
       // An error occured! We must close FFMPEG properly and delete the created file.
       gif_obj->cancel();
    }

    I have the following issue. If the code for any reason throw an exception, I call ffmpeg->cancel() and it supposes to delete the GIF file on disk. But this is never working, I assume there is a lock on the file or something like that. So here are my question :

    What is the proper way to close/free ffmpeg object in order to remove the file afterward ?


    Full class code below

    Header

    // C++ Standard includes    
    #include <memory>
    #include <string>
    #include <vector>


    // 3rd Party incldues
    #ifdef __cplusplus
    extern "C" {
    #include "libavformat/avformat.h"
    #include "libavfilter/avfilter.h"
    #include "libavutil/opt.h"
    #include "libavfilter/buffersrc.h"
    #include "libavfilter/buffersink.h"
    #include "libswscale/swscale.h"
    #include "libavutil/imgutils.h"
    }
    #endif

    #define FFMPEG_MSG_LEN 2000

    namespace px
    {
       namespace GIF
       {
           class FFMPEG
           {
           public:
               FFMPEG(const px::Point2D<int>&amp; dim,
                      const int framerate,
                      const std::string&amp; filename,
                      const std::string&amp; filter_cmd);

               ~FFMPEG();

               void add_frame(pxImage * const img);
               void encode();
               void cancel();

           private:

               void init_filters();            // Init everything that needed to filter the input frame.
               void init_muxer();              // The muxer that creates the output file.
               void muxing_one_frame(AVFrame* frame);
               void release();

               int _ret = 0;                   // status code from FFMPEG.
               char _err_msg[FFMPEG_MSG_LEN];  // Error message buffer.


               int m_width = 0;                // The width that all futur images must have to be accepted.
               int m_height = 0;               // The height that all futur images must have to be accepted.

               int m_framerate = 0;            // GIF Framerate.
               std::string m_filename = "";    // The GIF filename (on cache?)
               std::string m_filter_desc = ""; // The FFMPEG filter to apply over the frames.

               bool as_frame = false;

               AVFrame* picture_rgb24 = nullptr;           // Temporary frame that will hold the pxImage in an RGB24 format (NOTE: TOP-LEFT origin)

               AVFormatContext* ofmt_ctx = nullptr;        // ouput format context associated to the
               AVCodecContext* o_codec_ctx = nullptr;      // output codec for the GIF

               AVFilterGraph* filter_graph = nullptr;      // filter graph associate with the string we want to execute
               AVFilterContext* buffersrc_ctx = nullptr;   // The buffer that will store all the frames in one place for the palette generation.
               AVFilterContext* buffersink_ctx = nullptr;  // The buffer that will store the result afterward (once the palette are used).

               int64_t m_pts_increment = 0;
           };
       };
    };
    </int></vector></string></memory>

    ctor

    px::GIF::FFMPEG::FFMPEG(const px::Point2D<int>&amp; dim,
                           const int framerate,
                           const std::string&amp; filename,
                           const std::string&amp; filter_cmd) :
       m_width(dim.x()),
       m_height(dim.y()),
       m_framerate(framerate),
       m_filename(filename),
       m_filter_desc(filter_cmd)
    {
    #if !_DEBUG
       av_log_set_level(AV_LOG_QUIET); // Set the FFMPEG log to quiet to avoid too much logs.
    #endif

       // Allocate the temporary buffer that hold the ffmpeg image (pxImage to AVFrame conversion).
       picture_rgb24 = av_frame_alloc();
       picture_rgb24->pts = 0;
       picture_rgb24->data[0] = NULL;
       picture_rgb24->linesize[0] = -1;
       picture_rgb24->format = AV_PIX_FMT_RGB24;
       picture_rgb24->height = m_height;
       picture_rgb24->width = m_width;

       if ((_ret = av_image_alloc(picture_rgb24->data, picture_rgb24->linesize, m_width, m_height, (AVPixelFormat)picture_rgb24->format, 24)) &lt; 0)
           throw px::GIF::Error("Failed to allocate the AVFrame for pxImage conversion with error: " +
                                std::string(av_make_error_string(_err_msg, FFMPEG_MSG_LEN, _ret)),
                                "GIF::FFMPEG CTOR");  

       //printf("allocated picture of size %d, linesize %d %d %d %d\n", _ret, picture_rgb24->linesize[0], picture_rgb24->linesize[1], picture_rgb24->linesize[2], picture_rgb24->linesize[3]);

       init_muxer();   // Prepare the GIF encoder (open it on disk).
       init_filters(); // Prepare the filter that will be applied over the frame.

       // Instead of hardcoder {1,100} which is the GIF tbn, we collect it from its stream.
       // This will avoid future problem if the codec change in ffmpeg.
       if (ofmt_ctx &amp;&amp; ofmt_ctx->nb_streams > 0)
           m_pts_increment = av_rescale_q(1, { 1, m_framerate }, ofmt_ctx->streams[0]->time_base);
       else
           m_pts_increment = av_rescale_q(1, { 1, m_framerate }, { 1, 100 });
    }
    </int>

    FFMPEG Initialization (Filter and muxer)

    void px::GIF::FFMPEG::init_filters()
    {
       const AVFilter* buffersrc = avfilter_get_by_name("buffer");
       const AVFilter* buffersink = avfilter_get_by_name("buffersink");

       AVRational time_base = { 1, m_framerate };
       AVRational aspect_pixel = { 1, 1 };

       AVFilterInOut* inputs = avfilter_inout_alloc();
       AVFilterInOut* outputs = avfilter_inout_alloc();

       filter_graph = avfilter_graph_alloc();

       try
       {
           if (!outputs || !inputs || !filter_graph)
               throw px::GIF::Error("Failed to 'init_filters' could not allocated the graph/filters.", "GIF::FFMPEG init_filters");

           char args[512];
           snprintf(args, sizeof(args),
                    "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",
                    m_width, m_height,
                    picture_rgb24->format,
                    time_base.num, time_base.den,
                    aspect_pixel.num, aspect_pixel.den);

           if (avfilter_graph_create_filter(&amp;buffersrc_ctx, buffersrc, "in", args, nullptr, filter_graph) &lt; 0)
               throw px::GIF::Error("Failed to create the 'source buffer' in init_filer method.", "GIF::FFMPEG init_filters");


           if (avfilter_graph_create_filter(&amp;buffersink_ctx, buffersink, "out", nullptr, nullptr, filter_graph) &lt; 0)
               throw px::GIF::Error("Failed to create the 'sink buffer' in init_filer method.", "GIF::FFMPEG init_filters");

           // GIF has possible output of PAL8.
           enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE };

           if (av_opt_set_int_list(buffersink_ctx, "pix_fmts", pix_fmts, AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN) &lt; 0)
               throw px::GIF::Error("Failed to set the output pixel format.", "GIF::FFMPEG init_filters");

           outputs->name = av_strdup("in");
           outputs->filter_ctx = buffersrc_ctx;
           outputs->pad_idx = 0;
           outputs->next = nullptr;

           inputs->name = av_strdup("out");
           inputs->filter_ctx = buffersink_ctx;
           inputs->pad_idx = 0;
           inputs->next = nullptr;

           // GIF has possible output of PAL8.
           if (avfilter_graph_parse_ptr(filter_graph, m_filter_desc.c_str(), &amp;inputs, &amp;outputs, nullptr) &lt; 0)
               throw px::GIF::Error("Failed to parse the filter graph (bad string!).", "GIF::FFMPEG init_filters");

           if (avfilter_graph_config(filter_graph, nullptr) &lt; 0)
               throw px::GIF::Error("Failed to configure the filter graph (bad string!).", "GIF::FFMPEG init_filters");

           avfilter_inout_free(&amp;inputs);
           avfilter_inout_free(&amp;outputs);
       }
       catch (const std::exception&amp; e)
       {
           // Catch exception to delete element.
           avfilter_inout_free(&amp;inputs);
           avfilter_inout_free(&amp;outputs);
           throw e; // re-throuw
       }
    }


    void px::GIF::FFMPEG::init_muxer()
    {
       AVOutputFormat* o_fmt = av_guess_format("gif", m_filename.c_str(), "video/gif");

       if ((_ret = avformat_alloc_output_context2(&amp;ofmt_ctx, o_fmt, "gif", m_filename.c_str())) &lt; 0)
           throw px::GIF::Error(std::string(av_make_error_string(_err_msg, FFMPEG_MSG_LEN, _ret)) + " allocate output format.", "GIF::FFMPEG init_muxer");

       AVCodec* codec = avcodec_find_encoder(AV_CODEC_ID_GIF);
       if (!codec) throw px::GIF::Error("Could to find the 'GIF' codec.", "GIF::FFMPEG init_muxer");

    #if 0
       const AVPixelFormat* p = codec->pix_fmts;
       while (p != NULL &amp;&amp; *p != AV_PIX_FMT_NONE) {
           printf("supported pix fmt: %s\n", av_get_pix_fmt_name(*p));
           ++p;
       }
    #endif

       AVStream* stream = avformat_new_stream(ofmt_ctx, codec);

       AVCodecParameters* codec_paramters = stream->codecpar;
       codec_paramters->codec_tag = 0;
       codec_paramters->codec_id = codec->id;
       codec_paramters->codec_type = AVMEDIA_TYPE_VIDEO;
       codec_paramters->width = m_width;
       codec_paramters->height = m_height;
       codec_paramters->format = AV_PIX_FMT_PAL8;

       o_codec_ctx = avcodec_alloc_context3(codec);
       avcodec_parameters_to_context(o_codec_ctx, codec_paramters);

       o_codec_ctx->time_base = { 1, m_framerate };

       if (ofmt_ctx->oformat->flags &amp; AVFMT_GLOBALHEADER)
           o_codec_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;

       if ((_ret = avcodec_open2(o_codec_ctx, codec, NULL)) &lt; 0)
           throw px::GIF::Error(std::string(av_make_error_string(_err_msg, FFMPEG_MSG_LEN, _ret)) + " open output codec.", "GIF::FFMPEG init_muxer");

       if ((_ret = avio_open(&amp;ofmt_ctx->pb, m_filename.c_str(), AVIO_FLAG_WRITE)) &lt; 0)
           throw px::GIF::Error(std::string(av_make_error_string(_err_msg, FFMPEG_MSG_LEN, _ret)) + " avio open error.", "GIF::FFMPEG init_muxer");

       if ((_ret = avformat_write_header(ofmt_ctx, NULL)) &lt; 0)
           throw px::GIF::Error(std::string(av_make_error_string(_err_msg, FFMPEG_MSG_LEN, _ret)) + " write GIF header", "GIF::FFMPEG init_muxer");

    #if _DEBUG
       // This print the stream/output format.
       av_dump_format(ofmt_ctx, -1, m_filename.c_str(), 1);
    #endif
    }

    Add frame (usually in a loop)

    void px::GIF::FFMPEG::add_frame(pxImage * const img)
    {
       if (img->getImageType() != PXT_BYTE || img->getNChannels() != 4)
           throw px::GIF::Error("Failed to 'add_frame' since image is not PXT_BYTE and 4-channels.", "GIF::FFMPEG add_frame");

       if (img->getWidth() != m_width || img->getHeight() != m_height)
           throw px::GIF::Error("Failed to 'add_frame' since the size is not same to other inputs.", "GIF::FFMPEG add_frame");

       const int pitch = picture_rgb24->linesize[0];
       auto px_ptr = getImageAccessor(img);

       for (int y = 0; y &lt; m_height; y++)
       {
           const int px_row = img->getOrigin() == ORIGIN_BOT_LEFT ? m_height - y - 1 : y;
           for (int x = 0; x &lt; m_width; x++)
           {
               const int idx = y * pitch + 3 * x;
               picture_rgb24->data[0][idx] = px_ptr[px_row][x].ch[PX_RE];
               picture_rgb24->data[0][idx + 1] = px_ptr[px_row][x].ch[PX_GR];
               picture_rgb24->data[0][idx + 2] = px_ptr[px_row][x].ch[PX_BL];
           }
       }

       // palettegen need a whole stream, just add frame to buffer.
       if ((_ret = av_buffersrc_add_frame_flags(buffersrc_ctx, picture_rgb24, AV_BUFFERSRC_FLAG_KEEP_REF)) &lt; 0)
           throw px::GIF::Error("Failed to 'add_frame' to global buffer with error: " +
                                std::string(av_make_error_string(_err_msg, FFMPEG_MSG_LEN, _ret)),
                                "GIF::FFMPEG add_frame");

       // Increment the FPS of the picture for the next add-up to the buffer.      
       picture_rgb24->pts += m_pts_increment;

       as_frame = true;
    }    

    Encoder (final step)

    void px::GIF::FFMPEG::encode()
    {
       if (!as_frame)
           throw px::GIF::Error("Please 'add_frame' before running the Encoding().", "GIF::FFMPEG encode");

       // end of buffer
       if ((_ret = av_buffersrc_add_frame_flags(buffersrc_ctx, nullptr, AV_BUFFERSRC_FLAG_KEEP_REF)) &lt; 0)
           throw px::GIF::Error("error add frame to buffer source: " + std::string(av_make_error_string(_err_msg, FFMPEG_MSG_LEN, _ret)), "GIF::FFMPEG encode");

       do {
           AVFrame* filter_frame = av_frame_alloc();
           _ret = av_buffersink_get_frame(buffersink_ctx, filter_frame);
           if (_ret == AVERROR(EAGAIN) || _ret == AVERROR_EOF) {
               av_frame_unref(filter_frame);
               break;
           }

           // write the filter frame to output file
           muxing_one_frame(filter_frame);

           av_frame_unref(filter_frame);
       } while (_ret >= 0);

       av_write_trailer(ofmt_ctx);
    }

    void px::GIF::FFMPEG::muxing_one_frame(AVFrame* frame)
    {
       int ret = avcodec_send_frame(o_codec_ctx, frame);
       AVPacket *pkt = av_packet_alloc();
       av_init_packet(pkt);

       while (ret >= 0) {
           ret = avcodec_receive_packet(o_codec_ctx, pkt);
           if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {
               break;
           }

           av_write_frame(ofmt_ctx, pkt);
       }
       av_packet_unref(pkt);
    }

    DTOR, Release and Cancel

    px::GIF::FFMPEG::~FFMPEG()
    {
       release();
    }


    void px::GIF::FFMPEG::release()
    {
       // Muxer stuffs
       if (ofmt_ctx != nullptr) avformat_free_context(ofmt_ctx);
       if (o_codec_ctx != nullptr) avcodec_close(o_codec_ctx);
       if (o_codec_ctx != nullptr) avcodec_free_context(&amp;o_codec_ctx);

       ofmt_ctx = nullptr;
       o_codec_ctx = nullptr;

       // Filter stuffs
       if (buffersrc_ctx != nullptr) avfilter_free(buffersrc_ctx);
       if (buffersink_ctx != nullptr) avfilter_free(buffersink_ctx);
       if (filter_graph != nullptr) avfilter_graph_free(&amp;filter_graph);

       buffersrc_ctx = nullptr;
       buffersink_ctx = nullptr;
       filter_graph = nullptr;

       // Conversion image.
       if (picture_rgb24 != nullptr) av_frame_free(&amp;picture_rgb24);
       picture_rgb24 = nullptr;
    }

    void px::GIF::FFMPEG::cancel()
    {
       // In-case of failure we must close ffmpeg and exit.
       av_write_trailer(ofmt_ctx);

       // Release and close all elements.
       release();

       // Delete the file on disk.
       if (remove(m_filename.c_str()) != 0)
           PX_LOG0(PX_LOGLEVEL_ERROR, "GIF::FFMPEG - On 'cancel' failed to remove the file.");
    }
  • ffmpeg determine correct codec to use

    8 avril 2020, par nha

    I am trying to use .y4m files that I feed into Chrome for playing.&#xA;This is the only format that I can use.

    &#xA;&#xA;

    I have a set of .y4m files that are working for my use case, taken from here.&#xA;For example let's say that I use the file mobile_qcif_7.5fps.y4m.

    &#xA;&#xA;

    I also have a .mp4 file (specifically the sample small.mp4 file from techslides ). I know how to convert small.mp4 to small.y4m with the following command :

    &#xA;&#xA;

    ffmpeg -y -i small.mp4 small.y4m

    &#xA;&#xA;

    I would like the resulting file to be accepted by Chrome, just like the other file.&#xA;What options should I use (and how to find them) ?

    &#xA;&#xA;

    Additional information

    &#xA;&#xA;

    ffprobe gives :

    &#xA;&#xA;

    $ ffprobe small.y4m &#xA;avprobe version 0.8.13-6:0.8.13-0ubuntu0.13.10.1, Copyright (c) 2007-2014 the Libav developers&#xA;  built on Jul 15 2014 13:48:35 with gcc 4.8.1&#xA;[yuv4mpegpipe @ 0x23160c0] Estimating duration from bitrate, this may be inaccurate&#xA;Input #0, yuv4mpegpipe, from &#x27;small.y4m&#x27;:&#xA;  Duration: N/A, bitrate: N/A&#xA;    Stream #0.0: Video: rawvideo, yuv420p, 560x320, 30 fps, 30 tbr, 30 tbn, 30 tbc&#xA;&#xA;&#xA;$ ffprobe mobile_qcif_7.5fps.y4m&#xA;avprobe version 0.8.13-6:0.8.13-0ubuntu0.13.10.1, Copyright (c) 2007-2014 the Libav developers&#xA;  built on Jul 15 2014 13:48:35 with gcc 4.8.1&#xA;[yuv4mpegpipe @ 0x1e080c0] max_analyze_duration reached&#xA;[yuv4mpegpipe @ 0x1e080c0] Estimating duration from bitrate, this may be inaccurate&#xA;Input #0, yuv4mpegpipe, from &#x27;mobile_qcif_7.5fps.y4m&#x27;:&#xA;  Duration: N/A, bitrate: N/A&#xA;    Stream #0.0: Video: rawvideo, yuv420p, 176x144, PAR 128:117 DAR 1408:1053, 7.50 fps, 7.50 tbr, 7.50 tbn, 7.50 tbc&#xA;

    &#xA;&#xA;

    OS : I am using ffmpeg in Ubuntu 13.10 from the default repository : I ran sudo apt-get install ffmpeg libavcodec-extra-53

    &#xA;&#xA;

    Complete console output

    &#xA;&#xA;

    $ ffmpeg -y -i small.mp4 small.y4m&#xA;ffmpeg version 0.8.13-6:0.8.13-0ubuntu0.13.10.1, Copyright (c) 2000-2014 the Libav developers&#xA;  built on Jul 15 2014 13:48:35 with gcc 4.8.1&#xA;*** THIS PROGRAM IS DEPRECATED ***&#xA;This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;small.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 0&#xA;    compatible_brands: mp42isomavc1&#xA;    creation_time   : 2010-03-20 21:29:11&#xA;    encoder         : HandBrake 0.9.4 2009112300&#xA;  Duration: 00:00:05.56, start: 0.000000, bitrate: 551 kb/s&#xA;    Stream #0.0(und): Video: h264 (Constrained Baseline), yuv420p, 560x320, 465 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc&#xA;    Metadata:&#xA;      creation_time   : 2010-03-20 21:29:11&#xA;    Stream #0.1(eng): Audio: aac, 48000 Hz, mono, s16, 83 kb/s&#xA;    Metadata:&#xA;      creation_time   : 2010-03-20 21:29:11&#xA;[buffer @ 0x7274e0] w:560 h:320 pixfmt:yuv420p&#xA;Output #0, yuv4mpegpipe, to &#x27;small.y4m&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 0&#xA;    compatible_brands: mp42isomavc1&#xA;    creation_time   : 2010-03-20 21:29:11&#xA;    encoder         : Lavf53.21.1&#xA;    Stream #0.0(und): Video: rawvideo, yuv420p, 560x320, q=2-31, 200 kb/s, 90k tbn, 30 tbc&#xA;    Metadata:&#xA;      creation_time   : 2010-03-20 21:29:11&#xA;Stream mapping:&#xA;  Stream #0.0 -> #0.0&#xA;Press ctrl-c to stop encoding&#xA;frame=  166 fps=  0 q=0.0 Lsize=   43576kB time=5.53 bitrate=64513.5kbits/s    &#xA;video:0kB audio:0kB global headers:0kB muxing overhead inf%&#xA;

    &#xA;&#xA;

    Head of the files

    &#xA;&#xA;

    Not sure if this is relevant, but the text content of both files begin like that :

    &#xA;&#xA;

    mobile_qcif_7.5fps.y4m&#xA;YUV4MPEG2 W176 H144 F15:2 Ip A128:117&#xA;FRAME&#xA;&#xA;small.y4m (invalid)&#xA;YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420mpeg2 XYSCSS=420MPEG2&#xA;FRAME&#xA;

    &#xA;&#xA;

    Additional experiment

    &#xA;&#xA;

    Taking the sample mobile_qcif_7.5fps.y4m, turning it into a .mp4 file and then back into a .y4m produces an invalid file (at least for Chrome).

    &#xA;&#xA;

    Answer to comments in the answer of @SirDarius

    &#xA;&#xA;

    Following the suggestion of @SirDarius ; I tried the following commands.&#xA;They failed to produce a valid file.

    &#xA;&#xA;

    # [COMMAND]   # [RESULT] [HEADER]&#xA;ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -pix_fmt yuv444p -y small_yuv444p.y4m   # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C444 XYSCSS=444&#xA;ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -pix_fmt yuv422p -y small_yuv422p.y4m   # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C422 XYSCSS=422&#xA;ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -pix_fmt yuv420p -y small_yuv420p.y4m   # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420mpeg2 XYSCSS=420MPEG2&#xA;ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -pix_fmt yuv411p -y small_yuv411p.y4m   #&#xA0;KO   YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C411 XYSCSS=411&#xA;&#xA;ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -strict -1 -pix_fmt yuv420p9 -y small_yuv420p9.y4m   # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420p9 XYSCSS=420P9&#xA;ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -strict -1 -pix_fmt yuv420p12 -y small_yuv420p12.y4m # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420p12 XYSCSS=420P12&#xA;ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -strict -1 -pix_fmt yuv420p14 -y small_yuv420p14.y4m #&#xA0;KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420p14 XYSCSS=420P14&#xA;ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -strict -1 -pix_fmt yuv420p16 -y small_yuv420p16.y4m # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420p16 XYSCSS=420P16&#xA;

    &#xA;&#xA;

    When trying other formats (like yuv420p12be, which was in the output of -pix_fmts), I had the following output (hence my previous trials) :

    &#xA;&#xA;

    $  ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -pix_fmt yuv420p12be -y small_yuv420p12be.y4m &#xA;ffmpeg version N-68884-g3ebd76a Copyright (c) 2000-2015 the FFmpeg developers&#xA;  built on Jan  6 2015 11:03:21 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)&#xA;  configuration: &#xA;  libavutil      54. 16.100 / 54. 16.100&#xA;  libavcodec     56. 19.100 / 56. 19.100&#xA;  libavformat    56. 18.100 / 56. 18.100&#xA;  libavdevice    56.  3.100 / 56.  3.100&#xA;  libavfilter     5.  6.100 /  5.  6.100&#xA;  libswscale      3.  1.101 /  3.  1.101&#xA;  libswresample   1.  1.100 /  1.  1.100&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x21d0220] overread end of atom &#x27;colr&#x27; by 1 bytes&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;small.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 0&#xA;    compatible_brands: mp42isomavc1&#xA;    creation_time   : 2010-03-20 21:29:11&#xA;    encoder         : HandBrake 0.9.4 2009112300&#xA;  Duration: 00:00:05.57, start: 0.000000, bitrate: 551 kb/s&#xA;    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 560x320, 465 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2010-03-20 21:29:11&#xA;      encoder         : JVT/AVC Coding&#xA;    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 83 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2010-03-20 21:29:11&#xA;[yuv4mpegpipe @ 0x21d8180] ERROR: yuv4mpeg can only handle yuv444p, yuv422p, yuv420p, yuv411p and gray8 pixel formats. And using &#x27;strict -1&#x27; also yuv444p9, yuv422p9, yuv420p9, yuv444p10, yuv422p10, yuv420p10, yuv444p12, yuv422p12, yuv420p12, yuv444p14, yuv422p14, yuv420p14, yuv444p16, yuv422p16, yuv420p16 and gray16 pixel formats. Use -pix_fmt to select one.&#xA;Output #0, yuv4mpegpipe, to &#x27;small_yuv420p12be.y4m&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 0&#xA;    compatible_brands: mp42isomavc1&#xA;    encoder         : Lavf56.18.100&#xA;    Stream #0:0(und): Video: rawvideo ([12][11]3Y / 0x59330B0C), yuv420p12be, 560x320, q=2-31, 200 kb/s, 7.50 fps, 7.50 tbn, 7.50 tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2010-03-20 21:29:11&#xA;      encoder         : Lavc56.19.100 rawvideo&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))&#xA;Could not write header for output file #0 (incorrect codec parameters ?): Input/output error&#xA;

    &#xA;&#xA;

    After that, I also tried to edit with an hexadecimal editor (bless) the small_yuv420p.y4m file. I replace C420mpeg2 by C420, and the file was accepted by Chrome.&#xA;What does the number in 420p[number] correspond to ? It is not explained there.&#xA;Is there any way to make ffmpeg output this kind of header files ?

    &#xA;&#xA;

    @SirDarius, thank you again for your help.

    &#xA;&#xA;

    The question

    &#xA;&#xA;

    (in case you forgot after this text blob)

    &#xA;&#xA;

    How can I convert the small.mp4 into a small.y4m file that has the same properties as the mobile_qcif_7.5fps.y4m file ?

    &#xA;