Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Can all Android devices play local 60fps mp4 files ?
3 juin 2017, par Ken YorkWe have an android app with 60fps mp4 files in the raw directory.
The mp4s are encoded H.264 baseline 60fps
They work well and look good on all our test devices using VideoView.
We are targeting API16(4.1) and above.
Is it guaranteed that 60fps mp4 files will always play on any API16+ device?
If not, would there be an error msg, crash, or just play at 30fps ?
Thanks all!
-
compress video like facebook using ffmpeg
3 juin 2017, par Mahesh Prajapatii have already used many of the commands but it will reduced size when i will reduce the height width but facebook reduce the size without reducing height width so how can it possible using ffmpeg if not exactly result but want similar result.
hear is the some sample example i have done with height width decries.
$cmd3="$ffmpeg -i Wildlife.wmv -r 30 -s 400x224 -c:v libx264 -y Wildlife_30fps_400x224_testing.mp4";
but i dont want to change height width i want to reduce size as well as convert all the extension only in .mp4 format.
-
vlc in android , i need compile ffmpeg from source file not from git
3 juin 2017, par Eva Zanai have the rules.mak file from ffmpeg in vlc android. i modified in libav file now i want thev changes to impact.the problem is that the files is compiled from git and not from my changes
ifdef USE_FFMPEG FFMPEG_HASH=0768aaec1d683226e613e692080a588359c31334 FFMPEG_SNAPURL := http://git.videolan.org/?p=ffmpeg.git;a=snapshot;h=$(FFMPEG_HASH);sf=tgz FFMPEG_GITURL := http://git.videolan.org/git/ffmpeg.git else FFMPEG_HASH=6ac0e7818399a57e4684202bac79f35b3561ad1e FFMPEG_SNAPURL := http://git.libav.org/?p=libav.git;a=snapshot;h=$(FFMPEG_HASH);sf=tgz FFMPEG_GITURL := git://git.libav.org/libav.git endif FFMPEG_BASENAME := $(subst .,_,$(subst \,_,$(subst /,_,$(FFMPEG_HASH)))) # Build PKGS += ffmpeg ifeq ($(call need_pkg,"libavcodec >= 55.0.0 libavformat >= 53.21.0 libswscale"),) PKGS_FOUND += ffmpeg endif FFMPEGCONF += --nm="$(NM)" --ar="$(AR)" $(TARBALLS)/ffmpeg-$(FFMPEG_BASENAME).tar.xz: $(call download_git,$(FFMPEG_GITURL),,$(FFMPEG_HASH)) .sum-ffmpeg: $(TARBALLS)/ffmpeg-$(FFMPEG_BASENAME).tar.xz $(call check_githash,$(FFMPEG_HASH)) touch $@ ffmpeg: ffmpeg-$(FFMPEG_BASENAME).tar.xz .sum-ffmpeg rm -Rf $@ $@-$(FFMPEG_BASENAME) mkdir -p $@-$(FFMPEG_BASENAME) tar xvJf "$<" --strip-components=1 -C $@-$(FFMPEG_BASENAME) $(MOVE) .ffmpeg: ffmpeg cd $< && $(HOSTVARS) ./configure \ --extra-ldflags="$(LDFLAGS)" $(FFMPEGCONF) \ --prefix="$(PREFIX)" --enable-static --disable-shared cd $< && $(MAKE) install-libs install-headers touch $@
I need to chage that instead git from the url git that it will take from a source file i do i do that?
-
Audio recorded with MediaRecorder on Chrome missing duration
3 juin 2017, par suppp111I am recording audio (oga/vorbis) files with MediaRecorder. When I record these file through Chrome I get problems: I cannot edit the files on ffmpeg and when I try to play them on Firefox it says they are corrupt (they do play fine on Chrome though).
Looking at their metadata on ffmpeg I get this:
Input #0, matroska,webm, from '91.oga': Metadata: encoder : Chrome Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0(eng): Audio: opus, 48000 Hz, mono, fltp (default) [STREAM] index=0 codec_name=opus codec_long_name=Opus (Opus Interactive Audio Codec) profile=unknown codec_type=audio codec_time_base=1/48000 codec_tag_string=[0][0][0][0] codec_tag=0x0000 sample_fmt=fltp sample_rate=48000 channels=1 channel_layout=mono bits_per_sample=0 id=N/A r_frame_rate=0/0 avg_frame_rate=0/0 time_base=1/1000 start_pts=0 start_time=0.000000 duration_ts=N/A duration=N/A bit_rate=N/A max_bit_rate=N/A bits_per_raw_sample=N/A nb_frames=N/A nb_read_frames=N/A nb_read_packets=N/A DISPOSITION:default=1 DISPOSITION:dub=0 DISPOSITION:original=0 DISPOSITION:comment=0 DISPOSITION:lyrics=0 DISPOSITION:karaoke=0 DISPOSITION:forced=0 DISPOSITION:hearing_impaired=0 DISPOSITION:visual_impaired=0 DISPOSITION:clean_effects=0 DISPOSITION:attached_pic=0 TAG:language=eng [/STREAM] [FORMAT] filename=91.oga nb_streams=1 nb_programs=0 format_name=matroska,webm format_long_name=Matroska / WebM start_time=0.000000 duration=N/A size=7195 bit_rate=N/A probe_score=100 TAG:encoder=Chrome
As you can see there are problems with the duration. I have looked at posts like this: How can I add predefined length to audio recorded from MediaRecorder in Chrome?
But even trying that, I got errors when trying to chop and merge files.For example when running:
ffmpeg -f concat -i 89_inputs.txt -c copy final.oga
I get a lot of this:
[oga @ 00000000006789c0] Non-monotonous DTS in output stream 0:0; previous: 57612, current: 1980; changing to 57613. This may result in incorrect timestamps in the output file. [oga @ 00000000006789c0] Non-monotonous DTS in output stream 0:0; previous: 57613, current: 2041; changing to 57614. This may result in incorrect timestamps in the output file. DTS -442721849179034176, next:42521 st:0 invalid dropping PTS -442721849179034176, next:42521 invalid dropping st:0 [oga @ 00000000006789c0] Non-monotonous DTS in output stream 0:0; previous: 57614, current: 2041; changing to 57615. This may result in incorrect timestamps in the output file. [oga @ 00000000006789c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly DTS -442721849179031296, next:42521 st:0 invalid dropping PTS -442721849179031296, next:42521 invalid dropping st:0
Does anyone know what we need to do to audio files recorded from Chrome for them to be useful? Or is there a problem with my setup?
Recorder js:
if (navigator.getUserMedia) { console.log('getUserMedia supported.'); var constraints = { audio: true }; var chunks = []; var onSuccess = function(stream) { var mediaRecorder = new MediaRecorder(stream); record.onclick = function() { mediaRecorder.start(); console.log(mediaRecorder.state); console.log("recorder started"); record.style.background = "red"; stop.disabled = false; record.disabled = true; var aud = document.getElementById("audioClip"); start = aud.currentTime; } stop.onclick = function() { console.log(mediaRecorder.state); console.log("Recording request sent."); mediaRecorder.stop(); } mediaRecorder.onstop = function(e) { console.log("data available after MediaRecorder.stop() called."); var audio = document.createElement('audio'); audio.setAttribute('controls', ''); audio.setAttribute('id', 'audioClip'); audio.controls = true; var blob = new Blob(chunks, { 'type' : 'audio/ogg; codecs="vorbis"' }); chunks = []; var audioURL = window.URL.createObjectURL(blob); audio.src = audioURL; sendRecToPost(blob); // this just send the audio blob to the server by post console.log("recorder stopped"); }
-
avformat_open_input fails only with a custom IO context
2 juin 2017, par TimRunning into an odd issue with avformat_open_input, it is failing with:
Invalid data found when processing input
But this only happens when I attempt to read the file using a custom
AVIOContext
.My custom code is as follows (error checking omitted for clarity):
auto fmtCtx = avformat_alloc_context(); auto ioBufferSize = 32768; auto ioBuffer = (unsigned char *)av_malloc(ioBufferSize); auto ioCtx = avio_alloc_context(ioBuffer, ioBufferSize, 0, reinterpret_cast
(this), &imageIORead, NULL, &imageIOSeek)); fmtCtx -> pb = ioCtx; fmtCtx -> flags |= AVFMT_FLAG_CUSTOM_IO; int err = avformat_open_input(&fmtCtx, NULL, NULL, NULL); imageIOSeek
is never called, but properly handles thewhence
parameter including theAVSEEK_SIZE
option. My file data is already loaded in memory, soimageIORead
is trivial (returning 0 at EOF):int imageIORead(void *opaque, uint8_t *buf, int buf_size) { Image *d = (Image *)buf; int rc = std::min(buf_size, static_cast
(d->data.size() - d->pos)); memcpy(buf, d->data.data() + d->pos, rc); d->pos += rc; return rc; } The data being read is loaded from a file on disk:
/tmp/25.jpeg
The following code is able to open and extract the image correctly:
auto fmtCtx = avformat_alloc_context(); int err = avformat_open_input(&fmtCtx, "/tmp/25.jpeg", NULL, NULL);
The project is using a minified version of
libavformat
including only the formats we need. I don't believe this is the cause of the problem since the file can be open and handled properly when the path is specified. I haven't seen anyconfigure
options specifically targeting support for custom IO contexts.This is the image in question: 25.jpeg