w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
fluent-ffmpeg generating incorrect framerate
Had the same problem and found out that you need to specify Input FPS to match your image sequence source. .withFpsInput(30) // fps matching your jpg or png input sequence This worked great for me. Hope it helps!

Categories : Node Js

Crossdevice encoding static file to stream in browser using FFMPEG (segmented h264 ?)
As far as I know you won't find a setting which works on every device. I'd recommend you to check the user agent and then use different settings for different devices. This way you could also use device optimized settings.

Categories : Node Js

Android encode video with ffmpeg while it is still recording
Your real time requirement may lead you away from ffmpeg to webrtc and or to html5. some resources; http://dev.w3.org/2011/webrtc/editor/getusermedia.html (section5) https://github.com/lukeweber/webrtc-jingle-client ondello .. they have api rather than going native and trying to get at the video stream or getting at the framebuffer to acquire an xcopy of what is in the video buffer, and to then duplicate the stream an manage a connection (socket or chunked http), you may want to look at api type alternatives....

Categories : Android

Encode Android AudioRecord raw pcm data to other format using ffmpeg
You can create a .wav file with your data in bytes and later convert this audio file with your image directly in a video. 1 image + 1 audio file = 1 video

Categories : Android

Encode x264 video with ffmpeg for Android with starting offset
Upgrading to ffmpeg 1.2.1 fixed the compatibility issue. After that, my Android phone was able to play the videos just fine. The -ss option is trickier than it at first looks. It has a different meaning based on whether it is before or after -i. It turns out, to make it work, you have to use both. You put the main offset before -i, which makes ffmpeg skip to that point in the stream. But, then you also need a small non-zero offset AFTER -i to make it seek to that point within the stream so audio and video will be in sync. For reference, the final working command is: ffmpeg -ss 00:03:52.00 -i in.mp4 -ss 0.1 -t 01:28:33.00 -c:v libx264 -preset medium -crf 20 -maxrate 400k -bufsize 1835k -c:a libvorbis -sn out.mkv

Categories : Android

How to Encode an to base64 in AngularJs?
You don't need AngularJs for that. There is a thread here explaining how to do it using Javascript and canvas: How to convert image into base64 string using javascript

Categories : Javascript

Error in ffmpeg when reading from UDP stream
Incoming frames needs to be handled in a callback function. So the mechanism should be such that a callback gets called whenever there is a new frame. In this way there is no need to manually fine tune the delay. Disclaimer: I have not used ffmpeg APIs.

Categories : C++

C api on capturing video stream from webcam using ffmpeg
You are basically repeating the question you are referring to. FFmpeg is basically the name of the library and the ready to use tool (command line interface). Its back end is a set of libraries: libavcodec, libavformat, swscale etc. There is no comprehensive documentation on these libraries, instead there are samples, there is mailing list and other sparse resources. Also, the libraries are open source and all these are quite usable once you get the pieces together. Specific questions on ffmpeg are asked/answered on StackOverflow as well.

Categories : C

encode stream from webCam h264
As WebRTC is built in the browser, and it's the browser internals that creates the tunnel and encodes the stream in VP8, you don't have access to the raw stream to encode it using other Codec neither to the raw connection to send the packets after your custom encoding. To allow WebRTC to use H264, the browsers need to have support for it (native or plugin-based), and actually Chrome and Firefox don't support it. H264 vs VP8 in WebRTC is a subject with a lot of discussion, because of the availability of hardware encoders for H264 and not for VP8, but on the other hand the existence of royalties that need to be paid to use H264. If you want to control the codec and the stream, namely on smartphones and tablets, you can build apps using the WebRTC native API's.

Categories : Javascript

How to copy audio stream using FFMpeg API ( not a command line tool )
Your question is vague without some kind of code to go along with it, as trust me there are a lot of things that can go wrong when using ffmpeg's libraries directly (and on Windows there is no debuging). Unfortunately ffmpeg's libraries are not well documented so it is generally best to read the source code for ffmpeg in order to use its libraries. Find the equivalent command line options to perform what you want and track that through ffmpeg's source to see the library calls.

Categories : Opencv

recording live video stream from tv card using ffmpeg in windows
First be sure that the video label you use is really the label return by: ffmpeg -list_devices true -f dshow -i dummy More info here But another solution should be ti use the old "Video For Windows" (VFW). To try that, list your device with: ffmpeg -y -f vfwcap -i list And use your device number as value of the -ioption: ffmpeg -y -f vfwcap -r 25 -i 0 out.mp4 And if finally you are able to record your stream, there is different options, but in your case everything is clear describe here ffmpeg -y -f vfwcap -r 25 -i 0 -f image2 -vf fps=fps=1 out%d.jpg

Categories : Windows

Segfault after 15 seconds while reading a RTSP stream with ffmpeg in Android
I was using the wrong args to sws_scale. Should have been: swscale.sws_scale( img_convert_ctx, new PointerPointer(frame), frame.linesize(), 0, avCodecContext.height(), new PointerPointer(picrgb), picrgb.linesize());

Categories : Android

Include file as input stream in scala
The problem you are seeing has to do with the fact that the InputStream you are loading is coming back as null. This happens when the file you are trying to load can not be found on the class path. Try changing your code to: getClass.getClassLoader.getResourceAsStream("app/conf/cert.p12") You will notice I removed the leading slash on the file path as I believe this is your issue. Then just make sure that whatever the parent directory to "app" is is on your class path.

Categories : Scala

How to get xml file as input stream from Url and make xml parsing
I think the switch statement is working fine, but you have other problems with your code. First of all, you missed the break statement in your last non default case: case XmlPullParser.END_TAG: tagName = parser.getName(); if (tagName.equalsIgnoreCase("item") && currentFeed != null){ feeds.add(currentFeed); } //<---- here! default : Log.d("error","non of the cases implemented!"); break; That log statement is being run every time you find an end tag, and that's why you get all those log messages. The real problem is that you're doing string comparisons with == instead of using the .equals(), for example: if (tagName == "item")

Categories : Android

Sevenzip extractFile(String file, Stream stream) method stream parameter. c#
Setup a FileStream that SevenZip can write out to: DirectoryInfo directoryInfo = new DirectoryInfo(ApplicationPath); FileInfo[] zipFile = directoryInfo.GetFiles("*.7z"); using (SevenZip.SevenZipExtractor zipExtractor = new SevenZip.SevenZipExtractor(zipFile[0].FullName)) { using (FileStream fs = new FileStream("", FileMode.Create)) //replace empty string with desired destination { zipExtractor.ExtractFile("ConfigurationStore.xml", fs); } }

Categories : C#

Delay in playing video file from Input Stream
This delay is due to writing data to temporary file.Instead you can use ParcelFileDescriptor to avoid writing to a temporary file.You can use link(http://www.mattakis.com/blog/kisg/20090708/broadcasting-video-with-android-without-writing-to-the-file-system) as reference.

Categories : Android

Reading a file from OSGI bundle returns a different format for input stream
It already is an InputStream - see the class hierarchy. Just pass it to Jasper Reports.

Categories : Java

How to properly close file-to-string input stream? (IOUtils FileUtils)
It's difficult to say what may cause OOME but closing should be like this InputStream is = getAssets().open(myAssetsFilePath); try { myVeryLargeString = IOUtils.toString(is, "UTF-8"); } finally { IOUtils.closeQuietly(is); }

Categories : Java

Which input/output stream is better to use to find a specific line on a source file on java?
BufferedReader br = new BufferedReader(new FileReader(<your_file>)); String line; while ((line = br.readLine()) != null) { //process here } br.close(); This would be the standard way to read from a file. Inside the while loop you could do things you need. If you specify your question, more help will be possible

Categories : Java

FFMpeg - Merge multiple rtmp stream inputs to a single rtmp output
Copy video stream and merge two mono steams Try the amerge audio filter: ffmpeg -i rtmp://ip:1935/live/micMyStream7 -i rtmp://ip:1935/live/MyStream7 -codec:v copy -filter_complex "[0:a][1:a]amerge" -codec:a aac -strict -2 -f flv rtmp://ip:1935/live/bcove7 ...or simply use -ac 2: ffmpeg -i rtmp://ip:1935/live/micMyStream7 -i rtmp://ip:1935/live/MyStream7 -codec:v copy -ac 2 -codec:a aac -strict -2 -f flv rtmp://ip:1935/live/bcove7 I added -codec:v copy to stream copy the video instead of re-encoding it. I am unable to try the commands right now, so they are untested, and I will probably not be able to reply until Monday.

Categories : Java

Pushing data to web-browser while processing input from ffmpeg
You need to tell ffmpeg to output data to stdout, rather than giving it a file name. For example, the following command reads an input in FLAC format from stdin and writes an output in MP3 format to stdout (the file name "-" is used to mean stdin/stdout): ffmpeg -f flac -i - -f mp3 -

Categories : PHP

Convert input file or stream to UTF8 and detect if it's UTF8 or not (asp.net)
For checking if stream is UTF8 see: http://utf8checker.codeplex.com/ For converting it you can use StreamReader: new StreamReader(stream, Encoding.UTF8)) In fact, using this contructor prevents you the previous check, you can just use it. MSDN: The character encoding is set by the encoding parameter, and the buffer size is set to 1024 bytes. The StreamReader object attempts to detect the encoding by looking at the first three bytes of the stream. It automatically recognizes UTF-8, little-endian Unicode, and big-endian Unicode text if the file starts with the appropriate byte order marks. Otherwise, the user-provided encoding is used. See the Encoding.GetPreamble method for more information. If you wish it not to detect little-endian Unicode and big-endian Unicode ca

Categories : C#

How to update an XML document by stream reading a file and simultaneously stream writing output
Use SAX parser instead of DOM. You can also use the StAX APIs (part of JDK package javax.xml.stream ). Further reading- http://docs.oracle.com/javase/tutorial/jaxp/sax/parsing.html http://download-llnw.oracle.com/javase/6/docs/api/index.html?javax/xml/stream/package-summary.html

Categories : Java

Effects on Input Variable after Failed Input Stream
You get zero because you have a pre-C++11 compiler. Leaving the input value unchanged on failure is new in the latest standard. The old standard required the following: If extraction fails, zero is written to value and failbit is set. If extraction results in the value too large or too small to fit in value, std::numeric_limits::max() or std::numeric_limits::min() is written and failbit flag is set. (source) For gcc, you need to pass -std=c++11 to the compiler to use the new behavior.

Categories : C++

Android FFMPEG: Could not execute the ffmpeg from Java code
Do you have root on the device? Mount '/data' and then enter your same 'ffmpeg' command in the shell and see whether the error is the same. Try using the shell to test out different command expressions. Try 'ffmpeg' alone and with just one input file. See whether those commands produce expected output. My wild guess would be that there is an issue with calling 'ffmpeg.main()' that relates to the details of your build.

Categories : Android

How to encode a file from the file system as multipart/form-data?
You need to open that photo (of type Windows.Storage.StorageFile) for reading, convert it's stream to blob, append it to FormData object and upload using whatever Ajax library you want (WinJS.xhr, jQuery.ajax etc). Following code illustrates it better than words: file.openReadAsync().done(function(fileStream) { var fileData = MSApp.createBlobFromRandomAccessStream(file.contentType, fileStream); var formData = new FormData(); formData.append('upload', fileData, file.name); ... // send formData as xhr request body });

Categories : Javascript

ffmpeg cannot detect file while os can
The problem is that you've set up your system so every new cmd.exe shell immediately cd's to your Documents directory, so ffmpeg is trying to run there. The obvious way around that is to just give ffmpeg absolute paths instead of relative: images = os.path.abspath('.\images') cmd = "ffmpeg -f image2 -r 20 -i {}\image%01d.png -c:v libx264 -r 20 {}\output.mp4".format(images, images) Alternatively, you can always stick a cd command into what you send to the system function: curpath = os.path.abspath(os.getcwd()) cmd = "cd {} && ffmpeg -f image2 -r 20 -i .\images\image%01d.png -c:v libx264 -r 20 .\images\output.mp4".format(curpath) However, the best solution is to stop using system entirely, as the documentation for system suggests, and leave the shell out of it: cmd = "ffmpeg

Categories : Python

why do structure's data members memory allocated from lower to higher address in stack growing higher to lower
One advantage is that Operating System is able to easily check whether overflow occurs in a process(program). Heap segment is usually growing from lower to higher when stack is growing from higher to lower. if two segment is gradually grow to be overlapped, OS can detect overflow in the process. Here is a diagram for memory layout of C programs. Hope this help. Also, such choice depends on OS designer. If you are a beginner, just don't care about it. Think easy.

Categories : C

shifting chars in C with modulus, outputting to file produces unsupported file format on one input, txt file on other input
Nominally, a text file must end with a newline. Your program does not ensure that there is a newline at the end of the file, so it does not always generate a text file. Indeed, it probably does so one time in 256 (or maybe 255; what do you do about null bytes?). Most Unix programs aren't that fussy about the last line, but some are. So, if that's the definition of a text file, it isn't very surprising that you don't produce one. In any case, the intermediate file is likely to contain a whole bunch of characters that make it look unlike a text file — depending on the password, of course. You use the password to generate a value for a Caesar shift. This means that most of your alphabetic characters are going to be shifted to a non-alphabetic position. This is fairly normal for an e

Categories : C

ffmpeg: error while loading shared libraries: libmp3lame.so.0: cannot open shared object file: No such file or directory
Fortunately, I stumbled across this similar question, and I was able to see that all I needed to do was look at the bin/release file from the buildpack I was using and make sure the correct PATH and LD_LIBRARY_PATH were set to match the config_vars in that file. I set them using the heroku config:set command. Apparently the config_vars are only taken from the apps first deploy. Anyway, hope this will save someone else some time down the road.

Categories : Python

Clearing input stream
I notice that b is not defined within the loop. Unless it's a global and all of the command classes reset it, it's never getting set back to 0...which means that first "Help" will always be "Help". Worse still, eventually you're going to write past your array. Since b is pretty much entirely an index into cmd and a count of words, it should probably be defined in the same scope. Both problems can be kind-of-fixed by adding b = 0; right before the loop that fills cmd. (If you don't use b outside of the loop, though, you should really be defining it inside.) But really, you'd probably do better to use std::getline to read a whole line at once as a std::string, and then use istringstream's extraction operator (rather than get()) to extract the individual words into a vector. (char inpu

Categories : C++

When and where to clear input stream in c++
You're clearing the flags after you've reached the end of the stream because you intend to reach the end of the stream. A flag raised by another function may not have been intended and may need handling.

Categories : C++

Reading from input stream
You can create a wrapper InputStream that would then report EOF before reading the entire stream. This lets you avoid having to read the whole stream into a byte array. class MarkerInputStream extends FilterInputStream { MarkerInputStream(InputStream in) { super(in); } @Override public int read() throws IOException { if (isAtMarker()) { return -1; } // may need to read from a cache depending on what isAtMarker method does. return super.read(); } private boolean isAtMarker() { // logic for determining when you're at the end of the image portion return false; } }

Categories : Java

How can i set that the ffmpeg.exe will work as process from the directory i run my application exe file?
Is ffmpeg.exe stand-alone without needing a bunch of additional support files? If so, one option would be to simply copy this executable into your project and deploy it on compilation. Then, a copy always exists in your deployment.

Categories : C#

How can i add ffmpeg.exe file to my project but two files one for 32bit and one for 64bit?
To include ffmpeg twice, just make subdirectories - X86ffmpeg.exe and x64ffmpeg.exe and call the appropriate one. To see if your OS is 64-bit capable, use System.Environment.Is64BitOperatingSystem

Categories : C#

how to get width/ height of video file using S3FS, FFMPEG in ec2
I would like to recommend to take a look at the new project RioFS (Userspace S3 filesystem): https://github.com/skoobe/riofs. This project is “s3fs” alternative, the main advantages comparing to “s3fs” are: simplicity, the speed of operations and bugs-free code. Currently the project is in the “testing” state, but it's been running on several high-loaded fileservers for quite some time. We are seeking for more people to join our project and help with the testing. From our side we offer quick bugs fix and will listen to your requests to add new features. Regarding your issue, RioFS is able to read "requested" blocks of files, for example I tried to get properties of a video file stored on S3: Mounted RioFS: ./riofs -c ../riofs.conf.xml http://s3.amazonaws.com bucket_nam

Categories : Amazon

How to convert .mov files to .mp4 (H264) using ffmpeg using windows .bat file?
PCM audio streams are not compatible with the MP4 container, look at the specs and your error message: Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, mono, s16, 256 kb/s [mp4 @ 00000000024bc980] Tag [1][0][0][0]/0x00000001 incompatible with output codec id '65536' ([0][0][0][0]) Please note: the MP4 video container format and the H.264 video stream format are two different things. The MP4 video container may also 'contain' other video stream formats, eg. Xvid or even MJPEG.

Categories : Batch File

Sending input to the blocking stream of PHP ssh
scp (as well as ssh) do not expect a password but from the standard input, but from the console (as in tty), and this is a Good Thing. Storing your password anywhere such as some PHP code compromises the very purpose of ssh. Instead you should create a RSA authentication key. Here is a simple how-to. Once you are done, change your command line as follows: scp -i /path/to/your/rsa.private.key Make sure to store this private key in a "secure" location. It must be accessible from your PHP script, but no one else. In particular do not make it accessible from a URL.

Categories : PHP

How to flush buffer data to disk when using FFmpeg to write a mp4 file?
I got the problem, that was caused by I never write audio frame, so if just want to encode several bmps to a video file, please note: 1) don't add audio stream(add_stream). 2) don't open audio stream(open_audio). hope this also helps others. Sean

Categories : C++

Mac 10.8 > Cannot encode text file with UTF8
What's the content of toto2.php? If the file only contains ASCII-compatible characters (i.e. mostly latin and the few "common" special characters), then there's no way for file (or any other tool) to distinguish a ASCII-encoded and an UTF-8 encoded file, because they will be byte-for-byte identical. Given that iconv converted from "us-ascii", that's actually a given! In other words: converting from a (real) ASCII file to a UTF-8 file is a no-op!

Categories : Osx



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.