Niek / superview

A small program that takes a 4:3 aspect ratio video file, and transforms it to a 16:9 video using the GoPro SuperView method
GNU General Public License v3.0
213 stars 21 forks source link

Small fix for (new) Runcam 5 Orange Camera to work with superview #6

Closed dangr0 closed 4 years ago

dangr0 commented 4 years ago

superview.go.txt

Description: When running Superview.exe with an Runcam 5 Orange mp4 file as source, the program just exits/crashes with "exit code 1".

Analysis: When starting ffmpeg like superview does, the following error is printed:

[mp4 @ 000001a3a6666bc0] Could not find tag for codec pcm_s16le in stream #1, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
Conversion failed!

Probable cause/solution: It seems Runcam 5 Orange uses an audio codec that is not supported for MP4-ouput in ffmpeg. In superview.go line 116 commenting out the following parameters in the ffmpeg command-call fixes the issue for me: "-c:a", "copy", As I understand this, omitting the parameter lets ffmpeg choose the best fitting audio-codec by itself.

I attached version 0.3 with the "fix" included.

Niek commented 4 years ago

Do you have a small sample (can be just a few seconds) of the RC5 Orange video so I can check? I can leave out the audio copy flag, but I think that always forces the audio to be re-encoded (which is not ideal).

dangr0 commented 4 years ago

Hey, I attached a short raw example clip wrapped in a ZIP file where I knocked on the camera for some noise, so you can also verify that sound doesnt get lost after processing the file :) RC_0002_2003021037.zip

Niek commented 4 years ago

Thanks for providing the video!

Very weird that the RC5 Orange encodes the audio in PCM instead of AAC. I did some tests with -c:a copy vs -c:a aac, but if the source video is already in AAC format those are identical (no re-encode is taken place). So it's safe to enforce AAC for audio output, I'll commit the change now. Thanks for the help!

Niek commented 4 years ago

@all-contributors please add @dangr0 for bug reports

allcontributors[bot] commented 4 years ago

@Niek

I've put up a pull request to add @dangr0! :tada: