Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Video HLS with AVPlayer
5 octobre 2016, par Charlie227I've converted .MOV video using this command line :
ffmpeg -re -i 123.mov -vcodec copy -map 0 -f segment -segment_list 123.m3u8 \-segment_list_flags +live -segment_time 3 123%03d.ts
output :
ffmpeg version N-81872-gbe1d324 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4) configuration: --prefix=/usr/local --enable-gpl --enable-nonfree libavutil 55. 32.100 / 55. 32.100 libavcodec 57. 60.101 / 57. 60.101 libavformat 57. 51.102 / 57. 51.102 libavdevice 57. 0.102 / 57. 0.102 libavfilter 6. 63.100 / 6. 63.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 2.100 / 2. 2.100 libpostproc 54. 0.100 / 54. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '123.mov': Metadata: major_brand : qt minor_version : 0 compatible_brands: qt creation_time : 2016-09-26T19:34:01.000000Z Duration: 00:00:20.00, start: 0.000000, bitrate: 1210 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 540x960, 1088 kb/s, 30 fps, 30 tbr, 600 tbn, 1200 tbc (default) Metadata: creation_time : 2016-09-26T19:34:01.000000Z handler_name : Core Media Data Handler encoder : H.264 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 114 kb/s (default) Metadata: creation_time : 2016-09-26T19:34:01.000000Z handler_name : Core Media Data Handler Output #0, segment, to '123%03d.ts': Metadata: major_brand : qt minor_version : 0 compatible_brands: qt encoder : Lavf57.51.102 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 540x960, q=2-31, 1088 kb/s, 30 fps, 30 tbr, 90k tbn, 600 tbc (default) Metadata: creation_time : 2016-09-26T19:34:01.000000Z handler_name : Core Media Data Handler encoder : H.264 Stream #0:1(und): Audio: mp2, 44100 Hz, stereo, s16, 384 kb/s (default) Metadata: creation_time : 2016-09-26T19:34:01.000000Z handler_name : Core Media Data Handler encoder : Lavc57.60.101 mp2 Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (aac (native) -> mp2 (native)) Press [q] to stop, [?] for help frame= 1 fps=1.0 q=-1.0 size=N/A time=00:00:01.00 bitrate=N/A speed=0.996x frame= 32 fps= 16 q=-1.0 size=N/A time=00:00:02.00 bitrate=N/A speed=0.987x frame= 47 fps= 19 q=-1.0 size=N/A time=00:00:02.52 bitrate=N/A speed=0.996x frame= 63 fps= 21 q=-1.0 size=N/A time=00:00:03.01 bitrate=N/A speed=0.993x frame= 77 fps= 22 q=-1.0 size=N/A time=00:00:03.54 bitrate=N/A speed=0.998x frame= 93 fps= 23 q=-1.0 size=N/A time=00:00:04.03 bitrate=N/A speed=0.995x frame= 108 fps= 24 q=-1.0 size=N/A time=00:00:04.56 bitrate=N/A speed=0.999x frame= 123 fps= 24 q=-1.0 size=N/A time=00:00:05.05 bitrate=N/A speed=0.997x frame= 139 fps= 25 q=-1.0 size=N/A time=00:00:05.55 bitrate=N/A speed=0.996x frame= 154 fps= 25 q=-1.0 size=N/A time=00:00:06.04 bitrate=N/A speed=0.994x frame= 169 fps= 26 q=-1.0 size=N/A time=00:00:06.57 bitrate=N/A speed=0.997x frame= 184 fps= 26 q=-1.0 size=N/A time=00:00:07.09 bitrate=N/A speed=0.999x frame= 199 fps= 26 q=-1.0 size=N/A time=00:00:07.59 bitrate=N/A speed=0.998x frame= 230 fps= 27 q=-1.0 size=N/A time=00:00:08.58 bitrate=N/A speed=0.995x frame= 261 fps= 27 q=-1.0 size=N/A time=00:00:09.60 bitrate=N/A speed=0.996x frame= 275 fps= 27 q=-1.0 size=N/A time=00:00:10.12 bitrate=N/A speed=0.998x frame= 306 fps= 27 q=-1.0 size=N/A time=00:00:11.14 bitrate=N/A speed=0.999x frame= 337 fps= 28 q=-1.0 size=N/A time=00:00:12.13 bitrate=N/A speed=0.997x frame= 352 fps= 28 q=-1.0 size=N/A time=00:00:12.65 bitrate=N/A speed=0.998x frame= 367 fps= 28 q=-1.0 size=N/A time=00:00:13.15 bitrate=N/A speed=0.997x frame= 382 fps= 28 q=-1.0 size=N/A time=00:00:13.67 bitrate=N/A speed=0.999x frame= 412 fps= 28 q=-1.0 size=N/A time=00:00:14.69 bitrate=N/A speed=0.999x frame= 428 fps= 28 q=-1.0 size=N/A time=00:00:15.19 bitrate=N/A speed=0.998x frame= 443 fps= 28 q=-1.0 size=N/A time=00:00:15.68 bitrate=N/A speed=0.998x frame= 473 fps= 28 q=-1.0 size=N/A time=00:00:16.70 bitrate=N/A speed=0.998x frame= 488 fps= 28 q=-1.0 size=N/A time=00:00:17.22 bitrate=N/A speed=0.999x frame= 519 fps= 28 q=-1.0 size=N/A time=00:00:18.24 bitrate=N/A speed=0.999x frame= 550 fps= 29 q=-1.0 size=N/A time=00:00:19.24 bitrate=N/A speed=0.998x frame= 565 fps= 29 q=-1.0 size=N/A time=00:00:19.76 bitrate=N/A speed=0.999x frame= 601 fps= 30 q=-1.0 Lsize=N/A time=00:00:20.02 bitrate=N/A speed= 1x video:2663kB audio:939kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
The final video is available here, i'm able to read it from Safari on Mac OS, but it doesn't work on iOS using AVPlayer or Safari.
I also tried to play it using this sample code provided by Apple, however i get the following error : "The decoder required for this media cannot be found"
Any help is appreciated
edit 1
I've edit the command line, and now i'm able to play the video using AVPlayer, but there is no sound...
ffmpeg -i 123.mov -c:a libfdk_aac -profile:a aac_he -b:a 64k -c:v h264 -preset slow -map 0 -an -flags -global_header -f hls -hls_time 2 123%03d.ts
OUTPUT :
ffmpeg version N-81883-gbeb877b Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4) configuration: --enable-gpl --enable-nonfree --enable-shared --enable-libfdk-aac --enable-libx264 --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib libavutil 55. 32.100 / 55. 32.100 libavcodec 57. 60.101 / 57. 60.101 libavformat 57. 51.102 / 57. 51.102 libavdevice 57. 0.102 / 57. 0.102 libavfilter 6. 63.100 / 6. 63.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 2.100 / 2. 2.100 libpostproc 54. 0.100 / 54. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '123.mov': Metadata: major_brand : qt minor_version : 0 compatible_brands: qt creation_time : 2016-09-26T19:34:01.000000Z Duration: 00:00:20.00, start: 0.000000, bitrate: 1210 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 540x960, 1088 kb/s, 30 fps, 30 tbr, 600 tbn, 1200 tbc (default) Metadata: creation_time : 2016-09-26T19:34:01.000000Z handler_name : Core Media Data Handler encoder : H.264 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 114 kb/s (default) Metadata: creation_time : 2016-09-26T19:34:01.000000Z handler_name : Core Media Data Handler Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (123%03d.ts) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream. Codec AVOption profile () specified for output file #0 (123%03d.ts) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream. [libx264 @ 0x14ca8a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX [libx264 @ 0x14ca8a0] profile High, level 3.1 Output #0, hls, to '123%03d.ts': Metadata: major_brand : qt minor_version : 0 compatible_brands: qt encoder : Lavf57.51.102 Stream #0:0(und): Video: h264 (libx264), yuv420p, 540x960, q=-1--1, 30 fps, 90k tbn, 30 tbc (default) Metadata: creation_time : 2016-09-26T19:34:01.000000Z handler_name : Core Media Data Handler encoder : Lavc57.60.101 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1 Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help frame= 600 fps= 79 q=-1.0 Lsize=N/A time=00:00:19.90 bitrate=N/A dup=1 drop=0 speed=2.63x video:3542kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown [libx264 @ 0x14ca8a0] frame I:18 Avg QP:21.70 size: 13958 [libx264 @ 0x14ca8a0] frame P:326 Avg QP:23.78 size: 7702 [libx264 @ 0x14ca8a0] frame B:256 Avg QP:24.83 size: 3380 [libx264 @ 0x14ca8a0] consecutive B-frames: 26.8% 46.0% 8.5% 18.7% [libx264 @ 0x14ca8a0] mb I I16..4: 21.5% 71.7% 6.9% [libx264 @ 0x14ca8a0] mb P I16..4: 14.9% 29.6% 1.5% P16..4: 32.2% 5.4% 2.2% 0.0% 0.0% skip:14.1% [libx264 @ 0x14ca8a0] mb B I16..4: 3.0% 4.4% 0.3% B16..8: 37.9% 4.5% 0.4% direct: 5.0% skip:44.6% L0:50.0% L1:47.1% BI: 2.9% [libx264 @ 0x14ca8a0] 8x8 transform intra:64.3% inter:82.5% [libx264 @ 0x14ca8a0] direct mvs spatial:97.7% temporal:2.3% [libx264 @ 0x14ca8a0] coded y,uvDC,uvAC intra: 30.0% 44.4% 4.9% inter: 10.1% 20.7% 0.4% [libx264 @ 0x14ca8a0] i16 v,h,dc,p: 29% 33% 13% 26% [libx264 @ 0x14ca8a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 24% 18% 4% 5% 6% 8% 5% 6% [libx264 @ 0x14ca8a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 35% 11% 4% 6% 5% 9% 4% 6% [libx264 @ 0x14ca8a0] i8c dc,h,v,p: 36% 29% 23% 12% [libx264 @ 0x14ca8a0] Weighted P-Frames: Y:0.9% UV:0.3% [libx264 @ 0x14ca8a0] ref P L0: 80.5% 9.7% 6.1% 2.0% 1.3% 0.2% [libx264 @ 0x14ca8a0] ref B L0: 92.2% 5.5% 2.0% 0.3% [libx264 @ 0x14ca8a0] ref B L1: 99.0% 1.0% [libx264 @ 0x14ca8a0] kb/s:1450.98
-
Java runtime not able to run command on mac
5 octobre 2016, par sunderI installed ffmpeg on mac through brew install. When i run ffmpeg command from terminal, it is running fine. But when i create a program in java and execute command like
Runtime.getRuntime().exec("ffmpeg");
It is throwing IOException Cannot run program "ffmpeg":error=2, No such file or directory. Any idea how to resolve it?
-
ffmpeg stop the process after generating thumbnail
5 octobre 2016, par arjunI have installed the ffmpeg in linux server for generating the video thumb nail installed ffmpeg using following commands
sudo add-apt-repository ppa:mc3man/trusty-media sudo apt-get update sudo apt-get install ffmpeg
installed in /usr/bin/ffmpeg location
Here i am calling ffmpeg in my java code
thumbnail videoThumbTaker = new thumbnail("/usr/bin/ffmpeg"); videoThumbTaker.getThumb(uploadedFileLocation, thumbnailimagepath,originalLocation, 900, 900, 0, 0, 1);
Thumbnail is successfully generated,the problem is after generating the thumbnail,ffmpeg process is continuously running,its not stoped.How can achive this!!
-
Looking for Sox (Sound eXchange) libs port for android
5 octobre 2016, par azure313I'm new to mobile development, and i'm developing a mobile application with sound effect functions. I find out that Sox (Sound eXchange) is very strong in desktop environment, and very easy to use, but it didn't have any libs Port for Android.
Does anyone know how to port SoX to Android or is there any other libs instead?
I already try ffmpeg, but it didn't have Reverb effect, so i switch to SoX.
Thank.
-
Convert video file to m2v using FFmpeg
5 octobre 2016, par utdevHow can I convert a video file
video.mpg
to a
video.m2v
plus a
'video.mp2'
file?
Thus the
video.m2v
file shall have no audio stream, I read thatvideo.m2v
files do not have an audio stream, but I am not sure.Edit I used Nilz11 command:
ffmpeg -i input.mpg -codec:v mpeg2video out.m2v
and it created me and
.m2v
, but mydvdauthroing
tool still gives me an error, if I useVLC
to convert the.mpg
file to an .m2v file the dvdauthoring tool gives me none, does someone know why this is happening?Edit: I compared Both files
and what I found out is that the file which did not work had a bitrate of :
0
and the file which did work had a bitrate of:
8000
I am not sure but this is the only difference I found between these two files.
Edit
Another thing I have to mention is that the
.m2v
file has to be DVD conform.