Page 1 of 1

Video Editing

Posted: Thu May 24, 2018 1:03 pm
by mikemyers
Is it possible to edit the .h264 videos from the Raspberry Pi, using Apple's Final Cut Pro editor?

It doesn't recognize the file.

I can convert the file to another format, but that will reduce quality.

Re: Video Editing

Posted: Fri May 25, 2018 4:56 am
by ghans
You have to use a muxer like MP4Box after you've finished
recording to create "proper" .mp4 files from raw .h264.

Code: Select all

sudo apt-get install gpac
MP4Box  -fps 30  -add infile.h264 outfile.mp4
Muxing will not decrease quality, it is a distinct process from encoding video.


Re: Video Editing

Posted: Fri May 25, 2018 7:01 am
by mikemyers
Thank you - I have passed this on to the people doing the programming.

I'm not sure how it was done, but the Raspberry Pi video I saw four months ago, looking at MP4 files, did not have the same quality as looking at the .h264 files, both in VLC video player.

Is there an editor, or a codec, which would allow the .h264 video to be edited directly?

Re: Video Editing

Posted: Fri May 25, 2018 8:10 am
by Z80 Refugee
mikemyers wrote:
Fri May 25, 2018 7:01 am
Is there an editor, or a codec, which would allow the .h264 video to be edited directly?
It depends what you mean by "edit".

Video encoding relies on the concept of I (intra) frames and P (predicted) frames. I frames stand alone, while P frames use the I frames to reduce the amount of data necessary to reconstruct the P frame. I frames occur roughly once a second, but this can vary hugely according to video content ("busy" video needs more frequent I frames). There may also be B frames (bidirectional prediction), but I won't go into those.

If all you want to do is cut and splice, as long as your cut points are exactly at an I frame, the encoded video can be spliced without decoding it (and therefore without loss of quality due to decoding and re-encoding).

If you want to alter the picture in any way (eg zoom or pan), you will need to work on the fully decoded video data. If you want to cut at a point between I frames (or cannot control the cut point), the local GOP (group of pictures - ie the I frame and successive P frames until the next I frame) will need to be decoded and re-encoded to create a new I frame at the cut point.

VideoReDo is an editor which can make intelligent decisions about the need to decode and re-encode.

The quality of the output after re-encoding is highly dependent on the time spent processing it. Higher quality settings require much more intensive processing with a longer processing time. Depending on the power of your PC (and any hardware video encoding acceleration), you may have encoder settings which are a compromise between quality and processing time. You could look for the settings and set for higher quality encoding, but be prepared to wait.

Re: Video Editing

Posted: Fri May 25, 2018 9:25 am
by mikemyers
Hmm, you bring up more new questions, than answering the original question, which is much appreciated.

First - format - I used to like to capture video in AVI non-compressed format, so I could cut and splice anywhere without causing problems. I had no idea which "frame" I was at, just a moment in time. Based on what you wrote, how does one know the appropriate frame at which to cut the video, if the video is in a compressed format? What is the modern day equivalent of "uncompressed AVI"?

Second - editing - it makes perfect sense that when the editor is manipulating the data from the video, it takes more time to do the best job. What's new to me, is I didn't realize I had any control over this. One more thing I need to search out on the internet.

I use Final Cut Pro, Movavi, and used to use Pinnacle. I also work with Camtasia. Do all of these have settings for quality vs time ?


Re: Video Editing

Posted: Fri May 25, 2018 9:38 am
by Z80 Refugee
No idea. I'm just pointing you in the right direction.