Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
How to create batch file for FFMpeg to download stream videos
7 juin 2017, par bashir sabooriHi I'm using this cmd code to download stream video using ffmpeg:
ffmpeg -i "http://wpc.866f.edgecastcdn.net/03866F/greyback/yourtrinity/130929-webword_,2500,1500,580,265,.mp4.m3u8" -c copy 130929-webword.mkv
now I want a batch file that in running time ask me the video address and the file name by pressing Enter.
-
Using ffmpeg to split audio file at a particular tone
7 juin 2017, par VictorI have a system that creates audio files of automated fire dispatches as wav files, and occasionally the file will record multiple calls separated by a multi-tone sequence. Here is a sample
I have been searching for a way to have ffmpeg, or some other Linux CLI tool, recognise the tones and then cut the file into a separate WAV file named
[unixtimestamp of original]+duration seconds.wav
Does anyone have any ideas?
-
Displaying RTSP-Stream using Xuggler : org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 34 60, bytestream (td)
7 juin 2017, par WenonahI'm new to displaying RTSP-Streams and Xuggler, so I really don't know what to do.
I'm trying to display the Main-Stream of my IP-Camera in a Java-Swing Window and get this:
I also get these errors:
13:21:45.941 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 8 7, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 34 60, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 8 36, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 68 62, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 118 38, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 60 62, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] cabac decode of qscale diff failed at 1 7
13:21:46.940 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 1 7, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 28 37, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 18 35, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 17 41, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 53 32, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 31 29, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 21 29, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] left block unavailable for requested intra mode at 0 35
13:21:49.902 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 0 35, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 17 21, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 46 10, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 109 28, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 60 10, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 11 14, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 101 9, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 76 9, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 86 11, bytestream (td)
17:47:04.192 [main] ERROR org.ffmpeg - [h264 @ 15AC7660] error while decoding MB 60 24, bytestream (td)This is part of the code that I use:
private IMediaListener mediaListener = new MediaListenerAdapter() { @Override public void onVideoPicture(IVideoPictureEvent event) { try { BufferedImage bi = event.getImage(); if (bi != null) updateWindow(bi); } catch (Exception ex) { LOG.error("Error getting Image from IVideoPictureEvent: " + ex); } } }; public DisplayWindow() { display(); } private void display() { IMediaReader mediaReader = ToolFactory .makeReader("rtsp://user:password@192.168.1.22:554/Streaming/Channels/1"); mediaReader .setBufferedImageTypeToGenerate(BufferedImage.TYPE_3BYTE_BGR); mediaReader.setQueryMetaData(false); mediaReader.addListener(mediaListener); openWindow(); while (true) { IError error = null; if(mediaReader != null){ error = mediaReader.readPacket(); if(error != null){ LOG.error("Error at mediaReader.readPacket(): " + error); } } } }
Displaying the Sub-Stream (which has lower resolution) works well.
I use Xuggler 5.4 with Maven.
There probably is a simple solution to this problem, but I've searched the whole internet and haven't found one, so I'd appreciate any help. Thank you!
UPDATE: I'd also be happy about (free!) alternatives to Xuggler.
-
Live video from raw tcp packets
7 juin 2017, par benuutswe are trying to make a small python app that display a live video from sniffed packets using
scapy
andffplay
. This is part of our master degree research project. The goal is to make a proof of concept app that spies on video transimitted over tcp.
We have a working script that writes into a.dat
file and then we read it usingffplay
. It works ok but have a lot of latency and we think we could do better : directly stream it intoffplay
without the need to write raw data in a file.Here's our script :
from scapy.all import * import os export_dat = open("data.dat", "a") def write_packet_raw(packet): export_dat.write(str(packet.getlayer(Raw))) def realtime_packet(): p = sniff(iface="wlan0", filter="tcp and (port 5555)", count=5000, prn=write_packet_raw) realtime_packet() export_dat.close()
And then we launch :
ffplay -window_title Videostream -framedrop -infbuf -f h264 -i data.dat
Any idea on how we can achieve that ? thanks.
-
working ffmpeg command fails when using in nginx with rtmp module
7 juin 2017, par Rafael Linux UserI have a tested code I did in a "bash" file. It works perfect on shell. I change only params to get it to work with nginx rtmp module, but ffmpeg says always and understandable error. This is the code:
exec_push ffmpeg -re -y -i rtmp://localhost:1935/live/$name \ -c:v libx264 -c:a aac \ -g 24 -keyint_min 24 -preset veryfast -tune zerolatency -movflags +faststart -vsync passthrough \ -filter_complex '[0:v]format=pix_fmts=yuv420p,split=3[in1][in2][in3];[in1]scale=320:-2[320x];[in2]scale=640:-2[HQ640x];[in3]scale=1280:-2[HD1280x];[0:a]aresample=44100[audio]' \ -map '[320x]' -profile:v baseline -level 3.0 -crf 31 -maxrate 170k -bufsize 170k -f mp4 rtmp://localhost:1935/rtmp_hls/$name_320x \ -map '[HQ640x]' -profile:v baseline -level 3.1 -crf 25 -maxrate 1000k -bufsize 1000k -f mp4 rtmp://localhost:1935/rtmp_hls/$name_HQ640x \ -map '[HD1280x]' -profile:v main -level 3.1 -crf 19 -maxrate 4000k -bufsize 4000k -f mp4 rtmp://localhost:1935/rtmp_hls/$name_HD1280x \ -map '[audio]' -b 128k -f mp4 rtmp://localhost:1935/rtmp_hls/$name_audio 2>>/var/www/html/ffmpeg-live-output-$name.log;
And this is the error launched by mmpeg
ffmpeg version 3.2.4-1~bpo8+1 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.9.2 (Debian 4.9.2-10) configuration: --prefix=/usr --extra-version='1~bpo8+1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --disable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared libavutil 55. 34.101 / 55. 34.101 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.101 / 57. 56.101 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libavresample 3. 1. 0 / 3. 1. 0 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 [flv @ 0x55e430547740] video stream discovered after head already parsed [flv @ 0x55e430547740] audio stream discovered after head already parsed Input #0, flv, from 'rtmp://localhost:1935/live/directo': Metadata: Server : NGINX RTMP (github.com/sergey-dryabzhinsky/nginx-rtmp-module) displayWidth : 1280 displayHeight : 720 fps : 24 profile : level : Duration: 00:00:00.00, start: 26.023000, bitrate: N/A Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 24.42 fps, 24 tbr, 1k tbn, 48 tbc Stream #0:1: Audio: aac (LC), 44100 Hz, mono, fltp [NULL @ 0x55e4305e0b40] Unable to find a suitable output format for ' ' : Invalid argument
Does anyone could help me?
Thank you