Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • FFmpeg. Loosing timecode while transcoding

    23 février 2017, par 7sides

    I've got an mp4 (h264) file from RTSP webcam with dynamic FPS (~10).

    I can see that mp4 STTS atom contains right frames durations/deltas when a frame is skipped (due to networking problems for instance).

    So at playing I always have the right total duration for about 30 minutes.

    But when I transcode this file to mpegts format and back to mp4 the total duration becomes approx. 29:10 (seems due to missed frames and normalising of PTS).

    Here are the commands:

    Convert from mp4 to mpegts:

    ffmpeg -copyts -i /script_cache/_1487864096/10.8.0.118_rtsp.camera.1.hall_1487831449.mp4 -c copy -y -bsf:v h264_mp4toannexb -copyts -f mpegts /script_cache/_1487864096/10.8.0.118_rtsp.camera.1.hall_1487831449.ts
    

    Convert from mpegts to mp4:

    ffmpeg -copyts -i /script_cache/_1487864096/10.8.0.118_rtsp.camera.1.hall_1487831449.ts -c copy -f mp4 result.mp4
    

    So, how can I preserve the source duration/deltas while converting mp4->mpegts->mp4?

  • ffmpeg encode video en VBR

    23 février 2017, par Aminesrine

    I want to transcode a video en VBR (Variable Bit Rate) with Ffmpeg. I added to my commande Ffmpeg thes options: -q:v n1 and -q:a n2 I want to have 4 files video for the differents bitrate (1500,850,450 et 250) In the encoding en CBR I use :

    - `-b:v 1308k` and `-q:a 192k` for the bitrate 1500
    - `-b:v 754k` and `-q:a 96k` for the bitrate 850
    - `-b:v 402k` and `-q:a 48k` for the bitrate 450
    - `-b:v 228k` and `-q:a 22k` for the bitrate 250
    

    What values can I use with options -q:v n1 and -q:a n2 to have the 4 bitrates.

  • identify frame number of a specific frame from a video file

    23 février 2017, par James Crampton

    I have a video file where I've extracted a specific frame to analyse. However I want to know what the frame number of the frame is.. I can't seem to find anything. I've had a look at ffmpeg showinfo but that doesn't seem to work. I've also looked into exifread, which produced information about the frame except for the frame number. Any ideas?

  • ffmpeg convert RTMP stream to HLS ? RED5

    23 février 2017, par Lewis Day

    Before posting this question; I followed this post; https://ffmpeg.org/pipermail/ffmpeg-user/2013-November/018558.html I also tried to find solutions to the problem I'm having.

    ffmpeg -v verbose -i "rtmp://domain.com:5080/stream1" -c:v libx264 -c:a aac -ac 1 -strict -2 -crf 18 -profile:v baseline -maxrate 400k -bufsize 1835k -pix_fmt yuv420p -flags -global_header -hls_time 10 -hls_list_size 6 -hls_wrap 10 -start_number 1 '/home/domain/public_html/hts-streams/stream1.m3u8'
    

    Okay above is the Ffmpeg command I'm trying to execute to convert my RTMP stream into a .m3u8.

    However the command is failing and I'm being returned this;

    I have changed my domain to domain.com

      configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-libass --enable-libcdio --enable-libcelt --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
      libavutil      51. 35.100 / 51. 35.100
      libavcodec     53. 61.100 / 53. 61.100
      libavformat    53. 32.100 / 53. 32.100
      libavdevice    53.  4.100 / 53.  4.100
      libavfilter     2. 61.100 /  2. 61.100
      libswscale      2.  1.100 /  2.  1.100
      libswresample   0.  6.100 /  0.  6.100
      libpostproc    52.  0.100 / 52.  0.100
    Parsing...
    Parsed protocol: 0
    Parsed host    : domain.com
    Parsed app     : stream1
    RTMP_Connect1, ... connected, handshaking
    HandShake: Type Answer   : 48
    HandShake: Type mismatch: client sent 3, server answered 72
    RTMP_Connect1, handshake failed.
    rtmp://domain.com:5080/stream1: Operation not permitted
    

    The command then fails to convert the stream due to a failed handshake. What is causing this?

  • Add text on video in ffmpeg on portrait video

    23 février 2017, par Dhanveer thakur

    I am adding text on a portrait video in ffmpeg using following command:-

    -i /sdcard/Hyype/195_Video.mp4 -vf drawtext=fontsize=80:fontfile=/system/fonts/DroidSans.ttf:fontcolor=green:text=Post:x=286.0:y=573.0-ascent -strict -2 /sdcard/Hyype/495_Edited_Video.mp
    

    This Command add text on video in landscape mode as shown in current output pic

    Following are screen shots :- 1. Current output:-

    enter image description here

    1. Expected Output :-

    enter image description here

    Can someone help me that how can i add text on video in portrait form and achieve the expected output in second pic?