Hello, I've recently received some H264 videos marked as AVC3: Duration: 00:29:00.00, start: 0.000000, bitrate: 949 kb/s Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default) Metadata: handler_name : SoundHandler Stream #0:1(und): Video: h264 (Main) (avc3 / 0x33637661), yuvj420p(pc, bt709), 704x396 [SAR 1:1 DAR 16:9], 819 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default) Metadata: handler_name : VideoHandler Stream #0:2: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 192x108 [SAR 72:72 DAR 16:9], 90k tbr, 90k tbn, 90k tbc These are not natively playable by quicktime/iTunes under OSX High Sierra (10.13.1). I can obviously convert them into H264 avc1 the long way, but wondered if there was a quick way of simply changing the metadata of the avc3 stream into avc1? I've tried splitting the audio and video into two streams, and then remuxing. This worked, but the video was "jerky" and unwatchable. Thanks for your help. Ant.
On Sun, Nov 26, 2017 at 17:27:05 -0500, antony baxter wrote:
I've recently received some H264 videos marked as AVC3: [...] Stream #0:1(und): Video: h264 (Main) (avc3 / 0x33637661), yuvj420p(pc, bt709), 704x396 [SAR 1:1 DAR 16:9], 819 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
I can obviously convert them into H264 avc1 the long way, but wondered if there was a quick way of simply changing the metadata of the avc3 stream into avc1?
ffmpeg never just modifies the original, it at least demuxes and remuxes. It doesn't need to reencode "the long way" though. I'm sure there are tools out there to modify the FourCC by just fiddling with a few bytes. Anyway, you could try to remux using ffmpeg instead of re-encoding: $ ffmpeg -i inputvideo -map 0 -c copy outputvideo.mp4 If that happens to retain the avc3 tag, add the option "-tag:v avc1". Moritz
2017-11-26 23:27 GMT+01:00 antony baxter <antony.baxter@gmail.com>:
I can obviously convert them into H264 avc1 the long way, but wondered if there was a quick way of simply changing the metadata of the avc3 stream into avc1?
Of course: Use the hexeditor of your choice, search for "avc3" (it is either on top or at the end of the file) and change it. I am not sure if QT (or WMP) will play the resulting file though, FFmpeg-based players will. As Moritz explained: FFmpeg is not a file editor. Carl Eugen
the same thing happens by default when using ffmpeg to encode hevc/x265 ffmpeg creates an hevc format mp4 with a default fourcc of hev1, which osx will not play via quicktime, finder/quicklook. preview thumbnails/file icons also do not generate in finder. changing the fourcc to hvc1 will make it work across osx in the above mentioned areas... here is the command i used. you may apply the same methods with x264 with -tag:v avc1 $ ffmpeg -i x265.mp4 -c copy -tag:v hvc1 hvc1.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'x265.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf57.76.100 Duration: 00:41:50.01, start: 0.000000, bitrate: 348 kb/s Stream #0:0(und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv, progressive), 1920x1080, 211 kb/s, 30 fps, 30 tbr, 15360 tbn, 30 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : SoundHandler Output #0, mp4, to 'hvc1.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf58.2.100 Stream #0:0(und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, progressive), 1920x1080, q=2-31, 211 kb/s, 30 fps, 30 tbr, 15360 tbn, 15360 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : SoundHandler Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help frame=75300 fps=14676 q=-1.0 Lsize= 106784kB time=00:41:49.98 bitrate= 348.5kbits/s speed= 489x video:64898kB audio:39220kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 2.560526%
On Nov 27, 2017, at 2:26 54PM, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
2017-11-26 23:27 GMT+01:00 antony baxter <antony.baxter@gmail.com>:
I can obviously convert them into H264 avc1 the long way, but wondered if there was a quick way of simply changing the metadata of the avc3 stream into avc1?
Of course: Use the hexeditor of your choice, search for "avc3" (it is either on top or at the end of the file) and change it.
I am not sure if QT (or WMP) will play the resulting file though, FFmpeg-based players will.
As Moritz explained: FFmpeg is not a file editor.
Carl Eugen _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
participants (4)
-
antony baxter -
Carl Eugen Hoyos -
DopeLabs -
Moritz Barsnick