1

I'm trying add timestamp to output file from FFMPEG but I'm getting this error.

Filtergraph 'drawtext=fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf:text='\%T': [email protected]: x=7: y=460' was defined for video output stream 0:0 but codec copy was selected.
Filtering and streamcopy cannot be used together

And my command is:

 ffmpeg -i rtsp://admin:[email protected]:554/11 -vf "drawtext=fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf:text='\%T': [email protected]: x=7: y=460" -acodec copy -vcodec copy test.avi

And the output:

ffmpeg version N-75939-g6eaf97c Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.9.2 (Raspbian 4.9.2-10) configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree --enable-libfreetype
libavutil 55. 3.100 / 55. 3.100
libavcodec 57. 5.100 / 57. 5.100
libavformat 57. 3.100 / 57. 3.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 11.100 / 6. 11.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.100 / 2. 0.100
libpostproc 54. 0.100 / 54. 0.100 Input #0, rtsp, from 'rtsp://user:@192.168.1.52:554/11':
Metadata:
title : 10 Duration: N/A, start: 0.159000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuv420p, 1280x720, 25.08 tbr, 90k tbn, 180k tbc
Stream #0:1: Audio: adpcm_g726, 8000 Hz, mono, s16, 16 kb/s Filtergraph 'drawtext=fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf:text='\%T': [email protected]: x=7: y=460' was defined for video output stream 0:0 but codec copy was selected. Filtering and streamcopy cannot be used together.

Where I'm doing a mistake ?

Thank you for all reply :)

4
  • 1
    -vcodec copy == streamcopy. You need to re-encode to add a text overlay so choose one encoder like libx264 etc. Commented Oct 14, 2015 at 18:11
  • Thank you. I changed it to -vcodec libx264 it said Illegal instructions. Commented Oct 14, 2015 at 18:44
  • Bad example, it might not be available in your ffmpeg build, try another (ffmpeg -codecs) Commented Oct 14, 2015 at 19:14
  • Please re-read the guidance for the tags you've used. This is clearly a question about using FFmpeg, not about programming, so is off-topic for Stack Overflow. It might be suitable for Super User or Unix & Linux: consult the Help Centre for the site before you post. Commented Aug 7, 2023 at 8:15

1 Answer 1

3

I came across this command posted for ffmpeg (thanks to github user reidransom):

ffmpeg -i video.mov -vcodec libx264 -cmp 22 -vf "drawtext=fontfile=DroidSansMono.ttf: timecode='09\:57\:00\:00': r=29.976: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000099" -y output.mov

Keep in mind it's one complete line. The \ characters in the timecode option are there to enable the :'s as chars. r sets the frames per second capture rate.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.