Re: [FFmpeg-user] Can ffmpeg convert these mp4 to that mp4?

2019-11-05 Thread Carl Eugen Hoyos
Am Do., 31. Okt. 2019 um 02:05 Uhr schrieb Ted Park :
>
> > Only if you also change the audio speed.
> >
> > The simpler solution is to force an output framerate instead of an
> > input video speed.

> Simpler maybe… but wouldn’t this result in a frame literally being dropped 
> anytime the drop frame timecode "skips”?

Of course, this can in general not be avoided.
(There are filters that create intermediate pictures but they
take a lot of cpu time)

> And maybe async option could fix the synch issues or through resampler.

Yes, but I don't think this is in general seen as a good solution.

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] splitting and concatenating file results in a different file

2019-11-05 Thread Carl Eugen Hoyos
Am Do., 31. Okt. 2019 um 19:15 Uhr schrieb Jon Beyer :

> ffmpeg -i concat.mp4 video2/frames_%05d.jpg
>
> ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers

Unrelated:
Please understand that only current FFmpeg git head is supported here
and that there is absolutely no release support for macos.

>   built with Apple clang version 11.0.0 (clang-1100.0.33.8)
>   configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.1_1 --enable-shared
> --enable-pthreads --enable-version3 --enable-avresample --cc=clang
> --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include
> -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include/darwin
> -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls
> --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame
> --enable-libopus --enable-librubberband --enable-libsnappy
> --enable-libtesseract --enable-libtheora --enable-libvidstab
> --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265
> --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype
> --enable-frei0r --enable-libass --enable-libopencore-amrnb
> --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp
> --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack
> --disable-indev=jack
>   libavutil  56. 31.100 / 56. 31.100
>   libavcodec 58. 54.100 / 58. 54.100
>   libavformat58. 29.100 / 58. 29.100
>   libavdevice58.  8.100 / 58.  8.100
>   libavfilter 7. 57.100 /  7. 57.100
>   libavresample   4.  0.  0 /  4.  0.  0
>   libswscale  5.  5.100 /  5.  5.100
>   libswresample   3.  5.100 /  3.  5.100
>   libpostproc55.  5.100 / 55.  5.100
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'concat.mp4':
>   Metadata:
> major_brand : isom
> minor_version   : 512
> compatible_brands: isomiso2avc1mp41
> encoder : Lavf58.29.100
>   Duration: 00:02:15.94, start: 0.00, bitrate: 5037 kb/s
> Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
> 1280x720 [SAR 1:1 DAR 16:9], 4903 kb/s, 29.98 fps, 30 tbr, 15360 tbn, 60
> tbc (default)
> Metadata:
>   handler_name: VideoHandler
> Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
> stereo, fltp, 128 kb/s (default)
> Metadata:
>   handler_name: SoundHandler
> Stream mapping:
>   Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
> Press [q] to stop, [?] for help
> [swscaler @ 0x10ecd7000] deprecated pixel format used, make sure you did
> set range correctly
> Output #0, image2, to 'video2/frames_%05d.jpg':
>   Metadata:
> major_brand : isom
> minor_version   : 512
> compatible_brands: isomiso2avc1mp41
> encoder : Lavf58.29.100
> Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 1280x720 [SAR 1:1 DAR
> 16:9], q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default)
> Metadata:
>   handler_name: VideoHandler
>   encoder : Lavc58.54.100 mjpeg
> Side data:
>   cpb: bitrate max/min/avg: 0/0/20 buffer size: 0 vbv_delay: -1

> frame= 4076 fps= 73 q=24.8 Lsize=N/A time=00:02:15.86 bitrate=N/A dup=3
> drop=0 speed=2.44x

This indicates three frames were duplicated.

> video:97160kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
> muxing overhead: unknown

You can avoid the duplication with -vsync 0 at the cost of likely A/V desync.

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Reducing video file size

2019-11-05 Thread Ted Park
> There are different sources, with varying existing encodings, and
> resolutions. So those numbers were just thrown out there.
> 
> How about 100KB per 10 seconds, or 1MB per minute? What's possible to
> squeeze in, or out there?

I really couldn’t say without knowing anything about the sources.

And regarding my comment about the numbers, I actually meant the units you 
used… (KB/10s?? MB/min?? I’ll admit I had to plug it into a calculator to get 
kbps lol)

If you have some samples I could throw it into a compressor queue and see what 
it looks like when it’s done (shouldn’t be to far off from the libs ffmpeg 
uses) but considering those bitrates are similar to halfway decent mp3 files 
ripped of cd’s iirc I would expect the quality to be somewhere between just 
barely tolerable and fubar.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Hello, I want to ask about sending very long argument into ffmpeg command line.

2019-11-05 Thread Ted Park
> I have to split one video into large amount(usually more than 1000) of 
> segments and reassemble segments into one video. 
> Suppose I try split only, then command will be like
> 
> ffmpeg -i input.mp4 -vcodec copy -acodec copy -ss 00:00:00 -t 00:01:00 -sn 
> test_split001.mp4 -vcodec copy -acodec copy -ss 00:01:00 -t 00:02:00 -sn 
> test_split002.mp4 -vcodec copy -acodec copy -ss 00:02:00 -t 00:13:50 -sn 
> test_split003.mp4 -vcodec copy -acodec copy -ss 00:13:50 -t 00:19:27 -sn 
> test_split004.mp4 ...
> Currently I am sending just one command per extraction to the kernel, because 
> kernel doesn't accept if given command is too long. 
> Since I am making too many segments, efficiency is way too low.
> 
> This is why I asked you about modifying main(generating command arguments 
> inside of main function). Did my answer cleared your question?

Oh okay, in that case, have a look at the segment muxer and concat "demuxer". 
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] ffmpeg hwmap SW decoded frame to OpenCL and hwmap back to h264 for SW encode

2019-11-05 Thread Ted Park
>  But got error: "Segmentation fault: 11", so may be I'm doing something wrong?

Yeah a segfault should make you take a step back and look at what your doing 
for sure.

> I trying speed up process and avoid copy frames between GPU and CPU.

Probably the only way to do this is to get rid of all the hw acceleration in 
your command, it’s gotta be converted at some point right?
Actually is “HD Graphics 4000” an intel or ati card, is it just me that feels 
like it could be either

But anyhow, 

> ./ffmpeg -i ../720.mp4 ...

That isn't going to decode in hardware. And idk without trace, but I’m guessing 
the kernel did not like it at all when you rw mapped the decoded frames and 
something else (seemingly out of the blue random for all it knows) started 
messing with it, and it said no you can’t do that. Even if it is integrated 
graphics and shares main memory, I’d think the filter would be a separate 
process and it’d be considered “not safe"

> Matched encoder 'libx264' for codec 'h264'.
> [file @ 0x7fbb1ec44680] Setting default whitelist 'file,crypto'
> Successfully opened the file.
> detected 8 logical cores
> [h264 @ 0x7fbb1f9a9800] nal_unit_type: 7(SPS), nal_ref_idc: 1
> [h264 @ 0x7fbb1f9a9800] nal_unit_type: 8(PPS), nal_ref_idc: 1
> Stream mapping:
>   Stream #0:0 (h264) -> hwmap
>   hwmap -> Stream #0:0 (libx264)

…

> [graph 0 input from stream 0:0 @ 0x7fbb1ee09040] w:1280 h:720 pixfmt:yuv420p 
> tb:1/3 fr:3/1001 sar:1/1 sws_param:flags=2
> [format @ 0x7fbb1ed0a080] Setting 'pix_fmts' to value 
> 'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16|nv21|yuv420p10le|yuv422p10le|yuv444p10le|nv20le'
> [AVFilterGraph @ 0x7fbb21004240] query_formats: 7 queried, 6 merged, 0 
> already done, 0 delayed
> [Parsed_hwmap_2 @ 0x7fbb1ed03e00] picking yuv420p out of 13 ref:opencl alpha:1
> [Parsed_hwmap_0 @ 0x7fbb1ed09940] Configure hwmap yuv420p -> opencl.
> [Parsed_hwmap_2 @ 0x7fbb1ed03e00] Configure hwmap opencl -> yuv420p.


And in the end x264 does the encode so I feel like it would actually be faster 
without OpenCL? Or if that’s an Intel integrated gpu is quick sync an option? I 
am curious because I don’t know how to build ffmpeg with OpenCL, I’ve tried, 
but on the newer versions of macOS, it’s getting harder to use gpus for compute 
other than with cocoa avfoundation or “metal"

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".