w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
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 redirect both stdout and stderr to file AND still output ONLY stderr?
That is very easy: $ ( ./command.sh >> log ) 2>&1 | tee -a log You write the stdout of command to the log file in a sub shell; than you write stderr to pipe; and than, my means of tee, save it to the log and copy the same to the console. Example of usage: $ cat command.sh #!/bin/sh echo out echo err > /dev/stderr $ ( ./command.sh >> log ) 2>&1 | tee -a log err $ cat log out err

Categories : File

Can ffmpeg be used to output to bytes
Yes, it is. You gotta learn how to use the other protocols FFmpeg has. Input/output to a file is just a particular protocol... but you can output, for example, to a socket, to a FTP/HTTP, and so on... It's very easy for anyone to create a new protocol (in C, of course) and register it with FFmpeg. I don't think FFmpeg has a built-in solution to write to a buffer, but for sure it's possible. I've done this once.

Categories : C#

Building ffmpeg with an executable output
Consider using scratchbox to statically cross-compile for ARM (and test) FFMPEG to your requirements on your desktop (still inside SB). Once your happy, get enough space on your droid to keep the larger than otherwise binary and adb that exe up in there. Don't forget to chmod +x

Categories : C++

$stdout.gets blocks when it should return output, why?
You have to to either flush your output buffer: puts 'Server started' $stdout.flush Or enable sync mode: $stdout.sync = true puts 'Server started' # flushed automatically

Categories : Ruby

PartialView to create a select box: How to Html.Encode Output?
You don't need to manually Html.Encode because Razor secure by this manner. This means that Razor HTML encodes every string what you write to the output with the @ sing. So you can just safely write @value.Value. By the way the effect what you are seeing is the case of the double encoding because you first encode for text with Html.Encode and then Razor encodes the already encoded text for the second time when you write it out with @Html.Encode(value.Value).

Categories : Asp Net Mvc

Call java command line program from .net and return output of STDOUT to variable
Yes, use Process.StandardOutput (e.g., StreamReader.ReadToEnd among other possibilities). Be sure to set ProcessStartInfo.UseShellExecute to false, and ProcessStartInfo.RedirectStandardOutput to true.

Categories : Java

Check file type (FLV) before PHP upload file in temporary folder by reading only starting 3 bytes of file
@burhan-khalid provided a more up to date and correct answer above. Short Answer is no with your constraints. You can not access that file with PHP until it has been uploaded to the server. After it is uploaded you can read it but not before, at least not without some type of client side software that would allow you to stream it to PHP instead of the normal form submission.

Categories : PHP

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

Intellij compiler error - failed to copy from temporary location to output directory
I got the same error but did not see any answer to this question so thought of posting my solution(workaround) for this: As the error mentioned failure to copy from temporary location which was point to Temp folder so I tried cleaning up the Temporary files etc. using Disk Cleanup of C: and that resolved the error for me. NOTE: This is just a temporary workaround, I would love to get a real solution to this. I am using IntelliJ IDEA 12.0.1.

Categories : Intellij Idea

Notice: Use of undefined constant STDOUT - assumed 'STDOUT'
You should add, in your own code, something like : define("STDOUT", fopen('log.txt', 'w')); Information about files transfered will be logged into the file 'log.txt'.

Categories : PHP

Xargs stdout to file redirection appending file indefinitely
Change redirected file from >greping to >../greping or >/tmp/greping. Basically, output file should not be in current directory or any of its subdirectory. Or try: find . -mmin -10 | grep -Fx -v './greping' | xargs grep mypattern > greping

Categories : Bash

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

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

Sending child stdout to parent stdout
The read is returning 0 (end of file) because the child end of the pipe is closed. You've got the dup2 the wrong way round, it should be dup2(pipefd[1],STDOUT_FILENO) also remove close(STDOUT_FILENO)

Categories : Misc

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

how to fetch details from a file and store in a temporary file in shell script?
You can try this : x=($(grep -Po "(?<=DB_IP=)(.+)(?=,)|(?<=DB_NAME=)(.+)" config.txt)) y=($(grep -Eo "[a-zA-Z_]+=" details.txt)) echo $y$x > temp.txt echo ${y[1]}${x[1]} >> temp.txt Assuming that the order of DB_IP and DB_NAME is always same in both files.

Categories : Shell

Warning: File upload error - unable to create a temporary file in Unknown on line 0
use double quotes in ../inventory_images/$newname. change this line move_uploaded_file($_FILES['fileField']['tmp_name'],'../inventory_images/$newname'); AS move_uploaded_file($_FILES['fileField']['tmp_name'],'../inventory_images/'.$newname); NOTE: in php with single quotes $newname will be display as string. for displaying value of a variable use double quotes

Categories : PHP

ruby Temporary files inside temporary directory
You should use the Tempfile class. require 'tempfile' file = Tempfile.new('foo') file.path # => A unique filename in the OS's temp directory, # e.g.: "/tmp/foo.24722.0" # This filename contains 'foo' in its basename. file.write("hello world") file.rewind file.read # => "hello world" file.close file.unlink # deletes the temp file To create temporary folders, you can use Dir.mktmpdir.

Categories : Ruby On Rails

how to set a FILE** variable to stdout?
According to the C standard (7.21.1), stdout is a macro which is an expression of type "pointer to FILE". It is not necessarily a global variable. It is not portable C to take its address --- it works in gcc but not in mingw, as you saw. Use the second version of your code --- this is portable. The third would be OK too if you moved the initialization of fout inside main: /* version 3 */ #include <stdio.h> FILE* fout; int main() { fout = stdout; fprintf( fout, "hello " ); } This initialization cannot be combined with the declaration of fout, as stdout is not (at least, not necessarily) a constant expression. If you want to have a FILE ** pointer, use: /* version 4 */ #include <stdio.h> FILE* mystdout; FILE** fout = &mystdout; int main() { mystdout = st

Categories : C

Trying to redirect stdout to a file
If you want to do it from within the script open a file instead of using WScript.StdOut: Set fso = CreateObject("Scripting.FileSystemObject") ... Set StdOut = fso.OpenTextFile("C:path oyour.txt", 2, True) ... StdOut.Close Otherwise redirect the output created by the script to a file: C:>cscript //NoLogo script.vbs >C:path oyour.txt Timestamps can be printed like this: StdOut.WriteLine Now I'm not sure what exactly you mean by "location".

Categories : Vbscript

What have I done wrong or how do I correct the output from my datastore key in html? datastore.Encode()?
Change .Key to .Key.IntID: <a href="/hobby?action=admin&operation=edit&id={{.Key.IntID}}"> Docs: http://godoc.org/code.google.com/p/appengine-go/appengine/datastore#Key.IntID

Categories : HTML

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

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

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 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#

is there a way to capture stdout in Julia like capture.output() in R?
Standard library functions should all accept an optional IO-typed first argument that will be printed to if provided but otherwise will default to STDOUT. In that case, you can use sprint(io->f(io,...)) to capture what's printed to a string. If the functions haven't been written to print to a given IO object, then there isn't a way to redirect the output.

Categories : R

Create a temporary table in temporary tablespace db2
System Temporary tablespaces are used only for system-created temporary objects – for joins, sorts that are too large for the sort heap, table queues that overflow, etc. You need to create a USER TEMPORARY tablespace. You can read more about the various types of tablespaces. And use the CREATE TABLESPACE command to create one.

Categories : SQL

Python Scripting - How can I launch a subprocess and pipe the stdout of that process to the stdout of a Python script
Take a look on the Popen class of subprocess module (link). You can pass stdin and stdout parameters to it. That should solve your problems.

Categories : Bash

Redirect system2 stdout to a file on windows
I'm quite convinced now this is a bug in RGui.exe in windows. I filed a bug report here: https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15393

Categories : R

replacing stdout and stdin with a file pointer in c++?
If looks like the structure member is expecting a file id number rather than a pointer to a streamed file buffer. Use fileno to acquire the id from FILE*. #include <stdio.h> FILE * fp; fp=fopen("myf","r"); msb.sbox.task.ofd=fileno(fp);

Categories : C++

when using stdout, why changing to file object needed?
print simply massages its arguments and then invokes sys.stdout.write(). Replacing sys.stdout allows you to capture the output of print and redirect it.

Categories : Python

Scala opening write to stdout or file
Why not rewrite the function as: def writeToFileOrStdout(fname: Option[String] = None) = { val outStream = fname match{ case Some(name) => new java.io.FileOutputStream(new java.io.File(name)) case None => System.out } ... } It's always a good idea to use Option for an optional input as opposed to using null. That's basically what it's there for. In good scala code, you will not see explicit references to null. In fact, your code doesn't even compile for me. Nil is used to represent an empty list, not a null or non supplied String.

Categories : Java

stdout printed in stderr file while using logger
You have return logger.error(process.stderr.read()) return logger.info(process.stdout.read()) The second return statement doesn't get executed, so the process' stdout is never logged. Just remove return from those statements, and you should find that output appears in stdout.log. You're getting stderr output in stdout.log because the all logged events are passed to both handlers.

Categories : Python

redirect file to stdout - reverse io redirection
You could use /dev/stdout and it works in some cases, however since it's still a pipe, it won't support some operations a file do (seeking for example), so it all depends on the program.

Categories : Linux

printing results in stdout file as well as console
Use subprocess.check_output: print subprocess.check_output(['./MyScript]) In Python 2.6, either use the backport subprocess32, or copy the 2.7 source for check_output.

Categories : Python

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++



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