.M2P file extention to image file extension, image processing - image

I have a .m2p file (which is an image file i believe that contains many images, kinda like a video of still images) that I would like to convert to any image file (preferably .png or .jpg).
Does anyone know if there is a possible way to do so?
Does anyone know how to convert these, using a script, to a different file extension essentially. Extract out all the images from a .m2p file?
Any help would be appreciated.

Figured out the answer to this.
Can simply just use ffmpeg (for Mac atleast).
Images:
To grab a still from a certain time:
ffmpeg -i video.m2p -ss 00:00:07.000 -vframes 1 thumb.png
Videos:
To convert m2p to mp4
ffmpeg -i example.m2p -f mp4 -vcodec libx264 -preset slow -profile:v main -acodec aac example.mp4 -hide_banner
Random: I used the slow preset just so it outputs a better quality video

Related

Different brightness merging multiple BMP files into MP4 using ffmpeg

I want to edit a small video frame/image by image without losing quality (or without losing much of it). I have used ffmpeg to split into images using the following line:
ffmpeg -i test.mp4 $filename%%03d.bmp
This worked fine. I tried merging the images back using several lines including:
ffmpeg -re -f image2 -framerate 30 -i $filename%%03d.bmp -c:v prores_aw -pix_fmt yuv422p10le test.mkv
Though, this results in a difference between brightness/contast between original and merged videos. The merged file would be a bit darker (you have to look close) than original file. What can I do to fix this?
Thanks for your time.

Using ffmpeg to convert an SEC file

I need to convert an SEC file into any video format that I can share and/or upload to Youtube. MP4, etc.
I'm a complete newbie at all things terminal. I've tried:
ffmpeg -i video.sec video.mp4
ffmpeg -i video.sec -bsf:v h264_mp4toannexb -c:v copy video.avi
ffmpeg -i video.sec -b 256k -vcodec h264 -acodec aac video.mp4
I don't understand what any of these mean, they're just examples I found online. However, whatever I try returns this error:
Invalid data found when processing input
Any thoughts? Thanks!
I had to add the following option so it would skip the SEC's custom header.
-skip_initial_bytes 48
i know this is old, but i was trying to figure this out as well, what ended up finally working for me was this command.
./ffmpeg -f h264 -i INPUT.sec -filter:v "setpts=4*PTS" OUTPUT.avi
the -f h264 was the part i was missing. and the -filter:v "setpts=4*PTS" part is to slow it back down to the original speed. you can also change the .avi at the end to whichever format works best for you.
i hope this helps someone out :)
OK, just to clear up some recent threads…
The Samsung DVR used here was an SRD-440. RB kindly sent me a file to test and he sent me a .BU file with an associated .db2 file. This was a bit of a surprise as in all older Samsung DVR’s, the .bu files can only be played back in the DVR. I mentioned this here, https://spreadys.wordpress.com/2014/07/21/ifsec-samsung-exports/
It appears that Samsung have caught on, and the BU file is now playable due to it being a H264/AVC Stream conforming to a standard profile. I have updated the IFSEC Post mentioned above to highlight this change.
Back to RB’s stream and the challenge was to get these files viewable in WMV format. They were all field based, at 704×288.
The speed of playback is controlled by the Samsung software, using the .db2 file. As such, the metadata and timing information in the video stream was wrong. This caused speed issues and then quality issues when attempting to correct this.
As a result, I found it necessary to force an input rate and generate a new Presentation Time Stamp BEFORE the input file.
The following FFmpeg string did the job…
ffmpeg -r 12 -fflags genpts -i FILE.bu -vf scale=704:528 -sws_flags lanczos -q:v 2 FILE.wmv
Remember, this is for preview – analysis would be completed differently due to the scaling, the interpolation method, and the WMV compression!
As its likely that RB may have quite a few .bu files in a folder, I placed this into a batch file to transcode the whole lot within a few minutes… more on batch files coming in a new post soon!
https://spreadys.wordpress.com/2014/07/21/ifsec-samsung-exports/
or
ffmpeg -i (name of file).sec (name of final file).mp4
ffmpeg -i (name of file).sec -filter:v "setpts=3.3*PTS" (name of final_file).mp4

Change video file container to mp4

I have learned through Google, that to change video containers without losing quality I can run the following command:
ffmpeg -i videofile.mkv -codec copy videofile.mp4
This has worked great for a number of video files I have. However, I am having an issue with three of them (1 mkv file and 2 avi files). When I run that command against them, the video is there, but there is no sound. There is sound in the original video file.
Any ideas how to put the video in a new container while retaining the audio track?
Thanks. Brian
The .mp4 container is not compatible with the audio codecs of the problem files. This should be evident from the logs. So the audio channels of the problem files have to be transcoded to something allowed in .mp4, eg. aac:
ffmpeg -i videofile.mkv -c:v copy -c:a aac videofile.mp4
Maybe the container mp4 it doesn’t compatible whith codec of your input video mkv and avi
By the way, you can try
ffmpeg -i videofile.mkv -c:v copy -c:a copy videofile.mp4
Check this documentation.
https://en.m.wikipedia.org/wiki/Comparison_of_video_codecs
https://trac.ffmpeg.org/wiki/Map

MP4 Videos are playing only after fully loaded on Jwplayer [duplicate]

This question already has answers here:
Post processing in ffmpeg to move 'moov atom' in MP4 files (qt-faststart)
(3 answers)
Closed 4 years ago.
Hi recently I am converted some videos to MP4 using FFMpeg but When I am trying to stream this video files, player needs to load a file completely, until it starts to play, I am trying to find a way to make it start play a file right from the start and keep on loading as well.
I am using this FFMpeg command for conversion:
ffmpeg -i input.mp4 -vcodec libx264 -vpre default -crf 28 -ac 1 -ar 44100 -b 284k -ab 70k -r 15 -s 640x360 output.mp4 2>&1
This is happening because mp4 format has its moov info at the tail of the file. The information is required for flash players before the file can be progressively download and play. Therefore if the info is in the end of file, it has to be fully downloaded, which is terrible, user-experience-wise.
From your answer you can compile a separate tool provided in ffmpeg - qt-faststart to post-process the mp4 file and then use the mp4 file for video streaming.
Specially, you can download a copy of source code for ffmpeg, and go to tools folder and run:
make qt-faststart
then you will have a tool named qt-faststart in tools directory. Then you can run:
qt-faststart input.mp4 output.mp4
and put output.mp4 to your streaming folder and the new mp4 file will be progressively downloaded while playing.
Alternatively another option is to do this during transcoding time as suggested in previous answers, but the command line is provided wrong, it should be:
-movflags +faststart
in your ffmpeg command line. It will do the same thing as you transcode.
So there are your two easiest solution to this, hope the best of luck!
For streaming, the moov atom needs to be at the beginning of the file, rather than the end. For ffmpeg, try adding:
-movflags faststart
You can always test with this tool - http://renaun.com/blog/2010/06/qtindexswapper-2/

How to transcode video formats

We're converting a bunch of .RM files to .MP4 and wondered what the best way is. Here are the details:
Convert the files to H.264.
Keep the filename but add .mp4 to the end.
Also extract a JPG image of the video at about 5 seconds in for each file and name it the original filename + .jpg.
This is on a Windows system. Is there a free tool you recommend for this? Thank you.
ffmpeg is pretty much the defacto standard app for transcoding video.
http://www.ffmpeg.org/
Convert to h264/mp4:
ffmpeg.exe -i inputFile.rm -vcodec libx264 -s 320x240 -acodec libfaac outputFile.mp4

Resources