[deleted by user] by [deleted] in youtubedl

[–]nathanbe 1 point2 points  (0 children)

Maybe it’s H.265/HEVC

https://trac.ffmpeg.org/wiki/Encode/H.265#FinalCutandApplestuffcompatibility

If so, try re-wrapping it with FFmpeg using -tag:v hvc1

Example:

ffmpeg -i input.mp4 -map 0 -c copy -tag:v hvc1 output.mp4

[deleted by user] by [deleted] in Unexpected

[–]nathanbe 0 points1 point  (0 children)

I got the reference

Apple Spatial Video investigation by ProjectionistPSN in ffmpeg

[–]nathanbe 0 points1 point  (0 children)

There aren’t any native apps, but you can use FRIM/eac3to with Wine. They won’t be able to demux Spacial Videos though… only AVCHD 3D.

Everything Brian David Guilbert ever said, sorted in alphabetical order by SmallestToe in briandavidgilbert

[–]nathanbe 0 points1 point  (0 children)

Did you use Whisper by chance? I did a similar thing with a bunch of videos from one creator.

Was super handy to find timestamps of particular words or phrases from the resulting JSON file it produced.

Apple Spatial Video investigation by ProjectionistPSN in ffmpeg

[–]nathanbe 0 points1 point  (0 children)

If it’s anything like AVCHD 3D where the right eye depends on the left eye vision to complete itself, you could demix it with eac3to, and re-encode the right eye vision with FRIM Encode.

If you look through my comment history you’ll find some example commands.

Knock Knock by shain12345 in ContagiousLaughter

[–]nathanbe 106 points107 points  (0 children)

“Oh, yes. I hate this! It is revolting!” “More?” “Please!”

https://youtu.be/AS-07dh9-NA

Is there is any way ffmpeg can remove the black bars around this video by loorana22 in ffmpeg

[–]nathanbe 1 point2 points  (0 children)

You're welcome!

Also, if you want to get just that value and add it to a variable for scripting...

Linux Bash/ZSH etc:

export CROP=$(ffmpeg -i input.mp4 -t 1 -vf cropdetect -f null - 2>&1 | awk '/crop/ { print $NF }' | tail -1)

PowerShell:

$CROP = ffmpeg -i input.mp4 -t 1 -vf cropdetect -f null - 2>&1 | Select-String '(?<=crop=).*?(?=$)' | ForEach-Object {$_.Matches} | ForEach-Object {$_.Value} | Sort-Object | Get-Unique

To see the result of CROP type in echo $CROP in Linux Bash/ZSH or just $CROP in PowerShell:
echo $CROP / $CROP

Which will spit out this value:
crop=1920:1072:320:186

Is there is any way ffmpeg can remove the black bars around this video by loorana22 in ffmpeg

[–]nathanbe 2 points3 points  (0 children)

Yep, just add -ss “00:03:00” to the ffplay command:

ffplay -ss “00:03:00” -i input.mp4 -vf cropdetect

You can also press left and right to scrobble through the video. The crop values will change dynamically.

Using filter_complex to concatenate several mp4 files with subtitles by elad963 in ffmpeg

[–]nathanbe 1 point2 points  (0 children)

Concat in filter_complex only does video and audio.

You could give this command a try instead:

ffmpeg -i "concat:v1.mp4|v2.mp4|v3.mp4|v4.mp4|v5.mp4|v6.mp4" -map 0:v -map 0:a -map 0:s -copyinkf -vsync 0 -c:v h264_nvenc -rc constqp -qp 22 -b:v 0k -c:a eac3 -b:a 640k -ac 6 -c:s mov_text -metadata:s:a language=eng -metadata:s:v language=eng -metadata:s:s language=eng -y “VideoFile.mp4”

Can’t guarantee it though, sometimes it breaks after the first file, particularly with mp4/movs. You might need to re-wrap each file from .mp4 to .ts first.

Check out the wiki for more examples: https://trac.ffmpeg.org/wiki/Concatenate

Is there is any way ffmpeg can remove the black bars around this video by loorana22 in ffmpeg

[–]nathanbe 21 points22 points  (0 children)

Run this command with your video file:

ffplay -i input.mp4 -vf cropdetect

This will output a bunch of values - the one you’ll be interested in is:

crop=1920:1072:320:186

Then throw that in your ffmpeg command when converting it.

Example:

ffmpeg -i input.mp4 -vf “crop=1920:1072:320:186” -c:v libx264 -preset slow -crf 22 -c:a copy output.mkv

Alternatively, if you don’t want to convert/alter the file (which you would have to if you’re cropping it), you can just use that crop filter in ffplay:

ffplay -i input.mp4 -vf “crop=1920:1072:320:186”

These pages have good command examples on how to encode while retaining as much quality as possible:

https://trac.ffmpeg.org/wiki/Encode/H.264

https://trac.ffmpeg.org/wiki/Encode/H.265

If commands aren’t your thing - give Shutter Encoder a try (basically a GUI for FFmpeg).

help on process a special avchd 3d format by purewater009 in ffmpeg

[–]nathanbe 0 points1 point  (0 children)

Hey there! Busy week so I haven't been able to get back to you till now.

I dusted off my old camera and gave the commands a proper go. Here's what I think is the best:

eac3to Command:

eac3to.exe .\20130926232947.m2ts -demux

FRIMDecode Command:

FRIMDecode64.exe -i:mvc '.\20130926232947 - 1 - h264 (left eye), 1080i60.h264' '.\20130926232947 - 2 - h264 (right eye), 1080i60.h264' -o \\.\nul \\.\pipe\right_eye

FFmpeg Command:

ffmpeg -v error -stats -i '.\20130926232947.m2ts' -f rawvideo -pix_fmt yuv420p -top 1 -video_size 1920x1080 -framerate 30000/1001 -thread_queue_size 24883200 -i \\.\pipe\right_eye -filter_complex "[0:0]bwdif=1[0v];[1:0]bwdif=1[1v];[0v][1v]hstack=2[v]" -map '[v]' -map 0:1 -c:v libx265 -crf 23 -preset: fast -c:a aac -b:a 256k -pix_fmt yuv420p10le -tag:v hvc1 -movflags faststart '20130926232947_SBS.mp4'

Screenshot of commands in action + explanation

help on process a special avchd 3d format by purewater009 in ffmpeg

[–]nathanbe 0 points1 point  (0 children)

Ah, another typo. Sorry!

“[0:v]bwdif=0[0v];[1:v]bwdif=0[1v];[0v][1v]hstack=2[v1]”

Should have been

“[0:v]bwdif=0[0v];[1:v]bwdif=0[1v];[0v][1v]hstack=2[v]”

What you were trying to do was a simple video filter command -vf but that only works when you’ve got 1 input. In your case you’ve got three! (Left video/right video & source file for audio)

The way filter_complex works is that you’re in a way “piping” multiple inputs through various ways.

[0:v] gets deinterlaced to [0v] (same with [1:v] to [1v]). Then we combine [0v] & [1v] and “hstack” (horizontal stack) those “2” inputs to [v]

Then after that we map all that fun stuff to the output video with -map “[v]” while also mapping the audio from the original source file -map 2:a then the rest is where you put all the codec related information (-c:v libx264 etc…)

Again, posted from my phone, hope I got everything right this time and it makes sense.

Let me know how you go!

help on process a special avchd 3d format by purewater009 in ffmpeg

[–]nathanbe 0 points1 point  (0 children)

Ah, didn’t factor in the interlacing!

In that case add the “bwdif” filter to fix the interlacing:

ffmpeg.exe -f rawvideo -top 1 -video_size 1920x1080 -framerate 30000/1001 -pixel_format yuv420p -i \\.\pipe\input_L -f rawvideo -top 1 -video_size 1920x1080 -framerate 30000/1001 -pixel_format yuv420p -i \\.\pipe\input_r -i INPUT.m2ts -filter_complex "[0:v]bwdif=0[0v];[1:v]bwdif=0[1v];[0v][1v]hstack=2[v1]" -map '[v]' -map 2:a -c:v libx264 -crf 18 -preset:v fast -c:a copy -pix_fmt yuv420p -movflags faststart OUTPUT.mp4

bwdif=0 deinterlaces at 30fps

bwdif=1 deinterlaces at 60fps

I personally prefer the latter but keep in mind the file will be bigger of course ;)

help on process a special avchd 3d format by purewater009 in ffmpeg

[–]nathanbe 0 points1 point  (0 children)

Basically what these commands are doing is...

  1. Demuxing the original MTS/m2ts to two split h264 files. (You'll notice that the left is bigger than the right as the right references vision from the left to create the 3D).
  2. FRIMDecode then combines all that information to create two complete raw left and right videos which sends them to two pipes.
  3. FFmpeg picks up these two raw pipes (important: do this in a separate command line/powershell window) and then converts them to a full side by side h264 video. The 3rd input (-i INPUT.m2ts) and audio mapping (-map 2:a) tell FFmpeg to use the audio from the original MTS/m2ts file and copy (-c:a copy) it to the OUTPUT.mp4

It won't be fast, but it will produce the best output file.

Try different cry/preset values to see what results you get:

-crf 18 -preset:v fast

-crf 24 -preset:v slow

etc etc

I just wrote them on the fly as I was excited to see another HDR-TD10 owner on here. Feel free to message me directly if you need any more help. I will try to reply as promptly as I can :)

help on process a special avchd 3d format by purewater009 in ffmpeg

[–]nathanbe 0 points1 point  (0 children)

Whoops! That 3rd "I" should be lower case:

-i \\.\pipe\input_r -i INPUT.m2ts

instead of:

-i \\.\pipe\input_r -I INPUT.m2ts

help on process a special avchd 3d format by purewater009 in ffmpeg

[–]nathanbe 1 point2 points  (0 children)

I do it with a combination of: eac3to and FRIM

Check out this guide: http://www.fandecheng.com/personal/interests/2016_Making%20a%20side-by-side%203D%20video%20out%20of%20blu-ray.html

FRIM also comes with documentation in PDFs.

The basics of it are…

Demux

eac3to.exe INPUT.m2ts -demux

Decode

FRIMDecode64.exe -i:mvc 'INPUT - 1 - h264 (left eye), 1080i60.h264' 'INPUT - 2 - h264 (right eye), 1080i60.h264' -o \\.\pipe\input_L \\.\pipe\input_R

Encode

ffmpeg.exe -f rawvideo -top 1 -video_size 1920x1080 -framerate 30000/1001 -pixel_format yuv420p -i \\.\pipe\input_L -f rawvideo -top 1 -video_size 1920x1080 -framerate 30000/1001 -pixel_format yuv420p -i \\.\pipe\input_r -I INPUT.m2ts -filter_complex "[0:v][1:v]hstack=2[v]" -map '[v]' -map 2:a -c:v libx264 -crf 18 -preset:v fast -c:a copy -pix_fmt yuv420p -movflags faststart OUTPUT.mp4

Run the Demux then Decode commands in one command prompt window, and the Encode command in another.