ffmpeg,multimedia,mjpeg , Incompatible pixel format YUV420P with mjpeg


Incompatible pixel format YUV420P with mjpeg

Question:

Tag: ffmpeg,multimedia,mjpeg

I am using ffmpeg to make a video from jpeg images using mjpeg codec. I use this command

ffmpeg -i frame%d.jpg -c:v mjpeg -pix_fmt yuv420p -q:v 1 -y out.mp4

and I have this warning the yuvj420p was chosen instead. After reading about that pixel format, I found its deprecated to use YUV420p and set the -color_range. So I did so and set the color_range to 2, but nothing changed.


Answer:

You get the warning because ffmpeg's internal JPEG encoder expects JPEG-range input, and does so using the old (deprecated) pixfmt YUVJ420P instead of the new method (setting pixfmt=YUV420P with color-range).

However, that brings us to the core of this question: why are you re-encoding JPEG source images to JPEG? You don't need to! You can just use -c:v copy (instead of -c:v mjpeg) to copy the existing JPEG images as-is into the .mp4 file.


Related:


FFmpeg move overlay from one pixel coordinate to another


video,ffmpeg
I'm trying to write a command within FFmpeg that will first overlay one video stream on top of another one. Then I want the overlayed video to move from one pixel coordinate at a known time, and end at another pixel coordinate at a later time. I'm comfortable with the...

Splitting up a variable in bash


bash,ffmpeg,mp3
I have a bunch of songs that I have downloaded that I am trying to convert to .mp3 and rename. After converting the .m4a file to mp3 with ffmpeg, they are all in the format of Artist Name - Song Name.mp3. I want to be able to separate the Song...

FFMPEG attach file as metadata


ffmpeg,attachment
I have a set of images which I want to convert to a video using ffmpeg. The following command works perfectly fine: ffmpeg -y -i frames/%06d.png -c:v huffyuv -pix_fmt rgb24 testout.mkv I have some meta data in a binary file which I want to attach with the video. I tried...

Live streaming dash content using mp4box


ffmpeg,video-streaming,html5-video,mpeg-dash,media-source
I'm trying to live stream H.264 content to HTML5 using the media source extensions API. The following method works pretty well: ffmpeg -i rtsp://10.50.1.29/media/video1 -vcodec copy -f mp4 -reset_timestamps 1 -movflags frag_keyframe+empty_moov -loglevel quiet out.mp4 and then: mp4box -dash 1000 -frag 1000 -frag-rap out.mp4 I can take the MP4Box output...

FFmpeg audio crossfade


linux,audio,ffmpeg,cross-fade
I'm trying to merge several videos using ffmpeg and apply the cross-fade transition in between. I got video cross-fade working by referring to this. At the same time I need to have audio also to have cross-fade applied for original audios associated with each video. I referred several places but...

ffmpeg/batch file: input format stays in output file name


batch-file,ffmpeg,aac,m4a
I created this batch file to put all aac files in one directory into an m4a container. The command works so far, but every new file generated has the format of the input file in the output files name. For example: test(.aac) is in an m4a container but is NAMED...

FFmpeg: How to convert vertical video with black sides, to video 16:9, with blurred background sides


video,background,ffmpeg,blur
How to make this by using FFmpeg? Example without FFmpeg: Adobe After Effects Sony Vegas Pro...

How to install gstreamer0.10-ffmpeg on Debian 8 Jessie (No installation candidate)


ffmpeg,debian,gstreamer,apt
On a clean Debian 8 installation i had to install some gstreamer-plugins. While most of them were already installed or were easily installable via apt-get, gstreamer0.10-ffmpeg was not installable: sudo apt-get install gstreamer0.10-ffmpeg threw out following warnings: Package gstreamer0.10-ffmpeg is not available, but is referred to by another package. This...

Qt 5.5 Video shader issue on iOS


ios,qt,video,multimedia
I'm working with Qt(especially 5.5) on iOS device not simulator I'm just add Video object to QML code for play HLS stream like below. Video { id: livePlayer anchors.fill: parent source: "http://content.jwplatform.com/manifests/vM7nH0Kl.m3u8" autoPlay: true } But Qt returns me bug with log like below Failed to find shader ":/qtmultimediaquicktools/shaders/rgbvideo.vert" Failed...

image overlay with ffmpeg runs the script indefinitely


ffmpeg,overlay
I really tried hard, I did not succeed, so I am asking here. I wanted to have an overlay image (jpg) with text on video (mp4; 15 secs) and have fade-in and fade-out for the overlayed image (and not the video). I could do this with the follwing command, but...

avcodec_open only works with uncompressed format


ffmpeg,static-libraries,codec,avcodec
Context: I have a file called libffmpeg.so, that I took from the APK of an Android application that is using FFMPEG to encode and decode files between several Codecs. Thus, I take for grant that this is compiled with encoding options enable and that this .so file is containing all...

How to add Title in video by ffmpeg on Node JS


node.js,ffmpeg
I am working on a project where I have to add Title on a video by FFmpeg. I have already succeeded in adding a picture on a video. Can anybody help me to add Text(Title) on a video? Here is my code for adding Image, please suggest the required modification:...

Batch ffmpeg and compress the files


batch-file,ffmpeg
I am doing a bunch of conversions with ffmpeg, where I need to watermark the content. I am using a batch file to run the ffmpeg application, but I want to automate all of this. for %%a in ("*.mp4*") do ffmpeg -i "%%a" -i logo.png -filter_complex overlay "newfiles\%%~na.mp4" pause Source...

FFmpeg - Unrecognized option 'map [outv]'


ffmpeg,java
I am merging some video files with FFmpeg and having an issue with my custom build. I'm using the following Java code for wrapping the ffmpeg command: List<String> cmds = new ArrayList<>(); cmds.add("ffmpeg"); cmds.add("-i"); cmds.add("input1.mp4"); ... cmds.add("-map [outv]"); cmds.add("-map [a]"); ... cmds.add("output.mp4"); ProcessBuilder pb = new ProcessBuilder(cmds); pb.directory(fileExec); Process process...

ffmpeg subprocess fail to open on OS X


python,ffmpeg,subprocess
I've got this script: PATH = os.path.dirname(os.path.abspath(__file__)) global TEMP for video in os.listdir(VIDEOS): ffmpeg = PATH + "/ffmpeg/ffmpeg" arg1 = " -v 0 -i " arg2 = VIDEOS + "/" + video arg3 = " -r 1 -f image2 " arg4 = TEMP + "/" + os.path.splitext(video)[0] + "-%d.jpg" subprocess.Popen(ffmpeg...

Mp4 to HLS using ffmpeg


ios,video,ffmpeg,m3u8,hls
I'm trying to convert a local .mp4 video to HLS using ffmpeg in an iOS app. I have integrated the ffmpeg wrapper using pods and generated all the segmented .ts files and the m3u8 file, but some of the .ts file segments are not listed in the .m3u8 playlist file...

ffmpeg: wmv files generated on Mac can't be played in Windows


windows,osx,ffmpeg,file-conversion,wmv
On Mac OS X 10.6.8, I converted a animated gif to a video file in wmv (a requested file format) by using ffmpeg -i File.gif -s 400x400 NewFile.wmv The video file played fine using VLC on Mac. The file can't be played on a Windows 7 machine using the Windows...

FFmpeg H264 parsing


c++,c,parsing,ffmpeg,h.264
I am using FFmpeg to decoding H.264 video, for the following program: #include <stdlib.h> #include <stdio.h> #include <string.h> #include <signal.h> #include <sys/time.h> #include <time.h> #include <libavcodec/avcodec.h> #include <libavutil/mathematics.h> #include <SDL/SDL.h> void sigint_handler(int signal) { printf("\n"); exit(0); } const char *window_title; SDL_Surface *screen; SDL_Overlay *yuv_overlay; #define INBUF_SIZE 80000 /* * Video...

ffmpeg cut first 5 seconds


python,video,ffmpeg
I am having trouble removing the first 5 seconds of a .mp4 video. Here is what I have so far: subprocess.call("ffmpeg -ss 00:00:00 -t 00:00:05 -i /home/requiem/Desktop/t1.mp4 -vcodec copy -acodec copy /home/requiem/Desktop/t2.mp4", shell=True) The issue is that it just takes the first 5 second and saves it, but I want...

Simple ffmpeg program has memory leaks


ffmpeg
Environment: Ubuntu 14.04 I compiled the simple source code from ffmpeg tutorial step 1 at http://dranger.com/ffmpeg/tutorial01.html. When I run the binary through valgrind, it reports a bunch of memory leaks. Here is one example: ==30270== 389,824 bytes in 1 blocks are possibly lost in loss record 8 of 8 ==30270==...

c++ - ffmpeg yadif deinterlacing


c++,ffmpeg
I'm trying deinterlacing video with ffmpeg in my C++ program. First of all, i used avpicture_deinterlacebut is deprecated. Looking for more information, I've tried avfilter_get_by_name("yadif")after avfilter_register_all()but always return NULL. I've tried the next code too, but still not working. I've tried different parameters in avfilter_init_strfunction buterris always less than 0,...

Understanding NASM Macro


assembly,macros,ffmpeg,nasm
I've come around this macro in a assembly source file and I just can't figure out how it's working. So first I come around this function (hevc_deblock.h): cglobal hevc_v_loop_filter_chroma_8, 3, 5, 7, pix, stride, tc, pix0, r3stride sub pixq, 2 lea r3strideq, [3*strideq] mov pix0q, pixq add pixq, r3strideq TRANSPOSE4x8B_LOAD...

How to cut a Video and mute it in one step with FFmpeg?


video,ffmpeg,mute,ffmpeg-php
I tried this: "ffmpeg -i input.mp4 -ss 00:00:50.0 -vcodec copy -an -t 20 output.mp4" Because I know this is for cutting a s "ffmpeg -i input.mp4 -ss 00:00:50.0 -codec copy -t 20 output.mp4" And I know this is for muting (deleting the all the sound from the video): "ffmpeg -i...

how can i get image more than one video in ffmpeg in a loop


vb.net,video,ffmpeg,video-editing
i am writing a simple application for creating thumbnails of multiple video somunteneously .but the problem is the image file namei.e one name so it only save the last video thumbnail in the folder . enter code here For Each fi In aryFi proc.StartInfo.Arguments = " -i " + fi.FullName...

Raw numpy array from real-time network audio stream in Python


python,audio,numpy,ffmpeg,pyaudio
I would like to get raw data (optimally as a numpy array) from a PCM network audio stream for which I have an URL. The goal is to analyze the signal from the network stream in real-time. There seem to be a lot of Python audio modules or wrappers around...

ffmpeg - combine videos into one wide video


video,ffmpeg
I have 3 video of 1920x1080. They are all the same length/codec. I'd like to combine them (not concatenate), so that the result is one video of 5760x1080. Can someone explain to me how to do this in ffmpeg (or another free application)? Thanks!...

Is there a Byte Offset in FFmpeg for source Files?


c++,command-line,ffmpeg,offset
I am working on an C++ Application (running on Ubuntu) that opens FFmpeg for video conversion and reads the output through popen(). This works fine but now i need FFmpeg to start reading the source File at a specific Byte Offset. Is there any way to archive this? I already...

Why can't curl download the ffmpeg-2.7.tar.bz2?


curl,ffmpeg
I'm working on OS X Yosemite 10.10.2. I want to use curl command to download the ffmpeg-2.7.tar.bz2 as following: curl -O http://ffmpeg.org/releases/ffmpeg-2.7.tar.bz2 It can't work. However it works fine with other url. The message as following when add the --verbose option: $ curl --verbose -O http://ffmpeg.org/releases/ffmpeg-2.7.tar.bz2 * Hostname was NOT...

How to trim video in android?


android,video,ffmpeg
I know the same question has been asked so many times, but I am not able to solve my issue. Hi, I tried FFmpeg command for trimming video & it works quite good. I want to trim a video & it works, but the only problem I have is that...

Pipe ffmpeg output to named pipe


linux,ffmpeg,named-pipes
I'm trying to get ffmpegs output to a named pipe, where I could read from another shell. I do not need the video stream piped, just the informations below to get a state of the conversion process back. I am not able to achieve the piping behavior in any way,...

ffmpeg convert any file to any file


linux,ffmpeg,centos,command
I Want simple command to convert any supported file to any file with little possible video compression. for example avi to mp4 mp4 to 3gp . .etc.. I tried below code ffmpeg -i infile.flv outfile.3gp It works for some but for some other like flv to 3gp conversion it throws...

FFmpeg on android is crashing in avcodec_decode_video2 function


android,ffmpeg,mpeg-4
FFmpeg is crashing on: libavcodec/utils.c avcodec_decode_video2 around line 2400 ret = avctx->codec->decode(avctx, picture, got_picture_ptr, &tmp); So I've compiled ffmpeg on android using the following configure script (based from here ): prefix=${src_root}/ffmpeg/android/arm addi_cflags="-marm -Os -fpic" addi_ldflags="" ./configure \ --prefix=${prefix} \ --target-os=linux \ --arch=arm \ --enable-shared \ --disable-doc \ --disable-programs \ --disable-symver...

ffserver - invalid codec name libvpx


ffmpeg,video-streaming,ffserver
I have the following configuration of ffserver.conf: Port 8090 # Port to bind the server to BindAddress 0.0.0.0 MaxHTTPConnections 2000 MaxClients 1000 MaxBandwidth 10000 # Maximum bandwidth per client # set this high enough to exceed stream bitrate CustomLog - NoDaemon # Remove this if you want FFserver to daemonize...

video to audio file convert & save through FFMPEG in node js


javascript,node.js,audio,video,ffmpeg
I am working on an FFMPEG on node js. I'd like to retrieve the audio track from a video file using node js. I would also like to save such file but I can't figure out how. I though this line of code would help me : ffmpeg('/path/to/file.avi').noVideo(); I have...

Downloading youtube mp3 - metadata encoding issue (python, youtube-dl, ffmpeg)


python,encoding,ffmpeg,metadata
I'm trying to download audio from youtube with youtube-dl.exe and ffmpeg.exe (Windows 7), but I am having some troubles with encoding. I have to parse metadata manually, because when I try to use --metadata-from-title "%(artist) - %(title)" --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=DaU94Ld3fuM I get ERROR: Could not interpret title of video...

Incompatible pixel format YUV420P with mjpeg


ffmpeg,multimedia,mjpeg
I am using ffmpeg to make a video from jpeg images using mjpeg codec. I use this command ffmpeg -i frame%d.jpg -c:v mjpeg -pix_fmt yuv420p -q:v 1 -y out.mp4 and I have this warning the yuvj420p was chosen instead. After reading about that pixel format, I found its deprecated to...

ffmpeg recording h264 live stream got error


c,video,ffmpeg,video-streaming,video-capture
I am trying to record a h.264 live stream using the following code: AVOutputFormat* fmt = av_guess_format(NULL, "test.mpeg", NULL); AVFormatContext* oc = avformat_alloc_context(); oc->oformat = fmt; avio_open2(&oc->pb, "test.mpeg", AVIO_FLAG_WRITE, NULL, NULL); AVStream* stream = NULL; ... while(!done) { // Read a frame if(av_read_frame(inputStreamFormatCtx, &packet)<0) return false; if(packet.stream_index==correct_index) { //////////////////////////////////////////////////////////////////////// //...

java processbuilder ffmpeg pipe


java,ffmpeg,pipe,processbuilder
i try to run ffmpeg out java. here my code: String[] temp = {"ffmpeg\\ffmpeg.exe","-i","input_track.ac3","-threads","0","-af","volume=volume="0.0"dB","-acodec","pcm_s32le","-ac","6","-ar","48000","-f","wav","-","|","ffmpeg\\fdkaac","--ignorelength","-m","1","-o","ouput_track.aac","-"}; ProcessBuilder pb = new ProcessBuilder(temp); Process p = pb.start(); int ev = 0; if (p.waitFor() != 0) { ev = p.exitValue(); } i try the comand at windows cmd, here have a problem with "|" at...

How to use a Pipe between two processes in Process.Start


vb.net,ffmpeg,pipeline,video-encoding
I have to run this command line using VB.NET: "H:\videotest\test.vpy" - -y | "H:\Release\data\bin64\ffmpeg.exe" -hwaccel auto -y -i - -map 0:v:0 -c:v libx265 -crf 20.0 -preset 5 -x265-params...

Decode/decompress H.264 back into raw/original file format, then encode into H.265


ffmpeg,h.264,h.265
I have some files encoded using the H.264 codec. There is a loss of quality when I convert them from H.264 to H.265. I imagine I should convert them back to raw/original file format, then encode them into H.265. Is it possible to decompress/decode H.264 into the original format (perhaps...

Error with os.system in python script


python,ffmpeg,os.system
I am creating a python script that will convert files using ffmpeg and unoconv. However when I run the program, rather than getting a converted file the program simply displays the text: sh: 1: unoconv -f: not found Here is the script for my program: path = raw_input("Please drag and...

ffmpeg problems (mpeg1video -> ?)


java,ffmpeg
I'm trying to convert various video files from .mpeg to .ogg theora videos. This command works fine when I test it in its own program, but fails to run properly inside the program it was intended for. I don't understand what's breaking here. Adding a -vcodec flag causes other errors....

How to split a video into individual encoded frames?


ffmpeg
Source video is H264 in an mp4 container, I'm trying to split it into individual encoded frames. I tried with the following command line: ffmpeg -i "input.mp4" -f image2 "%d.h264" But that creates jpegs with the extension "h264", rather than actual H.264 frames....

Redirect shell output for ruby script


ruby-on-rails,ruby,shell,ffmpeg
I have simple ruby script : #! /usr/bin/env ruby require 'fileutils' FileUtils.rm "output.mkv" if File.exists?("outp ut.mkv") pid = Process.spawn("ffmpeg -i wrong_file.mp4 -c:v libx264 -preset veryslow -qp 0 output.mkv", STDOUT => "output.txt", STDERR => "error.txt") puts "pid : #{pid}" Process.wait(pid) But, STDOUT and STDERR outputs into error.txt, why ? It looks,...

Infinite stream from a video file (in a loop)


video,ffmpeg,video-streaming,avconv
Is there any way howto create an infinite h264 stream from a video file (eg. mp4, avi, ...). I'd like to use ffmpeg to transcode avi file to h264 but there's no loop option for output.

Why is packet.pts != frame->pkt_pts in AVFrame?


ffmpeg
Trying to understand some audio/video sync issues via ffmpeg, I noticed the following. Running this code while (av_read_frame(formatCtx, &packet) >= 0) { if (packet.stream_index == videoStream) { avcodec_decode_video2(videoCodecCtx, frame, &got_frame, &packet); } printf("packet.pts = %d\n", packet.pts); printf("frame->pkt_pts", frame->pkt_pts); } shows that frame->pkt_pts in general differs from packet.pts, despite the documentation...

ffmepg video from uneven sequence of png images


video,ffmpeg,screencast
I'm going to make a video from series of screenshots (.png files). For each screenshot there is assosiated timestamp information about when it was taken. The time intervals between screenshots may vary and it's highly desired to preserve that difference in the video. Is there a way to use single...

FFMPEG I/O output buffer


c++,c,ffmpeg
I'm currently having issues trying to encapsulate raw H264 nal packets into a mp4 container. Instead of writing them to disk however, I want to have the result stored in memory. I followed this approach Raw H264 frames in mpegts container using libavcodec but haven't been successful so far. First,...

Stacking 3 gmp4-files using Avisynth and VirtualDub, results in wrong colors and distorted files


video,ffmpeg,avisynth,virtualdub
I need to conduct the seemingly simple task of stacking 3 files next to each other. They are all the same: .avi Container, 320x240, 4:3, 25 fps, GeoVision Advanced MPEG-4 GEO codec. I installed the GeoVision codec (http://www.geovision.com.tw/english/5_8.asp# - select "other utilities"), so my system (windows media player, media player...