Recherche avancée

Médias (0)

Mot : - Tags -/protocoles

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (52)

Sur d’autres sites (4834)

  • ffmpeg to create separate audio files based upon who is talking [on hold]

    11 juin 2017, par Samantha Harless Scholl

    We are capturing skype or Google Hangout video calls via a screen recorder. How can we then take that video file and separate out the audio files for each speaker separately. There would only be two individuals talking and we need each separated out from the video file in two different files. We currently utilize ffmpeg but can’t figure out how to create separate files for each person talking.

  • ffmpeg to create a slideshow results in very large file

    31 mars 2022, par GroovyDotCom

    I have a series of JPEG images named 0000.jpg 0001.jpg 0002.jpg...

    



    I used the following command to turn these into a slideshow video, each frame playing for 1 second.

    



    ffmpeg -framerate 1 -i %04d.jpg -c:v libx264 -vf fps=1 -pix_fmt yuv420p out.mp4


    



    This works fine except that the resulting video is 6x larger than what I get if I encode the exact same frames at normal framerate (e.g. 25 FPS)

    



    I'm looking for a way to effectively get the same efficient encoding as when encoding 25fps but with each frame showing for 1 second.

    


  • Using ffmpeg and ffserver to create a 2x1 live stream fails with unconnected output error

    31 janvier 2021, par weevilknievel

    I want to combine 2 RTSP streams (CCTV cameras) into a horizontal 2x1 strip and convert to webm for use in a HTML5 webpage.

    



    I am able to convert the streams into an mpeg or avi file easily, but as soon as I try to post it to ffserver ffm feed, I hit a wall.

    



    Here is my working ffmpeg command which writes out to a file :

    



    ffmpeg -rtsp_transport tcp -thread_queue_size 12 -i "rtsp://192.168.1.132:554/user=admin&password=mypassword&channel=1&stream=1.sdp" -i "rtsp://192.168.1.132:554/user=admin&password=mypassword&channel=2&stream=1.sdp" -filter_complex "[0:v][1:v] hstack=inputs=2 [v]" -map "[v]" -r 30 output.mpg


    



    It seems the ffmpeg process is outputting two streams and one of them is MPEG ? In the above command I had to put a frame rate "-r 30" into the command otherwise I got an error which said that MPEG 1/2 did not support a framerate of 5/1 ??

    



    As soon as I try and stream to ffserver, I get an error :

    



    ffmpeg -rtsp_transport tcp -thread_queue_size 12 -i "rtsp://192.168.1.132:554/user=admin&password=mypassword&channel=1&stream=1.sdp" -i "rtsp://192.168.1.132:554/user=admin&password=mypassword&channel=2&stream=1.sdp" -filter_complex "[0:v][1:v] hstack=inputs=2 [v]" -map "[v]" -r 30 http://localhost:8090/feed5.ffm


    



    The error I get is "Filter hstack has an unconnected output" :

    



    ffmpeg version N-86111-ga441aa90e8-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.4.1 (Debian 5.4.1-8) 20170304
  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. 63.100 / 55. 63.100
  libavcodec     57. 96.101 / 57. 96.101
  libavformat    57. 72.101 / 57. 72.101
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 89.101 /  6. 89.101
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, rtsp, from 'rtsp://192.168.1.132:554/user=admin&password=mypassword&channel=1&stream=1.sdp':
  Duration: N/A, start: 0.166667, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 352x288, 6 fps, 6 tbr, 90k tbn, 180k tbc
Input #1, rtsp, from 'rtsp://192.168.1.132:554/user=admin&password=mypassword&channel=2&stream=1.sdp':
  Duration: N/A, start: 0.166667, bitrate: N/A
    Stream #1:0: Video: h264 (High), yuv420p(progressive), 352x288, 6 fps, 6 tbr, 90k tbn, 180k tbc
Filter hstack has an unconnected output


    



    My ffserver conf is very basic :

    



    HTTPPort 8090&#xA;HTTPBindAddress 0.0.0.0&#xA;MaxHTTPConnections 2000&#xA;MaxClients 1000&#xA;MaxBandwidth 100000&#xA;CustomLog -&#xA;&#xA;<feed>&#xA;File /mnt/ramdisk/feed5.ffm&#xA;Truncate&#xA;FileMaxSize 5M&#xA;ACL allow 127.0.0.1&#xA;</feed>&#xA;&#xA;<stream>&#xA;     Format webm&#xA;     Feed feed5.ffm&#xA;     VideoCodec libvpx&#xA;     VideoSize 640x360&#xA;     NoAudio&#xA;   AVOptionVideo quality realtime&#xA;   StartSendOnKey&#xA;   VideoBitRate 140&#xA;</stream>&#xA;&#xA;<stream>&#xA;Format status&#xA;ACL allow localhost&#xA;ACL allow 192.168.0.0 192.168.255.255&#xA;</stream>&#xA;<redirect>&#xA;URL http://www.ffmpeg.org/&#xA;</redirect>&#xA;

    &#xA;&#xA;

    Edit :

    &#xA;&#xA;

    Here is the debug output from the ffmpeg command above :

    &#xA;&#xA;

    ffmpeg -v debug -rtsp_transport tcp -thread_queue_size 12 -i "rtsp://192.168.1.132:554/user=admin&amp;password=mypassword&amp;channel=1&amp;stream=1.sdp" -i "rtsp://192.168.1.132:554/user=admin&amp;password=mypassword&amp;channel=2&amp;stream=1.sdp" -filter_complex "[0:v][1:v] hstack=inputs=2 [v]" -map "[v]" -r 30 http://localhost:8090/feed5.ffm&#xA;ffmpeg version N-86111-ga441aa90e8-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers&#xA;  built with gcc 5.4.1 (Debian 5.4.1-8) 20170304&#xA;  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&#xA;  libavutil      55. 63.100 / 55. 63.100&#xA;  libavcodec     57. 96.101 / 57. 96.101&#xA;  libavformat    57. 72.101 / 57. 72.101&#xA;  libavdevice    57.  7.100 / 57.  7.100&#xA;  libavfilter     6. 89.101 /  6. 89.101&#xA;  libswscale      4.  7.101 /  4.  7.101&#xA;  libswresample   2.  8.100 /  2.  8.100&#xA;  libpostproc    54.  6.100 / 54.  6.100&#xA;Splitting the commandline.&#xA;Reading option &#x27;-v&#x27; ... matched as option &#x27;v&#x27; (set logging level) with argument &#x27;debug&#x27;.&#xA;Reading option &#x27;-rtsp_transport&#x27; ... matched as AVOption &#x27;rtsp_transport&#x27; with argument &#x27;tcp&#x27;.&#xA;Reading option &#x27;-thread_queue_size&#x27; ... matched as option &#x27;thread_queue_size&#x27; (set the maximum number of queued packets from the demuxer) with argument &#x27;12&#x27;.&#xA;Reading option &#x27;-i&#x27; ... matched as input url with argument &#x27;rtsp://192.168.1.132:554/user=admin&amp;password=mypassword&amp;channel=1&amp;stream=1.sdp&#x27;.&#xA;Reading option &#x27;-i&#x27; ... matched as input url with argument &#x27;rtsp://192.168.1.132:554/user=admin&amp;password=mypassword&amp;channel=2&amp;stream=1.sdp&#x27;.&#xA;Reading option &#x27;-filter_complex&#x27; ... matched as option &#x27;filter_complex&#x27; (create a complex filtergraph) with argument &#x27;[0:v][1:v] hstack=inputs=2 [v]&#x27;.&#xA;Reading option &#x27;-map&#x27; ... matched as option &#x27;map&#x27; (set input stream mapping) with argument &#x27;[v]&#x27;.&#xA;Reading option &#x27;-r&#x27; ... matched as option &#x27;r&#x27; (set frame rate (Hz value, fraction or abbreviation)) with argument &#x27;30&#x27;.&#xA;Reading option &#x27;http://localhost:8090/feed5.ffm&#x27; ... matched as output url.&#xA;Finished splitting the commandline.&#xA;Parsing a group of options: global .&#xA;Applying option v (set logging level) with argument debug.&#xA;Applying option filter_complex (create a complex filtergraph) with argument [0:v][1:v] hstack=inputs=2 [v].&#xA;Successfully parsed a group of options.&#xA;Parsing a group of options: input url rtsp://192.168.1.132:554/user=admin&amp;password=mypassword&amp;channel=1&amp;stream=1.sdp.&#xA;Applying option thread_queue_size (set the maximum number of queued packets from the demuxer) with argument 12.&#xA;Successfully parsed a group of options.&#xA;Opening an input file: rtsp://192.168.1.132:554/user=admin&amp;password=mypassword&amp;channel=1&amp;stream=1.sdp.&#xA;[tcp @ 0x58fb5e0] No default whitelist set&#xA;[rtsp @ 0x58f9700] SDP:&#xA;v=0&#xA;o=- 38990265062388 38990265062388 IN IP4 192.168.1.132&#xA;a=range:npt=0-&#xA;m=video 0 RTP/AVP 96&#xA;c=IN IP4 0.0.0.0&#xA;a=rtpmap:96 H264/90000&#xA;a=framerate:0S&#xA;a=fmtp:96 profile-level-id=640014; packetization-mode=1; sprop-parameter-sets=Z2QAFK2EAQwgCGEAQwgCGEAQwgCEK1CwSyA=,aO48sA==&#xA;a=control:trackID=3&#xA;&#xA;Failed to parse interval end specification &#x27;&#x27;&#xA;[rtsp @ 0x58f9700] video codec set to: h264&#xA;[rtsp @ 0x58f9700] RTP Profile IDC: 64 Profile IOP: 0 Level: 14&#xA;[rtsp @ 0x58f9700] RTP Packetization Mode: 1&#xA;[rtsp @ 0x58f9700] Extradata set to 0x58fb940 (size: 38)&#xA;[rtsp @ 0x58f9700] setting jitter buffer size to 0&#xA;[rtsp @ 0x58f9700] hello state=0&#xA;[h264 @ 0x58fca00] nal_unit_type: 7, nal_ref_idc: 3&#xA;[h264 @ 0x58fca00] nal_unit_type: 8, nal_ref_idc: 3&#xA;[h264 @ 0x58fca00] nal_unit_type: 7, nal_ref_idc: 3&#xA;[h264 @ 0x58fca00] nal_unit_type: 8, nal_ref_idc: 3&#xA;[h264 @ 0x58fca00] unknown SEI type 229&#xA;[h264 @ 0x58fca00] nal_unit_type: 7, nal_ref_idc: 3&#xA;[h264 @ 0x58fca00] nal_unit_type: 8, nal_ref_idc: 3&#xA;[h264 @ 0x58fca00] nal_unit_type: 6, nal_ref_idc: 0&#xA;[h264 @ 0x58fca00] nal_unit_type: 5, nal_ref_idc: 3&#xA;[h264 @ 0x58fca00] unknown SEI type 229&#xA;[h264 @ 0x58fca00] Reinit context to 352x288, pix_fmt: yuv420p&#xA;[h264 @ 0x58fca00] nal_unit_type: 1, nal_ref_idc: 3&#xA;    Last message repeated 5 times&#xA;[h264 @ 0x58fca00] unknown SEI type 229&#xA;    Last message repeated 1 times&#xA;[rtsp @ 0x58f9700] All info found&#xA;[rtsp @ 0x58f9700] Setting avg frame rate based on r frame rate&#xA;Input #0, rtsp, from &#x27;rtsp://192.168.1.132:554/user=admin&amp;password=mypassword&amp;channel=1&amp;stream=1.sdp&#x27;:&#xA;  Duration: N/A, start: 0.166667, bitrate: N/A&#xA;    Stream #0:0, 28, 1/90000: Video: h264 (High), 1 reference frame, yuv420p(progressive, left), 352x288, 0/1, 6 fps, 6 tbr, 90k tbn, 180k tbc&#xA;Successfully opened the file.&#xA;Parsing a group of options: input url rtsp://192.168.1.132:554/user=admin&amp;password=mypassword&amp;channel=2&amp;stream=1.sdp.&#xA;Successfully parsed a group of options.&#xA;Opening an input file: rtsp://192.168.1.132:554/user=admin&amp;password=mypassword&amp;channel=2&amp;stream=1.sdp.&#xA;[tcp @ 0x59f4280] No default whitelist set&#xA;[rtsp @ 0x59f7620] SDP:&#xA;v=0&#xA;o=- 38990265062388 38990265062388 IN IP4 192.168.1.132&#xA;a=range:npt=0-&#xA;m=video 0 RTP/AVP 96&#xA;c=IN IP4 0.0.0.0&#xA;a=rtpmap:96 H264/90000&#xA;a=framerate:0S&#xA;a=fmtp:96 profile-level-id=640014; packetization-mode=1; sprop-parameter-sets=Z2QAFK2EAQwgCGEAQwgCGEAQwgCEK1CwSyA=,aO48sA==&#xA;a=control:trackID=3&#xA;&#xA;Failed to parse interval end specification &#x27;&#x27;&#xA;[rtsp @ 0x59f7620] video codec set to: h264&#xA;[rtsp @ 0x59f7620] RTP Profile IDC: 64 Profile IOP: 0 Level: 14&#xA;[rtsp @ 0x59f7620] RTP Packetization Mode: 1&#xA;[rtsp @ 0x59f7620] Extradata set to 0x59f3670 (size: 38)&#xA;[rtp @ 0x59f62a0] No default whitelist set&#xA;[udp @ 0x58fb6a0] No default whitelist set&#xA;[udp @ 0x58fb6a0] end receive buffer size reported is 131072&#xA;[udp @ 0x591b940] No default whitelist set&#xA;[udp @ 0x591b940] end receive buffer size reported is 131072&#xA;[rtsp @ 0x59f7620] setting jitter buffer size to 500&#xA;[rtsp @ 0x59f7620] hello state=0&#xA;[h264 @ 0x59e4b20] nal_unit_type: 7, nal_ref_idc: 3&#xA;[h264 @ 0x59e4b20] nal_unit_type: 8, nal_ref_idc: 3&#xA;[h264 @ 0x59e4b20] nal_unit_type: 7, nal_ref_idc: 3&#xA;[h264 @ 0x59e4b20] nal_unit_type: 8, nal_ref_idc: 3&#xA;[h264 @ 0x59e4b20] unknown SEI type 229&#xA;[h264 @ 0x59e4b20] nal_unit_type: 7, nal_ref_idc: 3&#xA;[h264 @ 0x59e4b20] nal_unit_type: 8, nal_ref_idc: 3&#xA;[h264 @ 0x59e4b20] nal_unit_type: 6, nal_ref_idc: 0&#xA;[h264 @ 0x59e4b20] nal_unit_type: 5, nal_ref_idc: 3&#xA;[h264 @ 0x59e4b20] unknown SEI type 229&#xA;[h264 @ 0x59e4b20] Reinit context to 352x288, pix_fmt: yuv420p&#xA;[h264 @ 0x59e4b20] nal_unit_type: 1, nal_ref_idc: 3&#xA;    Last message repeated 5 times&#xA;[h264 @ 0x59e4b20] unknown SEI type 229&#xA;    Last message repeated 1 times&#xA;[rtsp @ 0x59f7620] All info found&#xA;[rtsp @ 0x59f7620] Setting avg frame rate based on r frame rate&#xA;Input #1, rtsp, from &#x27;rtsp://192.168.1.132:554/user=admin&amp;password=mypassword&amp;channel=2&amp;stream=1.sdp&#x27;:&#xA;  Duration: N/A, start: 0.166667, bitrate: N/A&#xA;    Stream #1:0, 28, 1/90000: Video: h264 (High), 1 reference frame, yuv420p(progressive, left), 352x288, 0/1, 6 fps, 6 tbr, 90k tbn, 180k tbc&#xA;Successfully opened the file.&#xA;detected 2 logical cores&#xA;[Parsed_hstack_0 @ 0x59f7cc0] Setting &#x27;inputs&#x27; to value &#x27;2&#x27;&#xA;Parsing a group of options: output url http://localhost:8090/feed5.ffm.&#xA;Applying option map (set input stream mapping) with argument [v].&#xA;Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 30.&#xA;Successfully parsed a group of options.&#xA;Opening an output file: http://localhost:8090/feed5.ffm.&#xA;[http @ 0x59aa700] Setting default whitelist &#x27;http,https,tls,rtp,tcp,udp,crypto,httpproxy&#x27;&#xA;[http @ 0x59aa700] request: GET /feed5.ffm HTTP/1.1&#xA;User-Agent: Lavf/57.72.101&#xA;Accept: */*&#xA;Range: bytes=0-&#xA;Connection: close&#xA;Host: localhost:8090&#xA;Icy-MetaData: 1&#xA;&#xA;&#xA;[ffm @ 0x5917d00] Format ffm probed with size=2048 and score=101&#xA;[NULL @ 0x5bce3e0] Setting entry with key &#x27;video_size&#x27; to value &#x27;640x360&#x27;&#xA;[NULL @ 0x5bce3e0] Setting entry with key &#x27;b&#x27; to value &#x27;140000&#x27;&#xA;[NULL @ 0x5bce3e0] Setting entry with key &#x27;time_base&#x27; to value &#x27;1/5&#x27;&#xA;[NULL @ 0x5bce3e0] Setting entry with key &#x27;bt&#x27; to value &#x27;35000&#x27;&#xA;[NULL @ 0x5bce3e0] Setting entry with key &#x27;rc_eq&#x27; to value &#x27;tex^qComp&#x27;&#xA;[NULL @ 0x5bce3e0] Setting entry with key &#x27;maxrate&#x27; to value &#x27;280000&#x27;&#xA;[NULL @ 0x5bce3e0] Setting entry with key &#x27;bufsize&#x27; to value &#x27;280000&#x27;&#xA;[AVIOContext @ 0x5915b80] Statistics: 4096 bytes read, 0 seeks&#xA;[http @ 0x5915f00] Setting default whitelist &#x27;http,https,tls,rtp,tcp,udp,crypto,httpproxy&#x27;&#xA;[http @ 0x5915f00] request: POST /feed5.ffm HTTP/1.1&#xA;Transfer-Encoding: chunked&#xA;User-Agent: Lavf/57.72.101&#xA;Accept: */*&#xA;Connection: close&#xA;Host: localhost:8090&#xA;Icy-MetaData: 1&#xA;&#xA;&#xA;Successfully opened the file.&#xA;Filter hstack has an unconnected output&#xA;[AVIOContext @ 0x59ab080] Statistics: 0 seeks, 0 writeouts&#xA;

    &#xA;&#xA;

    I am stumped - any clues ?

    &#xA;&#xA;

    Thanks in advance.

    &#xA;