Getting lossless images from mjpeg

23 ビュー (過去 30 日間)
Varsha Nataraj
Varsha Nataraj 2019 年 1 月 16 日
コメント済み: Varsha Nataraj 2019 年 1 月 31 日
I am learning with video to image conversion and vice versa.
I had a mjpeg of 3 sec, when i converted to jpeg images i got 55 images.
then i used all 55 images to make a mjpeg video but the video is not of 3 sec anymore
Please tell me correct way of video to image conversion and vice versa. i am not getting where i am going wrong.

採用された回答

Varsha Nataraj
Varsha Nataraj 2019 年 1 月 30 日
hello iqra,
i am very sorry for not replying so long.
i cleared my issue after refering to this link below
go through this
hope it helps
  2 件のコメント
Iqra Saleem
Iqra Saleem 2019 年 1 月 30 日
Can you tell me from where you get motion jpeg video.
I tried to convert using Oxelon media Converter but that .mjpg video is not playing in matlab.
Varsha Nataraj
Varsha Nataraj 2019 年 1 月 31 日
it will be in .avi format

サインインしてコメントする。

その他の回答 (2 件)

Walter Roberson
Walter Roberson 2019 年 1 月 16 日
It is impossible to get lossless images from Motion JPEG. mjpeg inherently uses lossy jpeg compression .
However it sounds to me as if you did not tell the video writer that the frame rate should be 55/3 frames per second. (I suspect your real frame rate is either 18 or 20 fps and that 3 seconds is an approximation )

Iqra Saleem
Iqra Saleem 2019 年 1 月 27 日
Hey;
Varsha Natraj , can you tell me please how you convert motion jpeg to jpeg images?
  6 件のコメント
Iqra Saleem
Iqra Saleem 2019 年 1 月 30 日
My matlab code is :
clc
close all
clear all
info = mmfileinfo('akiyo_CIF.mjpg');
xyloObj = VideoReader('akiyo_CIF.mjpg');
get(xyloObj)
nFrames = xyloObj.NumberOfFrames;
vidHeight = xyloObj.Height;
vidWidth = xyloObj.Width;
% Preallocate movie structure.
mov(1:nFrames) = ...
struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),...
'colormap', []);
% Read one frame at a time.
for k = 1 : 3
mov(k).cdata = read(xyloObj, k);
end
% Size a figure based on the video's width and height.
hf = figure;
set(hf, 'position', [150 150 vidWidth vidHeight])
% Play back the movie once at the video's frame rate.
movie(hf, mov, 1, xyloObj.FrameRate);
Walter Roberson
Walter Roberson 2019 年 1 月 30 日
Except possibly on Linux, .mpeg or .mjpg is not a supported video format. Motion JPEG is supported inside of .avi

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by