
Recherche avancée
Médias (1)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
Autres articles (49)
-
Qu’est ce qu’un masque de formulaire
13 juin 2013, parUn masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
Chaque formulaire de publication d’objet peut donc être personnalisé.
Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (9286)
-
Rotate a h264 video using the Display Orientation SEI
4 juin 2020, par Tunji_DI'm trying to rotate a h264 video 90 degrees anticlockwise. The syntax for the Display Orientation Supplementary EnhancementInformation (SEI) is given as :






Which I first tried encoding as follows :



val prefix = byteArrayOf(0, 0, 0, 1)
val nalHeader = byteArrayOf(6) // 0 forbidden_zero_bit = 0, nal_ref_idc = 0, nal_unit_type = 6

val display = byteArrayOf(47 /* Display orientation type*/, 3 /*payload size*/)

val displayOrientationCancelFlag = "0" // u(1); Rotation information follows
val horFlip = "0" // hor_flip; u(1); Do not flip horizontally
val verFlip = "0" // ver_flip; u(1); Do not flip vertically
val anticlockwiseRotation = "0100000000000000" // u(16); value / 2^16 -> 90 degrees
val displayOrientationRepetitionPeriod = "010" // ue(v); Persistent till next video sequence
val displayOrientationExtensionFlag = "0" // u(1); No other value is permitted by the spec atm
val byteAlignment = "1"




The above is my kotlin code for generating the SEI. This is a static variable so I went for human readable version.



Dropping the Annex B start codes, the hex SEI is



06 2f 03 08 00 09




ffmpeg complained about this however, saying that my payload size was specified as 3 bytes (24 bits) but it only read 23 bits before reading the NAL stop bit. To fix this I padded my SEI payload by one zero bit to allow ffmpeg parse it successfully, and added the stop bit again with more byte alignment bits :



val byteAlignment = "010000000"




This in hex is



06 2f 03 08 00 08 80




When I add this before the first IDR NAL unit in my h264 rbsp, ffmpeg will accept it to convert to whatever format I ask, jpeg or mp4. The output is not rotated however. Playing it with ffplay also does not rotate it. I'm note quite sure what I'm doing wrong. ffprobe yields the following output :



[NULL @ 0x7fca03808a00] Opening 'sei2.264' for reading
[file @ 0x7fca01c289c0] Setting default whitelist 'file,crypto'
Probing h264 score:51 size:1502
Probing mp3 score:1 size:1502
[h264 @ 0x7fca03808a00] Format h264 probed with size=2048 and score=51
[h264 @ 0x7fca03808a00] Before avformat_find_stream_info() pos: 0 bytes read:1502 seeks:0 nb_streams:1
[AVBSFContext @ 0x7fca02808680] nal_unit_type: 7(SPS), nal_ref_idc: 3
[AVBSFContext @ 0x7fca02808680] nal_unit_type: 8(PPS), nal_ref_idc: 3
[AVBSFContext @ 0x7fca02808680] nal_unit_type: 6(SEI), nal_ref_idc: 0
[AVBSFContext @ 0x7fca02808680] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7fca0381d400] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7fca0381d400] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x7fca0381d400] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7fca0381d400] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7fca0381d400] Format yuv420p chosen by get_format().
[h264 @ 0x7fca0381d400] Reinit context to 176x144, pix_fmt: yuv420p
[h264 @ 0x7fca03808a00] decoding for stream 0 failed
[h264 @ 0x7fca03808a00] stream 0: start_time: -7686143364045.646 duration: -7686143364045.646
[h264 @ 0x7fca03808a00] format: start_time: -9223372036854.775 duration: -9223372036854.775 bitrate=0 kb/s
[h264 @ 0x7fca03808a00] After avformat_find_stream_info() pos: 1502 bytes read:1502 seeks:0 frames:1
Input #0, h264, from 'sei2.264':
 Duration: N/A, bitrate: N/A
 Stream #0:0, 1, 1/1200000: Video: h264 (Constrained Baseline), 1 reference frame, yuv420p(progressive, left), 176x144, 0/1, 25 tbr, 1200k tbn, 50 tbc
[h264 @ 0x7fca0380dc00] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7fca0380dc00] nal_unit_type: 8(PPS), nal_ref_idc: 3
[AVIOContext @ 0x7fca02801b00] Statistics: 1502 bytes read, 0 seeks




My full RBSP with SPS, PPS, SEI and IDR follow :



unsigned char rbsp[1502] = {
 // Offset 0x00000000 to 0x00001501
 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0xc0, 0x29, 0x8d, 0x68, 0x2c, 0x4e,
 0x80, 0x78, 0x44, 0x23, 0x50, 0x00, 0x00, 0x00, 0x01, 0x68, 0xce, 0x01,
 0xa8, 0x35, 0xc8, 0x00, 0x00, 0x00, 0x01, 0x06, 0x2f, 0x03, 0x08, 0x00,
 0x08, 0x80, 0x00, 0x00, 0x00, 0x01, 0x65, 0xb8, 0x00, 0x04, 0x05, 0x9f,
 0xff, 0xff, 0x04, 0x51, 0x40, 0x00, 0x41, 0x63, 0xc7, 0x31, 0xcf, 0xff,
 0xff, 0x27, 0xff, 0xfe, 0x4f, 0xff, 0xfc, 0x9f, 0xff, 0xf9, 0x3f, 0xff,
 0xf2, 0x7f, 0xff, 0xe4, 0xff, 0xff, 0xc9, 0xff, 0xff, 0x93, 0xff, 0xff,
 0x27, 0xff, 0xfe, 0x4f, 0xff, 0xfc, 0x9f, 0xff, 0xf9, 0x3f, 0xff, 0xf2,
 0x7f, 0xff, 0xe4, 0xff, 0xfc, 0x43, 0x05, 0xd0, 0x03, 0x2b, 0x2d, 0x11,
 0x03, 0x16, 0x84, 0xb4, 0x5e, 0xc2, 0x00, 0x03, 0xa0, 0x20, 0xc7, 0x42,
 0xb6, 0xb8, 0x00, 0x57, 0x66, 0x66, 0x09, 0xdc, 0xc1, 0x92, 0x50, 0x86,
 0x38, 0x04, 0x8f, 0x6d, 0x83, 0xff, 0xff, 0x41, 0x5e, 0xef, 0xbb, 0xff,
 0xff, 0xd0, 0x57, 0xbb, 0xee, 0xff, 0xff, 0xf4, 0x15, 0xee, 0xfb, 0xbf,
 0xff, 0xfd, 0x05, 0x7b, 0xbe, 0xef, 0xff, 0xff, 0x41, 0x5e, 0xef, 0xbb,
 0xff, 0xff, 0xd0, 0x57, 0xbb, 0xc0, 0x25, 0x55, 0x9a, 0xdf, 0x9f, 0x22,
 0x63, 0xff, 0xff, 0x27, 0xff, 0xfe, 0x4f, 0xff, 0xfc, 0x9f, 0xff, 0xf9,
 0x3f, 0xff, 0xec, 0x86, 0xfc, 0x7d, 0x2d, 0x2f, 0xf8, 0x07, 0xfa, 0xf8,
 0x00, 0x37, 0x66, 0x35, 0x11, 0x29, 0x61, 0x8b, 0x30, 0x53, 0x41, 0x3c,
 0xb3, 0xee, 0x59, 0xa7, 0xb7, 0xc2, 0x00, 0x03, 0x00, 0x07, 0x05, 0x86,
 0x02, 0x10, 0x88, 0x38, 0x00, 0x53, 0x68, 0x93, 0x1b, 0xf4, 0x22, 0x3b,
 0x90, 0x00, 0x08, 0x30, 0xd9, 0x64, 0x00, 0x02, 0x0c, 0x36, 0xe6, 0x10,
 0xef, 0xa0, 0xf6, 0x52, 0xc3, 0xd9, 0x5c, 0xf8, 0x1f, 0xff, 0xb0, 0xdf,
 0x80, 0x06, 0xc6, 0xaa, 0x46, 0x19, 0xd8, 0x55, 0x96, 0x5f, 0xfb, 0x38,
 0xc2, 0xf8, 0x40, 0x00, 0x64, 0x0a, 0x0a, 0x30, 0x11, 0x20, 0xd4, 0x00,
 0x8c, 0x99, 0xb0, 0x6c, 0xd9, 0x4a, 0x10, 0xde, 0x0c, 0x80, 0x00, 0x83,
 0x8c, 0xb9, 0x88, 0xed, 0x77, 0x3c, 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x05, 0x32, 0x00, 0x08, 0x20, 0xab,
 0x9f, 0xff, 0xf4, 0x0a, 0xb4, 0xab, 0x8d, 0x3e, 0x09, 0x25, 0xff, 0xff,
 0xe8, 0x9f, 0xff, 0xf4, 0x4f, 0xff, 0xfa, 0x27, 0xff, 0xfd, 0x07, 0x30,
 0x04, 0x2d, 0x20, 0x47, 0x38, 0x95, 0xab, 0xfc, 0x00, 0x6b, 0x19, 0x05,
 0xce, 0x53, 0x10, 0xa6, 0xed, 0x08, 0x12, 0xc0, 0x90, 0x00, 0x26, 0x1a,
 0x00, 0x21, 0xfb, 0x90, 0xfc, 0x84, 0x24, 0x10, 0xcd, 0x72, 0x00, 0x14,
 0xd2, 0x35, 0x91, 0x86, 0x37, 0x5e, 0x9b, 0x20, 0x00, 0x41, 0x05, 0xdc,
 0xff, 0xe0, 0x18, 0x57, 0xe0, 0x02, 0x98, 0xf7, 0x33, 0x98, 0x55, 0x3d,
 0x47, 0xab, 0xdf, 0xe8, 0x30, 0x01, 0xab, 0x58, 0x48, 0x53, 0xb1, 0x8a,
 0x7a, 0xbd, 0xd5, 0x8f, 0x87, 0xe0, 0x01, 0x0c, 0xa4, 0x12, 0xad, 0xcc,
 0x29, 0x1a, 0xd0, 0x83, 0xd9, 0xc2, 0x9a, 0xf4, 0xd0, 0x38, 0x08, 0xa4,
 0xcb, 0xf2, 0xfc, 0xb0, 0xe0, 0x9c, 0x79, 0x7f, 0xff, 0xfe, 0x10, 0x61,
 0xef, 0xc0, 0x01, 0x93, 0x46, 0x83, 0x76, 0xea, 0x41, 0x8d, 0xf7, 0x4b,
 0x14, 0x1c, 0x00, 0x04, 0x10, 0x20, 0x18, 0x00, 0x08, 0x14, 0xf0, 0x91,
 0xcd, 0xb8, 0x08, 0xd4, 0xb7, 0xcf, 0x7f, 0xff, 0xd0, 0x43, 0xdf, 0xd0,
 0x81, 0x83, 0xca, 0xc0, 0x05, 0x34, 0x63, 0x27, 0x15, 0x4d, 0x52, 0x0d,
 0xda,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 0x62, 0xb9, 0xbd, 0x5e, 0x1c, 0x05, 0xd9,
 0x81, 0x0d, 0x34, 0xdb, 0x57, 0xfc, 0x03, 0x0e, 0x81, 0x54, 0x20, 0x04,
 0x86, 0x28, 0x40, 0x09, 0x0c, 0x5f, 0xc0, 0x15, 0x24, 0x63, 0x05, 0x38,
 0xc3, 0x6d, 0x5f, 0x58, 0x02, 0xa1, 0x67, 0x70, 0x53, 0x0c, 0x36, 0xd5,
 0xff, 0xf0, 0x0d, 0x87, 0x70, 0x00, 0x4c, 0xc8, 0x64, 0x70, 0xcc, 0x6e,
 0x20, 0x91, 0xe6, 0x38, 0xfc, 0x61, 0x70, 0x40, 0xfc, 0x20, 0x08, 0x75,
 0x94, 0x10, 0x04, 0x15, 0x66, 0x61, 0x35, 0xc3, 0xec, 0x47, 0x2f, 0xab,
 0xc5, 0x81, 0x01, 0x4c, 0xe1, 0x32, 0x70, 0xd5, 0x88, 0xe7, 0xf5, 0x78,
 0xb0, 0x08, 0x05, 0x33, 0xff, 0x05, 0xfd, 0x82, 0xff, 0xaf, 0x80, 0x02,
 0x79, 0x0e, 0x33, 0x1f, 0xa4, 0x19, 0xa4, 0x2d, 0x70, 0x42, 0x08, 0x01,
 0x3c, 0x06, 0x08, 0x01, 0x38, 0x25, 0x43, 0x82, 0x61, 0x6e, 0x00, 0x12,
 0xf0, 0x9b, 0x39, 0x41, 0x51, 0xea, 0xf1, 0x00, 0x98, 0x5b, 0x90, 0xe4,
 0x64, 0xb8, 0x00, 0x4a, 0xd0, 0x99, 0x1c, 0xa0, 0x55, 0x7a, 0xbc, 0x41,
 0x19, 0x2e, 0x7f, 0xff, 0xd0, 0x63, 0x2e, 0xa6, 0x3c, 0x00, 0x19, 0xb4,
 0x49, 0x8d, 0xfa, 0x11, 0x1d, 0xd2, 0x33, 0xe8, 0xef, 0xff, 0xfe, 0xfc,
 0x07, 0x00, 0x10, 0x41, 0xaa, 0x4b, 0x7e, 0x00, 0x0d, 0xd3, 0x26, 0xc4,
 0xf3, 0x15, 0x1d, 0x13, 0x9f, 0x04, 0x2c, 0x0e, 0x00, 0xc1, 0x02, 0x40,
 0x07, 0x81, 0xb4, 0x70, 0x75, 0x43, 0xf0, 0x3c, 0xc5, 0x70, 0x8f, 0xff,
 0xff, 0xb0, 0xc7, 0x80, 0x03, 0x36, 0x89, 0x31, 0xbf, 0xc4, 0x47, 0x7d,
 0x04, 0xfb, 0xf8, 0x07, 0xff, 0xb0, 0x45, 0xcb, 0x9e, 0xc2, 0x05, 0xd9,
 0x82, 0x00, 0x11, 0x58, 0xaf, 0xff, 0xfb, 0x08, 0xdf, 0xff, 0xff, 0x61,
 0x1b, 0x7f, 0xff, 0xec, 0x15, 0x76, 0xff, 0xff, 0xdd, 0xff, 0xff, 0xec,
 0x15, 0x44, 0x7b, 0xff, 0xcd, 0x7f, 0xff, 0xec, 0x23, 0x77, 0xff, 0xfe,
 0xc8, 0x9f
}



-
ffmpeg - Take Frame Accurate Screenshot
20 septembre 2019, par miketrying to find a way to take frame accurate screenshots with ffmpeg WITHOUT re-encoding the video.
When I use :
ffmpeg -ss -i input -vframes 1 -q:v 2 output.jpg
with -ss being hh:mm:ss.ms, not matter how I specify the milliseconds, it is never frame accurate with this command. it seems to be landing on the nearest keyframe (which is not accurate enough for my application).
So, my question is :
Without re-encoding the video (ergo specifying -ss flag AFTER the input) is there any way to pull frame accurate screenshots via ffmpeg ?
If not, is there another solution on Windows that would allow that via command line ?
Thanks !
ffmpeg log report part 1 :
ffmpeg started on 2018-01-22 at 02:52:59
Report written to "ffmpeg-20180122-025259.log"
Command line:
"D:\\ffmpeg-3.4.1-win64-static\\bin\\ffmpeg.exe" -ss 1:31:25.9885 -i "V:\\Test\\BDMV\\STREAM\\00000.m2ts" -vframes 1 -q:v 2 -report output.jpg
ffmpeg version N-89674-g57d0c24132 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-amf --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
libavutil 56. 7.100 / 56. 7.100
libavcodec 58. 9.100 / 58. 9.100
libavformat 58. 3.100 / 58. 3.100
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 8.100 / 7. 8.100
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
Splitting the commandline.
Reading option '-ss' ... matched as option 'ss' (set the start time offset) with argument '1:31:25.9885'.
Reading option '-i' ... matched as input url with argument 'V:\Test\BDMV\STREAM\00000.m2ts'.
Reading option '-vframes' ... matched as option 'vframes' (set the number of video frames to output) with argument '1'.
Reading option '-q:v' ... matched as option 'q' (use fixed quality scale (VBR)) with argument '2'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option 'output.jpg' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url V:\Test\BDMV\STREAM\00000.m2ts.
Applying option ss (set the start time offset) with argument 1:31:25.9885.
Successfully parsed a group of options.
Opening an input file: V:\Test\BDMV\STREAM\00000.m2ts.
[NULL @ 000001e53135a680] Opening 'V:\Test\BDMV\STREAM\00000.m2ts' for reading
[file @ 000001e53135b740] Setting default whitelist 'file,crypto'
[mpegts @ 000001e53135a680] Format mpegts probed with size=2048 and score=50
[mpegts @ 000001e53135a680] stream=0 stream_type=1b pid=1011 prog_reg_desc=HDMV
[mpegts @ 000001e53135a680] stream=1 stream_type=86 pid=1100 prog_reg_desc=HDMV
[mpegts @ 000001e53135a680] stream=2 stream_type=90 pid=1200 prog_reg_desc=HDMV
[mpegts @ 000001e53135a680] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0 nb_streams:3
[mpegts @ 000001e53135a680] parser not found for codec hdmv_pgs_subtitle, packets or times may be invalid.
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[AVBSFContext @ 000001e5313b4380] nal_unit_type: 9, nal_ref_idc: 0
[AVBSFContext @ 000001e5313b4380] nal_unit_type: 7, nal_ref_idc: 3
[AVBSFContext @ 000001e5313b4380] nal_unit_type: 8, nal_ref_idc: 3
[AVBSFContext @ 000001e5313b4380] nal_unit_type: 6, nal_ref_idc: 0
[AVBSFContext @ 000001e5313b4380] nal_unit_type: 6, nal_ref_idc: 0
[AVBSFContext @ 000001e5313b4380] nal_unit_type: 5, nal_ref_idc: 3
[AVBSFContext @ 000001e5313b4380] nal_unit_type: 5, nal_ref_idc: 3
[AVBSFContext @ 000001e5313b4380] nal_unit_type: 5, nal_ref_idc: 3
[AVBSFContext @ 000001e5313b4380] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 000001e53135c940] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 000001e53135c940] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 000001e53135c940] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 000001e53135c940] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 000001e53135c940] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 000001e53135c940] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 000001e53135c940] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 000001e53135c940] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 000001e53135c940] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] Format yuv420p chosen by get_format().
[h264 @ 000001e53135c940] Reinit context to 1920x1088, pix_fmt: yuv420p
[h264 @ 000001e53135c940] no picture
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[h264 @ 000001e53135c940] ct_type:0 pic_struct:0
[mpegts @ 000001e53135a680] max_analyze_duration 7000000 reached at 7008000 microseconds st:1
[mpegts @ 000001e53135a680] rfps: 23.916667 0.014415
[mpegts @ 000001e53135a680] rfps: 23.916667 0.014415
[mpegts @ 000001e53135a680] rfps: 24.000000 0.002352
[mpegts @ 000001e53135a680] rfps: 24.000000 0.007275
[mpegts @ 000001e53135a680] rfps: 48.000000 0.009407
[mpegts @ 000001e53135a680] rfps: 48.000000 0.013337
[mpegts @ 000001e53135a680] rfps: 23.976024 0.000000
[mpegts @ 000001e53135a680] rfps: 23.976024 0.000000
[mpegts @ 000001e53135a680] rfps: 47.952048 0.000000
[mpegts @ 000001e53135a680] rfps: 47.952048 0.000000
[mpegts @ 000001e53135a680] start time for stream 2 is not set in estimate_timings_from_pts
[mpegts @ 000001e53135a680] Could not find codec parameters for stream 2 (Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 000001e53135a680] After avformat_find_stream_info() pos: 0 bytes read:2494608 seeks:2 frames:828
[NULL @ 000001e53135c940] nal_unit_type: 7, nal_ref_idc: 3
[NULL @ 000001e53135c940] nal_unit_type: 8, nal_ref_idc: 3
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
[NULL @ 000001e53135c940] nal_unit_type: 7, nal_ref_idc: 3
[NULL @ 000001e53135c940] nal_unit_type: 8, nal_ref_idc: 3
[NULL @ 000001e53135c940] nal_unit_type: 7, nal_ref_idc: 3
[NULL @ 000001e53135c940] nal_unit_type: 8, nal_ref_idc: 3
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
[NULL @ 000001e53135c940] nal_unit_type: 7, nal_ref_idc: 3
[NULL @ 000001e53135c940] nal_unit_type: 8, nal_ref_idc: 3
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
[NULL @ 000001e53135c940] nal_unit_type: 7, nal_ref_idc: 3
[NULL @ 000001e53135c940] nal_unit_type: 8, nal_ref_idc: 3
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
[NULL @ 000001e53135c940] nal_unit_type: 7, nal_ref_idc: 3
[NULL @ 000001e53135c940] nal_unit_type: 8, nal_ref_idc: 3
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
[NULL @ 000001e53135c940] nal_unit_type: 7, nal_ref_idc: 3
[NULL @ 000001e53135c940] nal_unit_type: 8, nal_ref_idc: 3
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
[NULL @ 000001e53135c940] nal_unit_type: 7, nal_ref_idc: 3
[NULL @ 000001e53135c940] nal_unit_type: 8, nal_ref_idc: 3
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
[NULL @ 000001e53135c940] nal_unit_type: 7, nal_ref_idc: 3
[NULL @ 000001e53135c940] nal_unit_type: 8, nal_ref_idc: 3
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
[NULL @ 000001e53135c940] nal_unit_type: 7, nal_ref_idc: 3
[NULL @ 000001e53135c940] nal_unit_type: 8, nal_ref_idc: 3
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
[NULL @ 000001e53135c940] nal_unit_type: 7, nal_ref_idc: 3
[NULL @ 000001e53135c940] nal_unit_type: 8, nal_ref_idc: 3
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
[NULL @ 000001e53135c940] nal_unit_type: 7, nal_ref_idc: 3
[NULL @ 000001e53135c940] nal_unit_type: 8, nal_ref_idc: 3
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
[NULL @ 000001e53135c940] nal_unit_type: 7, nal_ref_idc: 3
[NULL @ 000001e53135c940] nal_unit_type: 8, nal_ref_idc: 3
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
[NULL @ 000001e53135c940] ct_type:0 pic_struct:0
Input #0, mpegts, from 'V:\Test\BDMV\STREAM\00000.m2ts':
Duration: 01:39:08.15, start: 600.000000, bitrate: 25263 kb/s
Program 1
Stream #0:0[0x1011], 169, 1/90000: Video: h264 (High) (HDMV / 0x564D4448), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
Stream #0:1[0x1100], 659, 1/90000: Audio: dts (DTS-HD MA) ([134][0][0][0] / 0x0086), 48000 Hz, stereo, s16p
Stream #0:2[0x1200], 0, 1/90000: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
Successfully opened the file. -
Applying filter complex fails with something related to audio
18 septembre 2014, par AlinI finally managed to build ffmpeg as detailed in here : https://enoent.fr/blog/2014/06/20/compile-ffmpeg-for-android/ and in the end, I have a ffmpeg library which accepts command arguments.
I am trying to apply a watermark image over the video so for it I am using preparing this ffmpeg command :
ffmpeg -i input.avi -i logo.png -filter_complex 'overlay=10:main_h-overlay_h-10' output.avi
I have first tried it on windows using ffmpeg.exe and the result was as expected.
I have tried it on android using the compiled android and the output is as follows :
09-17 22:03:34.455: I/Videokit(18419): Loading native library compiled at 22:33:10 Sep 15 2014
09-17 22:03:34.455: I/Videokit(18419): Option: ffmpeg
09-17 22:03:34.455: I/Videokit(18419): Option: -loglevel
09-17 22:03:34.455: I/Videokit(18419): Option: debug
09-17 22:03:34.455: I/Videokit(18419): Option: -i
09-17 22:03:34.455: I/Videokit(18419): Option: /storage/emulated/0/vid.mp4
09-17 22:03:34.455: I/Videokit(18419): Option: -i
09-17 22:03:34.455: I/Videokit(18419): Option: /storage/emulated/0/logo.png
09-17 22:03:34.455: I/Videokit(18419): Option: -qscale:v
09-17 22:03:34.455: I/Videokit(18419): Option: 1
09-17 22:03:34.455: I/Videokit(18419): Option: -filter_complex
09-17 22:03:34.455: I/Videokit(18419): Option: overlay=10:main_h-overlay_h-10
09-17 22:03:34.455: I/Videokit(18419): Option: /storage/emulated/0/outVid.mp4
09-17 22:03:34.455: I/Videokit(18419): Running main
09-17 22:03:34.463: D/Videokit(18419): Splitting the commandline.
09-17 22:03:34.463: D/Videokit(18419): Reading option '-loglevel' ...
09-17 22:03:34.463: D/Videokit(18419): matched as option 'loglevel' (set logging level) with argument 'debug'.
09-17 22:03:34.463: D/Videokit(18419): Reading option '-i' ...
09-17 22:03:34.463: D/Videokit(18419): matched as input file with argument '/storage/emulated/0/vid.mp4'.
09-17 22:03:34.463: D/Videokit(18419): Reading option '-i' ...
09-17 22:03:34.463: D/Videokit(18419): matched as input file with argument '/storage/emulated/0/logo.png'.
09-17 22:03:34.463: D/Videokit(18419): Reading option '-qscale:v' ...
09-17 22:03:34.463: D/Videokit(18419): matched as option 'qscale' (use fixed quality scale (VBR)) with argument '1'.
09-17 22:03:34.463: D/Videokit(18419): Reading option '-filter_complex' ...
09-17 22:03:34.463: D/Videokit(18419): matched as option 'filter_complex' (create a complex filtergraph) with argument 'overlay=10:main_h-overlay_h-10'.
09-17 22:03:34.463: D/Videokit(18419): Reading option '/storage/emulated/0/outVid.mp4' ...
09-17 22:03:34.463: D/Videokit(18419): matched as output file.
09-17 22:03:34.463: D/Videokit(18419): Finished splitting the commandline.
09-17 22:03:34.463: D/Videokit(18419): Parsing a group of options: global .
09-17 22:03:34.463: D/Videokit(18419): Applying option loglevel (set logging level) with argument debug.
09-17 22:03:34.463: D/Videokit(18419): Applying option filter_complex (create a complex filtergraph) with argument overlay=10:main_h-overlay_h-10.
09-17 22:03:34.463: D/Videokit(18419): Successfully parsed a group of options.
09-17 22:03:34.463: D/Videokit(18419): Parsing a group of options: input file /storage/emulated/0/vid.mp4.
09-17 22:03:34.463: D/Videokit(18419): Successfully parsed a group of options.
09-17 22:03:34.463: D/Videokit(18419): Opening an input file: /storage/emulated/0/vid.mp4.
09-17 22:03:34.612: D/Videokit(18419): Successfully opened the file.
09-17 22:03:34.612: D/Videokit(18419): Parsing a group of options: input file /storage/emulated/0/logo.png.
09-17 22:03:34.612: D/Videokit(18419): Successfully parsed a group of options.
09-17 22:03:34.612: D/Videokit(18419): Opening an input file: /storage/emulated/0/logo.png.
09-17 22:03:34.620: D/Videokit(18419): Successfully opened the file.
09-17 22:03:34.620: D/Videokit(18419): Parsing a group of options: output file /storage/emulated/0/outVid.mp4.
09-17 22:03:34.620: D/Videokit(18419): Applying option qscale:v (use fixed quality scale (VBR)) with argument 1.
09-17 22:03:34.620: D/Videokit(18419): Successfully parsed a group of options.
09-17 22:03:34.620: D/Videokit(18419): Opening an output file: /storage/emulated/0/outVid.mp4.
09-17 22:03:34.627: D/Videokit(18419): Successfully opened the file.
09-17 22:03:34.643: I/Videokit(18419): Conversion failed!
09-17 22:03:34.643: I/Videokit(18419): Stream mapping:
09-17 22:03:34.643: E/Videokit(18419): Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or heightThe problem is Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height and this is somehow related to audio of the file. I have removed the audio and I get no error.
ffmpeg -i vid.mp4
returns this :Command line:
ffmpeg -i vid.mp4 -report
ffmpeg version N-66278-g91459bd Copyright (c) 2000-2014 the FFmpeg developers
built on Sep 14 2014 22:05:07 with gcc 4.8.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-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-decklink --enable-zlib
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
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 '-i' ... matched as input file with argument 'vid.mp4'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file vid.mp4.
Successfully parsed a group of options.
Opening an input file: vid.mp4.
[mov,mp4,m4a,3gp,3g2,mj2 @ 040e38c0] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 040e38c0] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 040e38c0] Before avformat_find_stream_info() pos: 19279 bytes read:32768 seeks:0
[mov,mp4,m4a,3gp,3g2,mj2 @ 040e38c0] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 040e38c0] After avformat_find_stream_info() pos: 41952 bytes read:65536 seeks:0 frames:2
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'vid.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.19.104
Duration: 00:00:14.58, start: 0.023222, bitrate: 1250 kb/s
Stream #0:0(und), 1, 1/11988: Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x640 [SAR 1:1 DAR 1:1], 1099 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 59.94 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und), 1, 1/44100: Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 97 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2(eng), 0, 1/90000: Data: none (rtp / 0x20707472), 39 kb/s
Metadata:
handler_name : HintHandler
Stream #0:3(eng), 0, 1/44100: Data: none (rtp / 0x20707472), 8 kb/s
Metadata:
handler_name : HintHandler
Successfully opened the file.
At least one output file must be specified
[AVIOContext @ 040e3f40] Statistics: 65536 bytes read, 0 seeks