When i run this command i get an error. If i run without the pipe, it works.
With Pipe
cat mymovie.m4v | ffmpeg -i pipe:0 -an -analyzeduration 1000000 -f image2 -vf
"select='eq(pict_type,PICT_TYPE_I)'" -vsync vfr 'public/files/thumb%04d.png'
Without Pipe (Works)
ffmpeg -i mymovie.m4v -an -analyzeduration 2147483647 -probesize 2147483647 -f image2 -vf
"select='eq(pict_type,PICT_TYPE_I)'" -vsync vfr 'public/files/thumb%04d.png'
Output
ffmpeg version 2.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Apr 10 2014 17:50:46 with Apple LLVM version 5.1 (clang-503.0.38)
(based on LLVM 3.4svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2
--enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree
--enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang
--host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame
--enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libvo-aacenc --enable-libass --enable-ffplay --enable-libspeex
--enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r
--enable-libopenjpeg --extra-cflags='-
I/usr/local/Cellar/openjpeg/1.5.1_1/include/openjpeg-1.5 '
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libavresample 1. 2. 0 / 1. 2. 0
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
[mov,mp4,m4a,3gp,3g2,mj2 # 0x7fd87b80f000] stream 0, offset 0x2c: partial file
[mov,mp4,m4a,3gp,3g2,mj2 # 0x7fd87b80f000] Could not find codec parameters for stream 0
(Video: h264 (avc1 / 0x31637661), 1280x720, 3310 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
pipe:0: could not find codec parameters
I have tried setting (link)
-analyzeduration100 -probesize 10000000
-analyzeduration 2147483647 -probesize 2147483647
Still didn't work.
MP4 container is not the best choice for piping. The muxer that made the MP4 file may place certain info at the end of the file. This info is required for proper demuxing, but is not immediately available if using a pipe. However, you have a few options:
Don't use a pipe
I don't know why you need to use a pipe in the first place. Just use the file as a normal input:
ffmpeg -i input.mp4 ...
Don't use MP4
If you must use a pipe then consider using some other container such as .mkv or .ts for your input.
Re-mux your MP4 then pipe
If you must use MP4 then one method is to re-arrange the moov atom so it is at the beginning of the file:
ffmpeg -i input.mp4 -c copy -movflags +faststart output.mp4
Related
Querying video codecs does not list libx264 as an available codec
[terry#localhost ~]$ melt -query video_codecs | grep 264
- h264_nvenc
- h264_v4l2m2m
- h264_vaapi
- nvenc_h264
- h264
- h264_cuvid
But I can use it in a command such as:
melt avformat:DarkStar.webm -consumer avformat:output.mp4 acodec=aac vcodec=libx264
and it works successfully.
This is causing a problem with kdenlive. When selecting Render and choosing the format MP4 - the dominating format (H264/AAC) the render option is disabled with the error Unsupported video codec: libx264.
kdenlive checks the profile codec against the list obtained from MLT using:
Mlt::Properties vcodecs(mlt_properties(consumer->get_data("vcodec")));
which seems to get the same list as query video_codecs.
For info here is what ffmpeg says about the codecs:
[terry#localhost ~]$ ffmpeg -codecs | grep 264
ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3.0 (PCLinuxOS 9.3.0-1pclos2020)
configuration: --prefix=/usr --enable-shared --enable-pic --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include --extra-cflags=-I/usr/include/nvenc --disable-stripping --enable-postproc --enable-gpl --enable-pthreads --enable-libtheora --enable-libvorbis --disable-encoder=vorbis --enable-libvpx --enable-runtime-cpudetect --enable-libdc1394 --enable-librtmp --enable-libspeex --enable-libfreetype --enable-libgsm --enable-libcelt --enable-libopus --enable-libopencv --enable-libopenjpeg --enable-libtwolame --enable-libxavs --enable-frei0r --enable-libmodplug --enable-libass --enable-gnutls --enable-libcdio --enable-libpulse --enable-libv4l2 --enable-avresample --enable-opencl --enable-libmp3lame --enable-libaom --enable-sndio --enable-libdav1d --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-libx264 --enable-libx265 --enable-libvo-amrwbenc --enable-libxvid --enable-decoder=atrac3 --enable-decoder=atrac3p --enable-libwebp --enable-libfdk-aac --enable-nonfree --enable-cuda --enable-cuvid --enable-nvenc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_cuvid ) (encoders: libx264 libx264rgb h264_nvenc h264_v4l2m2m h264_vaapi nvenc nvenc_h264 )
Software versions:
mlt-6.20.0
ffmpeg-4.3
x264-1.157.20190309
libx264 is not a codec, its an encoder implementation of a codec. use ffmpeg -encoders | grep 264
There were changes in ffmpeg 4.3 which required MLT to be rebuilt against it.
I am trying to make a thumbnail image from mp4 video using FFmpeg but I am getting the error that
Output #0, image2, to 'output.jpg':
Output file #0 does not contain any stream
the command I used is
ffmpeg -i file_example_MP4_700KB.mp4 -ss 00:00:01 -vf thumbnail,scale=200:115 -qscale:v 2 -frames:v 1 -f image2 -c:v mjpeg output.jpg
and I am not sure what I am doing wrong and I stuck throw it for so long.
Any suggestions will be good
I am using Ubuntu 18.*
full logs:-
ffmpeg version n4.1.4 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --prefix= --prefix=/usr --disable-debug --disable-doc --disable-static --enable-avisynth --enable-cuda --enable-cuvid --enable- libdrm --enable-ffplay --enable-gnutls --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopus --enable-libpulse --enable-sdl2 --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-nonfree --enable-nvenc --enable-omx --enable-openal --enable-opencl --enable-runtime-cpudetect --enable-shared --enable-vaapi --enable-vdpau --enable-version3 --enable-xlib
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, mp3, from 'file_example_MP3_700KB.mp3':
Metadata:
genre : Cinematic
album : YouTube Audio Library
title : Impact Moderato
artist : Kevin MacLeod
Duration: 00:00:27.25, start: 0.034531, bitrate: 224 kb/s
Stream #0:0: Audio: mp3, 32000 Hz, stereo, fltp, 224 kb/s
Metadata:
encoder : LAME3.99r
Output #0, image2, to 'output.jpg':
Output file #0 does not contain any stream
I had the same problem with:
ffmpeg -i myfile.raw -f s16le -ac 1 -ar 48000 -acodec pcm_s16le output.mp3
The solution was to change the order to:
ffmpeg -f s16le -ac 1 -ar 48000 -acodec pcm_s16le -i input.raw output.mp3
I'm trying to make a stream using a webcam as data input with FFmpeg, but I need to stream a video in addition to the stream. Both features with the same command for a few minutes.
(If placed separately the recording code works perfectly)
FFmpeg code:
ffmpeg -f dshow -i video="Integrated Webcam" -t 300 -c:v libx264 -segment_atclocktime 1 -segment_format mp4 '/meu_video.mp4' | -s 640x360 -ac 2 -f flv -vcodec libx264 -profile:v baseline -maxrate 600000 -bufsize 600000 -r 25 -ar 44100 -c:a libfaac -b:a 128k "http://localhost:3030"
There are two errors, one when I try to join the two codes using | or \ and the other when I put only the stream code to test.
Log multiple outputs:
ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --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-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
Input #0, dshow, from 'video=Integrated Webcam':
Duration: N/A, start:
264374.193000, bitrate: N/A
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 30 fps, 30 tbr, 10000k tbn, 10000k tbc
http://localhost:3030/: Unknown error
Edit 3: I ran the command using -report and generated the report, but it's too big to paste into the question.
https://www.dropbox.com/s/2xsuzq5fx464o4w/ffmpeg-20171109-145406.log?dl=0
You don't need a separator.
ffmpeg -f dshow -rtbufsize 32M -i video="Integrated Webcam" -t 300 -c:v libx264 -segment_atclocktime 1
-segment_format mp4 '/meu_video_%d.mp4' -s 640x360 -f flv
-vcodec libx264 -profile:v baseline -maxrate 600000 -bufsize 600000 -r 25 "http://localhost:3030"
(I haven't removed the audio options although you don't have any audio inputs).
I need to get the rtp stream with the next codecs vp8,opus.
I get a stream from a camera (h264, aac), then I send to ffmpeg,then I send it to the ffserver and from there I want to receive a stream in the format rtp.
Video (VP8) without audio i successfully get, but stream video with audio ( any codecs ( aac, vorbis, opus ) ) not work.
ffmpeg command:
./ffmpeg -thread_queue_size 512 -rtsp_transport tcp -i rtsp://ip:port/stream -analyzeduration 0 -threads 2 http://localhost:4000/feed1.ffm
ffserver config:
HTTPPort 4000
RTSPPort 1235
RTSPBindAddress 0.0.0.0
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 1G
ACL allow 127.0.0.1
ACL allow localhost
</Feed>
<Stream test1.sdp>
Feed feed1.ffm
Format rtp
# Video settings
VideoCodec libvpx
VideoSize 720x576
VideoFrameRate 25
VideoBitRate 512
AVOptionVideo maxrate 2000
VideoQMin 4
VideoQMax 50
VideoBufferSize 4000
AVOptionVideo cpu-used 3
AVOptionVideo crf 33
AVOptionVideo quality realtime
AVOptionVideo flags +global_header
#PreRoll 0
#StartSendOnKey
# Audio settings
#AudioCodec aac
#AudioCodec libopus
#Strict -2
AudioBitRate 128
AudioChannels 2
AudioSampleRate 48k
AVOptionAudio flags +global_header
ACL allow localhost
</Stream>
And without video (only audio) - not worked
HTTPPort 4000
RTSPPort 1235
RTSPBindAddress 0.0.0.0
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 1G
ACL allow 127.0.0.1
ACL allow localhost
</Feed>
<Stream test1.sdp>
Feed feed1.ffm
Format rtp
# Video settings
NoVideo
# Audio settings
#AudioCodec aac
#AudioCodec libopus
#Strict -2
AudioBitRate 128
AudioChannels 2
AudioSampleRate 48k
AVOptionAudio flags +global_header
ACL allow localhost
</Stream>
I try to connect to my stream via vlc, but i see error in vlc ( if audio libopus) core error: could not identify codec, if audio codec (e.g. aac ) - live555 error: no data received in 10s, aborting .
ffserver info build:
ffserver version N-86676-g45dbb40cd1-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.1 (Debian 5.4.1-11) 20170519
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
libavutil 55. 67.100 / 55. 67.100
libavcodec 57.100.102 / 57.100.102
libavformat 57. 75.100 / 57. 75.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 94.100 / 6. 94.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
ffmpeg info build:
ffmpeg version N-86676-g45dbb40cd1-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.1 (Debian 5.4.1-11) 20170519
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
libavutil 55. 67.100 / 55. 67.100
libavcodec 57.100.102 / 57.100.102
libavformat 57. 75.100 / 57. 75.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 94.100 / 6. 94.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
What a problem ? Any idea?
.
I am trying to mark a timestamp in a video using drawtext filter.
FFmpeg easily marks timestamps based on localtime, gmtime or even PTS. However, I want to assign a reference time (start time) for the timestamp in order to represent the time the video was recorded (not encoded).
Reading the documentation, I found that option basetime can be used for this purpose. However it seems that is not working or I am missing something.
The command line I am using is:
ffmpeg -y -i input.mp4 -filter_complex drawtext="fontfile=/tmp/UbuntuMono-B.ttf: fontsize=36: fontcolor=yellow: box=1: boxcolor=black#0.4: text='Wall Clock Time\: %{gmtime\:%Y-%m-%d %T}': basetime=1456007118" output.mp4
By using basetime=1456007118, it was expected the start time was set to '02/20/2016 20:25:18' since 1456007118 is the UTC time for that time and date:
date -d '02/20/2016 20:25:18' +"%s" # format MM/DD/AAAA hh:mm:ss
1456007118
However, no error is issued by FFmpeg and the video is marked with current GMT, ignoring basetime option.
Any hint?
Thanks.
Complete information about FFmpeg version and output is:
ffmpeg -y -i /home/denio/Videos/Interstellar_2014_Trailer_4_5.1-1080p-HDTN.mp4 -filter_complex drawtext="fontfile=/tmp/UbuntuMono-B.ttf: fontsize=36: fontcolor=yellow: box=1: boxcolor=black#0.4: text='Wall Clock Time\: %{gmtime\:%Y-%m-%d %T}': basetime=1470226363" /tmp/x.mp4
ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.1 (Ubuntu 5.3.1-14ubuntu2.1) 20160413
configuration: --enable-libxavs --enable-bzlib --enable-libfaac --enable-libfreetype --enable-libfontconfig --enable-libmp3lame --enable-libschroedinger --enable-libspeex --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-zlib --enable-x11grab --enable-static --enable-pthreads --enable-gpl --enable-nonfree --enable-version3 --disable-ffserver --enable-libgsm --enable-librtmp --enable-libvpx --enable-libschroedinger --enable-libopencore-amrnb --enable-libopenjpeg
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 48.101 / 57. 48.101
libavformat 57. 41.100 / 57. 41.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 47.100 / 6. 47.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
...
...
I see the basetime in the source code, but not in the web documentation, so not sure how it's supposed to work.
You can instead use the pts function.
ffmpeg -y -i input.mp4 -vf "drawtext=fontfile=/tmp/UbuntuMono-B.ttf:
fontsize=36:fontcolor=yellow:
box=1:boxcolor=black#0.4:
text='Wall Clock Time\: %{pts\:gmtime\:1456007118}'"
output.mp4
You may need to reset PTS (setpts=PTS-STARTPTS) before the drawtext.