I'm trying to remove a few seconds off the front of a video stream (audio already excluded), and I'm getting strange results: I would think that for every second I increase -ss by, the resulting file would be a second shorter... that doesn't seem to be the case.
original ==> 01:04:52.84
-ss 19 ==> 01:04:42.84 (diff = 10) [command history shown below]
-ss 20 ==> 01:04:32.84 (diff = 20) [command history shown below]
-ss 21 ==> 01:04:32.84 (diff = 20)
-ss 25 ==> 01:04:32.84 (diff = 20)
-ss 0:0:25.0 ==> 01:04:32.84 (diff = 20)
-ss 0:0:25.5 ==> 01:04:32.84 (diff = 20) [command history shown below]
Command: ffmpeg -ss # -i temp.mp4 -y -vcodec copy temp_croppedFromStart.mp4
Here's the command history for 19 & 20
# ffmpeg -ss 19 -i temp.mp4 -y -vcodec copy temp_croppedFromStart.mp4; ffmpeg -i temp.mp4 2>&1 | grep Duration; ffmpeg -i temp_croppedFromStart.mp4 2>&1 | grep Duration
ffmpeg version N-31809-g9acffed, Copyright (c) 2000-2011 the FFmpeg developers
built on Aug 10 2011 21:25:11 with gcc 4.4.5
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 51. 11. 1 / 51. 11. 1
libavcodec 53. 10. 0 / 53. 10. 0
libavformat 53. 6. 0 / 53. 6. 0
libavdevice 53. 2. 0 / 53. 2. 0
libavfilter 2. 28. 1 / 2. 28. 1
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'temp.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01 00:00:00
encoder : Lavf53.6.0
Duration: 01:04:52.84, start: 0.000000, bitrate: 553 kb/s
Stream #0.0(und): Video: h264 (Constrained Baseline), yuv420p, 960x640, 552 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
Output #0, mp4, to 'temp_croppedFromStart.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01 00:00:00
encoder : Lavf53.6.0
Stream #0.0(und): Video: libx264, yuv420p, 960x640, q=2-31, 552 kb/s, 25 tbn, 25 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop, [?] for help
frame=97071 fps=42523 q=-1.0 Lsize= 262684kB time=01:04:33.84 bitrate= 555.5kbits/s
video:261923kB audio:0kB global headers:0kB muxing overhead 0.290418%
Duration: 01:04:52.84, start: 0.000000, bitrate: 553 kb/s
Duration: 01:04:42.84, start: 0.000000, bitrate: 554 kb/s
# ffmpeg -ss 20 -i temp.mp4 -y -vcodec copy temp_croppedFromStart.mp4; ffmpeg -i temp.mp4 2>&1 | grep Duration; ffmpeg -i temp_croppedFromStart.mp4 2>&1 | grep Duration
ffmpeg version N-31809-g9acffed, Copyright (c) 2000-2011 the FFmpeg developers
built on Aug 10 2011 21:25:11 with gcc 4.4.5
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 51. 11. 1 / 51. 11. 1
libavcodec 53. 10. 0 / 53. 10. 0
libavformat 53. 6. 0 / 53. 6. 0
libavdevice 53. 2. 0 / 53. 2. 0
libavfilter 2. 28. 1 / 2. 28. 1
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'temp.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01 00:00:00
encoder : Lavf53.6.0
Duration: 01:04:52.84, start: 0.000000, bitrate: 553 kb/s
Stream #0.0(und): Video: h264 (Constrained Baseline), yuv420p, 960x640, 552 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
Output #0, mp4, to 'temp_croppedFromStart.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01 00:00:00
encoder : Lavf53.6.0
Stream #0.0(und): Video: libx264, yuv420p, 960x640, q=2-31, 552 kb/s, 25 tbn, 25 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop, [?] for help
frame=96821 fps=47168 q=-1.0 Lsize= 262003kB time=01:04:32.84 bitrate= 554.2kbits/s
video:261244kB audio:0kB global headers:0kB muxing overhead 0.290410%
Duration: 01:04:52.84, start: 0.000000, bitrate: 553 kb/s
Duration: 01:04:32.84, start: 0.000000, bitrate: 554 kb/s
# ffmpeg -ss 0:0:25.5 -i temp.mp4 -y -vcodec copy temp_croppedFromStart.mp4; ffmpeg -i temp.mp4 2>&1 | grep Duration; ffmpeg -i temp_croppedFromStart.mp4 2>&1 | grep Duration
ffmpeg version N-31809-g9acffed, Copyright (c) 2000-2011 the FFmpeg developers
built on Aug 10 2011 21:25:11 with gcc 4.4.5
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 51. 11. 1 / 51. 11. 1
libavcodec 53. 10. 0 / 53. 10. 0
libavformat 53. 6. 0 / 53. 6. 0
libavdevice 53. 2. 0 / 53. 2. 0
libavfilter 2. 28. 1 / 2. 28. 1
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'temp.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01 00:00:00
encoder : Lavf53.6.0
Duration: 01:04:52.84, start: 0.000000, bitrate: 553 kb/s
Stream #0.0(und): Video: h264 (Constrained Baseline), yuv420p, 960x640, 552 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
Output #0, mp4, to 'temp_croppedFromStart.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01 00:00:00
encoder : Lavf53.6.0
Stream #0.0(und): Video: libx264, yuv420p, 960x640, q=2-31, 552 kb/s, 25 tbn, 25 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop, [?] for help
frame=96821 fps=45920 q=-1.0 Lsize= 262003kB time=01:04:27.32 bitrate= 555.0kbits/s
video:261244kB audio:0kB global headers:0kB muxing overhead 0.290424%
Duration: 01:04:52.84, start: 0.000000, bitrate: 553 kb/s
Duration: 01:04:32.84, start: 0.000000, bitrate: 554 kb/s
Without re-encoding, you can only cut at an I-frame. Your I-frames look to be 10 seconds apart, which is rather long, but not unheard of.
You can read more about what an I-frame is here: http://en.wikipedia.org/wiki/Video_compression_picture_types
Related
I'm trying to convert an image sequence into a Quicktime DnxHR with 4:4:4 sampling in Rec2020 colorspace using FFMpeg 4.1.3. But I'm always ending with 4:2:0 Rec709 file.
In my lastest attempt FFMpeg seems to de the right thing :
ffmpeg.exe -y -i "C:/TEST/final-%04d.dpx" -c:v dnxhd -vf "scale=3840:2160,fps=24,format=yuv444p12le" -profile:v dnxhr_444 -color_primaries 9 -colorspace 9 -color_range 2 C:/TEST/test.mov
During encoding the output stream is shown as 444 / bt2020
Output #0, mov, to 'C:/TEST/test.mov':
Metadata:
encoder : Lavf58.20.100
Stream #0:0: Video: dnxhd (DNXHR 444) (AVdh / 0x68645641), yuv444p10le(pc, bt2020nc/bt2020/unknown), 3840x2160, q=2-1024, 200 kb/s, 24 fps, 12288 tbn, 24 tbc
Metadata:
encoder : Lavc58.35.100 dnxhd
frame= 10 fps=3.3 q=1.0 Lsize= 71161kB time=00:00:00.37
bitrate=1554195.5kbits/s speed=0.122x
video:71160kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.001114%
But when I inspect the output file FFMpeg says it's in bt709
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:/TEST/test.mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf58.20.100
Duration: 00:00:00.42, start: 0.000000, bitrate: 1397959 kb/s
Stream #0:0(eng): Video: dnxhd (DNXHR 444) (AVdh / 0x68645641),
yuv444p10le(pc, bt709/unknown/unknown), 3840x2160, 1399062 kb/s, 24 fps, 24 tbr, 12288 tbn, 12288 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc58.35.100 dnxhd
And softwares like MediaInfo say the chroma sampling is in 4.2.0
Any ideas ?
As ask in the comment, the full log of the conversion :
C:\Users\pierrech>ffmpeg.exe -y -i "C:/TEST/final-%04d.dpx" -c:v dnxhd -vf colorspace=all=bt2020:iall=bt2020 -profile:v dnxhr_444 -color_primaries bt2020 -colorspace bt2020_ncl -color_range 2 -color_trc bt2020_12bit C:/TEST/test.mov
ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.3.1 (GCC) 20190414
configuration: --enable-gpl --enable-version3 --enable-sdl2 --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-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Input #0, image2, from 'C:/TEST/final-%04d.dpx':
Duration: 00:00:00.40, start: 0.000000, bitrate: N/A
Stream #0:0: Video: dpx, rgb48le, 3840x2160, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (dpx (native) -> dnxhd (native))
Press [q] to stop, [?] for help
Output #0, mov, to 'C:/TEST/test.mov':
Metadata:
encoder : Lavf58.20.100
Stream #0:0: Video: dnxhd (DNXHR 444) (AVdh / 0x68645641), yuv444p10le(pc, bt2020nc/bt2020/bt2020-12), 3840x2160, q=2-1024, 200 kb/s, 25 fps, 12800 tbn, 25 tbc
Metadata:
encoder : Lavc58.35.100 dnxhd
frame= 10 fps=3.8 q=1.0 Lsize= 71161kB time=00:00:00.36 bitrate=1618952.6kbits/s speed=0.136x
video:71160kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.001114%
And after the conversion
C:\Users\pierrech>ffmpeg.exe -i C:\TEST\test.mov -hide_banner
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\TEST\test.mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf58.20.100
Duration: 00:00:00.40, start: 0.000000, bitrate: 1457373 kb/s
Stream #0:0(eng): Video: dnxhd (DNXHR 444) (AVdh / 0x68645641), yuv444p10le(pc, bt709/unknown/unknown), 3840x2160, 1457356 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc58.35.100 dnxhd
At least one output file must be specified
Using the FFmpeg build found here: https://github.com/illuspas/ffmpeg-hw-win32
gcc 5.3.0
--enable-nvenc nvidia_video_sdk_6.0.1
--enable-libmfx Intel(R)_Media_SDK_2016.0.1
--enable-libfdk-aac 0.1.4
--enable-libspeex 1.2rc1
--enable-libx264 1:148.20150725
--enable-libopenh264 1.5.0
--enable-libx265 1.8
--enable-libopus 1.1.2
--enable-libmp3lame 3.99.5
--enable-libkvazaar 0.8.2
./configure --prefix=/home/aliang/FFmpeg/x86_64 --enable-small --disable-debug --disable-doc --arch=x86_64 --cc='ccache x86_64-w64-mingw32-gcc' --cross-prefix=x86_64-w64-mingw32- --enable-cross-compile --target-os=mingw32 --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libspeex --enable-libx264 --enable-libx265 --enable-libmfx --enable-nvenc --enable-libopenh264 --enable-libkvazaar --enable-gpl --enable-nonfree
I'm running Windows on a MacBook Pro. I also tried with a more recent build and had the same output.
Input video is from sample-videos.com.
The ffmpeg command I am running is:
ffmpeg -y -i sample.mp4 -vcodec nvenc_h264 -pixel_format yuv420p -f mp4 sample-out-nvenc.mp4
sample-out-nvenc.mp4 looks like this via ffplay or vlc:
When I grab a frame using jpeg2, the colors appear normal, but the height is squished.
ffmpeg -y -ss 15.5 -i sample.mp4 -vframes 1 -s 480x300 -f image2 grab.jpg
The ffprobe results for the output (sample-out-nvenc.mp4):
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample-out-nvenc.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.25.100
Duration: 00:00:31.02, start: 0.021333, bitrate: 1994 kb/s
Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p(tv), 640x480 [SAR 1:1 DAR 4:3], 1650 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 342 kb/s (default)
Metadata:
handler_name : SoundHandler
Lastly the output from the nvenc encoding command:
ffmpeg -y -i sample.mp4 -vcodec nvenc_h264 -pixel_format yuv420p -f mp4 sample-out-nvenc.mp4
ffmpeg version 3.0 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.0 (GCC)
configuration: --prefix=/home/aliang/FFmpeg/x86_64 --enable-small --disable-debug --disable-doc --arch=x86_64 --cc='ccache x86_64-w64-mingw32-gcc' --cross-prefix=x86_64-w64-mingw32- --enable-cross-compile --target-os=mingw32 --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libspeex --enable-libx264 --enable-libx265 --enable-libmfx --enable-nvenc --enable-libopenh264 --enable-libkvazaar --enable-gpl --enable-nonfree
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01 00:00:00
encoder : Lavf53.24.2
Duration: 00:00:31.00, start: 0.000000, bitrate: 1353 kb/s
Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 966 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : SoundHandler
Output #0, mp4, to 'sample-out-nvenc.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.25.100
Stream #0:0(und): Video: h264 (nvenc_h264) ([33][0][0][0] / 0x0021), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 2000 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : VideoHandler
encoder : Lavc57.24.102 nvenc_h264
Side data:
unknown side data type 10 (24 bytes)
Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, 5.1, fltp, 341 kb/s (default)
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : SoundHandler
encoder : Lavc57.24.102 aac
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (nvenc_h264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 774 fps=253 q=-0.0 Lsize= 7551kB time=00:00:30.99 bitrate=1995.6kbits/s speed=10.1x
video:6236kB audio:1297kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.243011%
[aac # 000001cdd9900520] Qavg: 743.457
I had exactly the same problem, with a GTX 980. This started after installing driver update 368.22. I downloaded and reverted to driver version 365.19 from the nividia driver archive and the problem went away.
So it appears to affect all nvidia cards and drivers.
I experienced the same problem with nvenc through another usecase. It seems to have been caused by the latest nvidia quadro driver. The problem was resolved when I reverted it. As you have a macbook, I guess it's fair to assume you don't have a quadro card, but it still might be a driver problem.
ffmpeg newbie here struggling to do something that apparently should be easy.
I want to concatenate three videos, being one of them just a blank video two seconds transition.
First I generate the blank video with:
ffmpeg -f lavfi -i color=c=black:s=320x240:d=0.5 silent.mp4
After I try to concat it with two other videos I have:
ffmpeg -i video-a.mp4 -i 2-seconds-silent-video.mp4 -i video-b.mp4 -y -filter_complex concat=n=3:v=1:a=1 result.mp4
What I'm getting:
ffmpeg version 2.7.2 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.7.2_1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libvpx --enable-libfdk-aac --enable-libx265 --enable-nonfree --enable-vda
libavutil 54. 27.100 / 54. 27.100
libavcodec 56. 41.100 / 56. 41.100
libavformat 56. 36.100 / 56. 36.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video-a.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.40.101
Duration: 00:00:03.03, start: 0.033333, bitrate: 822 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 691 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '2-seconds-silent-video.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.40.101
Duration: 00:00:02.00, start: 0.000000, bitrate: 17 kb/s
Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 11 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'video-b.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.40.101
Duration: 00:00:03.03, start: 0.033333, bitrate: 745 kb/s
Stream #2:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 613 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #2:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default)
Metadata:
handler_name : SoundHandler
Cannot find a matching stream for unlabeled input pad 5 on filter Parsed_concat_0
What I also tried without success:
ffmpeg -y -i "concat:video-a.mp4|2-seconds-silent-video.mp4|video-b.mp4" -c copy result.mp4
Result:
ffmpeg version 2.7.2 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.7.2_1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libvpx --enable-libfdk-aac --enable-libx265 --enable-nonfree --enable-vda
libavutil 54. 27.100 / 54. 27.100
libavcodec 56. 41.100 / 56. 41.100
libavformat 56. 36.100 / 56. 36.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100
[mov,mp4,m4a,3gp,3g2,mj2 # 0x7fd12a812800] Found duplicated MOOV Atom. Skipped it
Last message repeated 1 times
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'concat:video-a.mp4|2-seconds-silent-video.mp4|video-b.mp4':
Metadata:
encoder : Lavf56.40.101
minor_version : 512
major_brand : isom
compatible_brands: isomiso2avc1mp41
Duration: 00:00:03.03, start: 0.033333, bitrate: 1579 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 691 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
[mp4 # 0x7fd12a033a00] Codec for stream 0 does not use global headers but container format requires global headers
[mp4 # 0x7fd12a033a00] Codec for stream 1 does not use global headers but container format requires global headers
Output #0, mp4, to 'result.mp4':
Metadata:
compatible_brands: isomiso2avc1mp41
minor_version : 512
major_brand : isom
encoder : Lavf56.36.100
Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 691 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 75 fps=0.0 q=-1.0 Lsize= 305kB time=00:00:03.05 bitrate= 818.1kbits/s
video:253kB audio:48kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.179313%
There's no audio stream when I generate my blank video. The solution is add a silent audio stream to the video:
ffmpeg -y -f lavfi -i anullsrc -i 2-seconds-silent-video.mp4 -shortest -c:v copy -c:a aac -strict experimental silent-video.mp4
answered here by #miindlek, thank you.
where I found the line above: adding silent audio in ffmpeg
I'm trying to stream avideo file to localhost http stream.
my ffmpeg version details:
ffmpeg version N-64307-g8657612 Copyright (c) 2000-2014 the FFmpeg developers
built on Jun 29 2014 22:09:38 with gcc 4.8.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-
libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libope
njpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsox
r --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 52. 90.101 / 52. 90.101
libavcodec 55. 68.100 / 55. 68.100
libavformat 55. 44.100 / 55. 44.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 9.100 / 4. 9.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfi
le}...
when I use:
C:\Users\USER>ffmpeg -re -i myfile.mp4 -f flv udp://localhost:1234
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'myfile.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.44.100
compilation : 0
Duration: 00:00:04.17, start: 0.036281, bitrate: 268 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480 [
SAR 1:1 DAR 4:3], 132 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 12
8 kb/s (default)
Metadata:
handler_name : SoundHandler
[flv # 00000000003fc780] Using AVStream.codec.time_base as a timebase hint to th
e muxer is deprecated. Set AVStream.time_base instead.
Last message repeated 1 times
Output #0, flv, to 'udp://localhost:1234':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
compilation : 0
encoder : Lavf55.44.100
Stream #0:0(und): Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p, 640x48
0 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc55.68.100 flv
Stream #0:1(und): Audio: mp3 (libmp3lame) ([2][0][0][0] / 0x0002), 44100 Hz,
stereo, fltp (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc55.68.100 libmp3lame
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> flv1 (flv))
Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
frame= 5 fps=0.0 q=2.0 size= 32kB time=00:00:00.44 bitrate= 591.6kbits/s
frame= 18 fps= 18 q=3.6 size= 77kB time=00:00:00.94 bitrate= 668.8kbits/s
frame= 30 fps= 20 q=8.4 size= 115kB time=00:00:01.46 bitrate= 642.5kbits/s
its working.
but when I use http:
C:\Users\USER>ffmpeg -re -i myfile.mp4 -f flv http://localhost:1234
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'myfile.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.44.100
compilation : 0
Duration: 00:00:04.17, start: 0.036281, bitrate: 268 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480 [
SAR 1:1 DAR 4:3], 132 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 12
8 kb/s (default)
Metadata:
handler_name : SoundHandler
http://localhost:1234: Input/output error
I get Input/output error.
in linux its working with ffserver.
but in windows I get this exception.
You are using two different protocols (udp and http) so the outcome of the command is different.
Like Ross said in the comments : "UDP doesn't know or care if there is anything to receive the packets. If there's nothing there ffmpeg won't know and so won't complain".
FFserver is a different command to FFmpeg hence the different outputs.
Linux will behave differently according to distribution. Windows will also behave differently.
It would be easier for us to answer the question if you added a question mark to your question with a phrase summarising what you want to know.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
The community reviewed whether to reopen this question 12 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I have just installed ffmpeg and I am trying to encode all my uploaded videos to .mp4 file. Most of the users currently upload .mov and I want to convert every video to .mp4.
I am running the command as follows:
ffmpeg -i movie.mov -vcodec copy -acodec cop out.mp4
But all I am getting is the following errors
ffmpeg version 0.8.5, Copyright (c) 2000-2011 the FFmpeg developers
built on Aug 19 2012 11:38:20 with clang 3.1 (tags/Apple/clang-318.0.61)
configuration: --enable-nonfree --enable-gpl --enable-version3 --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libfaac --enable-libxvid --enable-libx264 --enable-libvpx --enable-hardcoded-tables --enable-shared --enable-pthreads --disable-indevs --cc=clang
libavutil 51. 9. 1 / 51. 9. 1
libavcodec 53. 7. 0 / 53. 7. 0
libavformat 53. 4. 0 / 53. 4. 0
libavdevice 53. 1. 1 / 53. 1. 1
libavfilter 2. 23. 0 / 2. 23. 0
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'movie.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2012-03-28 07:13:20
Duration: 00:00:26.23, start: 0.000000, bitrate: 12974 kb/s
Stream #0.0(eng): Video: mjpeg, yuvj420p, 1280x720 [PAR 72:72 DAR 16:9], 12972 kb/s, 11.67 fps, 600 tbr, 600 tbn, 600 tbc
Metadata:
creation_time : 2012-03-28 07:13:20
File 'out.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'out.mp4':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2012-03-28 07:13:20
encoder : Lavf53.4.0
Stream #0.0(eng): Video: mjpeg, yuvj420p, 1280x720 [PAR 72:72 DAR 16:9], q=2-31, 12972 kb/s, 600 tbn, 600 tbc
Metadata:
creation_time : 2012-03-28 07:13:20
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop, [?] for help
frame= 121 fps= 0 q=-1.0 size= 16408kB time=00:00:10.08 bitrate=13332.2kbitsframe= 306 fps= 0 q=-1.0 Lsize= 41543kB time=00:00:26.12 bitrate=13025.0kbits/s
video:41538kB audio:0kB global headers:0kB muxing overhead 0.012531%
The command to just stream it to a new container (mp4) needed by some applications like Adobe Premiere Pro without encoding (fast) is:
ffmpeg -i input.mov -qscale 0 output.mp4
Alternative as mentioned in the comments, which re-encodes with best quaility (-qscale 0):
ffmpeg -i input.mov -q:v 0 output.mp4